jsf - p:selectOneMenu, custom content and editable=true -
i have next usage of p:selectonemenu
:
<p:selectonemenu id="selectfield" value="#{somebean.somefield}" converter="#{selectitemconverter}" var="x" editable="true"> <f:selectitems value="#{selectitemsbean.getselectitems(tab, field)}" var="si" itemlabel="#{si.label}" itemvalue="#{si}" /> <p:column> <h:outputtext value="#{si.label}" /> </p:column> <p:column> <h:graphicimage library="images" name="noway_16x16.png" title="#{si.disabledreason}" rendered="#{si.disabled}" /> </p:column> <p:ajax event="change" update="@form" partialsubmit="true" process="selectfield" /> </p:selectonemenu>
as can see, utilize custom content in combination editable=true
. when submit form, converter gets label of selected item value, not actual value. in html page, values correct, e.g. <option value="c">c-style mounting</option>
. editable=false
, right value (e.g. c
sent converter, editable=true
converter retrieves c-style mounting
.
what want user can either select 1 of pre-defined items in list , server submits value of item or user enters , submitted value. current behavior bit unusual - or wanting much?
jsf primefaces selectonemenu
No comments:
Post a Comment