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
Post a Comment