jsf 2 - Render ids generated by nested <f:ajax> inside <ui:repeat> do not match those generated by JSF -


my form contains dropdown list inside ui:repeat component. when list item selected, f:ajax call triggers refresh of both dropdown list , several other components inside ui:repeat . im struggling work out correct id format f:ajax render="???????" (see facelet view below). appreciated.

ive supplied raw source view of rendered screen (actual jsf ids) , facelet view showing same components coded.

browser source view

<form id="generalmedicalhistory" name="generalmedicalhistory" method="post" action="..."   <span id="generalmedicalhistory:generalmedicalhistory_p">   <span id="generalmedicalhistory:medhist">     <table border="0" class="table_form">     <select id="generalmedicalhistory:rptk:0:medicalcondition" name="generalmedicalhistory:rptk:0:medicalcondition" >  ---> target id  (ui:repeat) 

facelet view

<h:form id ="generalmedicalhistory"> <h:panelgroup id="generalmedicalhistory_p"> <h:panelgroup id="medhist"> <ui:repeat value="#{f.repeatingitemgroups['medicalhistory'][1]}" var="repeatkey" id="rptk" >       <h:commandlink action="remove_repeating_ig" rendered="${f.items[removeoid].isnew , repeatkey != '1'}"></> <table border="0" class="table_form">   <h:selectonemenu value="${f.items[oid].value}" id="medicalcondition" >      <f:selectitems value="${f.items[oid].codelistitems}"/>    <f:ajax render="?????????" event="click" listener="#{f.clearmodelvaluesviaajax}"  />   </h:selectonemenu> </table> </h:panelgroup>      </h:panelgroup>       </h:form> 

ive tried following none have worked...

  1. f:ajax render="generalmedicalhistory:rptk:0:medicalcondition"
  2. f:ajax render=":generalmedicalhistory:rptk:0:medicalcondition"
  3. f:ajax render="generalmedicalhistory_p:medhist:rptk:0:medicalcondition"
  4. f:ajax render=":generalmedicalhistory_p:medhist:rptk:0:medicalcondition"
  5. f:ajax render="generalmedicalhistory:generalmedicalhistory_p:medhist:rptk:0:medicalcondition"
  6. f:ajax render=":generalmedicalhistory:generalmedicalhistory_p:medhist:rptk:0:medicalcondition"

the <ui:repeat> namingcontainer. can reference client id relative <ui:repeat> itself.

your code example confusing, you're attempting perform render="@this", here's different , more elaborate example wherein menu component , input component been ajax-updated on change of current menu:

<ui:repeat ...>     <h:selectonemenu ...>         ...         <f:ajax ... render="othermenu someinput" />     </h:selectonemenu>     <h:selectonemenu id="othermenu" ... />     <h:inputtext id="someinput" ... /> </ui:repeat> 

see also:


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -