jsf 2 - Empty values of <h:selectOneMenu>inside <ui:repeat> is not set to backing bean during ajax call -


the empty/null value of h:selectonemenu during ajax call not set property in backing bean, whereas if select dropdown item has non empty / not null value, set property in backing bean during ajax call. have notice behaviour if use h:selectonemenu & f:ajax inside ui:repeat tag. and, without ui:repeat tag , values(both empty , non empty) set property in backing bean during ajax call.

below code snipet of above mentioned scenario:

<h:panelgrid id="details"> <ui:repeat id="listid" value="#{new.list}" var="item" varstatus="itemstatus">     <h:panelgrid id="iddoc">     <ui:repeat id="doclistid" value="#{item.docs}" var="docitem" varstatus="docstatus">         <h:selectonemenu id="type"  value="#{docitem.doctype}" label="type" style="" styleclass='' >                  <f:selectitems value="#{new.docselections}"/>                  <f:ajax onevent="refreshdoc" event="valuechange" render="@this :form:listid:doclistid:iddoc" execute=":form:listid:details" listener="#{new.save}"/>             </h:selectonemenu>     </ui:repeat>     </h:panelgrid> </ui:repeat> </h:panelgrid> 

is there problem in way have used ui:repeat,h:selectonemenu , f:ajax?

you seem using mojarra. has indeed had several issues related (nested) <ui:repeat> , component state saving. try upgrading mojarra the latest version.

an alternative replace <h:panelgrid><ui:repeat> <h:datatable> generates same markup. <h:datatable> doesn't suffer <ui:repeat> issues.

<h:datatable id="details" value="#{new.list}" var="item" binding="#{itemstatus}">   <h:column>     <h:datatable id="iddoc" value="#{item.docs}" var="docitem" binding="#{docstatus}">       <h:column>         <h:selectonemenu id="type"  value="#{docitem.doctype}" label="type" style="" styleclass='' >           <f:selectitems value="#{new.docselections}"/>           <f:ajax onevent="refreshdoc" event="valuechange" render="@this :form:listid:doclistid:iddoc" execute=":form:listid:details" listener="#{new.save}"/>         </h:selectonemenu>       </h:column>     </h:datatable>   </h:column> </h:datatable> 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -