jsf 2 - change selected item of selectonemenu primefaces by managedbean of javascript -


i want change selected value of selectonemenu either managed bean or javascript:

<p:selectonemenu id="edit-article-famille" widgetvar="editfamille"     required="true" requiredmessage="veuillez choisir une famille"     value="#{articlesmb.selectedfamille}">   <f:selectitem itemlabel="selectionner famille" itemvalue=""/>   <f:selectitems value="#{articlesmb.listfamilles}"/> </p:selectonemenu> 

how can it? in primefaces user guide, don't talk that.

you can set value of p:selectonemenu widgetvar in javascript:

editfamille.selectvalue(value); 

value value of selectitem.

or in more recent versions of primefaces via

pf('editfamille').selectvalue(value) 

Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -