2 Replies Latest reply on Aug 24, 2010 5:06 AM by Ilya Shaikovsky

    Binding doesn't work inside a4j:repeat

    Riham Fayez Newbie

      i have list of  beans  for each bean i have to create 2 dynamic input text box and 1 selectone menu and 1 extended data table. and in the on change event for the select one menu i call an action that create or hide extended table accordying to the selected value form the list.

       

      the problem is that i need the page to be updated [ajax] so when i use c:foreach instead of a4j:repeat un prdicatble behavior occurs.The only problem is that when binding data grid error occurrs

      any help? pleaseeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee this is very urgent.

       

      Below code snippet 

      <a4j:outputPanel id="effects" >
              <div>
                     <h3>#{manageDMV.effectsSubTitle}</h3>
                  <div>

             <a4j:form id="platTrait1Form"  >
                     <a4j:outputPanel ajaxRendered="true">
           <h:messages layout="table" showDetail="true" showSummary="true" />
          </a4j:outputPanel>
              <!-- <c:forEach items="#{manageDMVBean.genaticFeaturePlantTraitBeans}" var="genaticFeaturePlantTraitBean"
                        varStatus="status" -->

              <a4j:repeat value="#{manageDMVBean.genaticFeaturePlantTraitBeans}" var="genaticFeaturePlantTraitBean"
                           rowKeyVar="rowIndexs">    >
                  <div>
                      <h3>#{manageDMV.plantTrait} #{genaticFeaturePlantTraitBean.genaticFeaturePlantTraitTitle}</h3>
                            <div>
                                <div id="formsForm2">
                                      <div id="formsFormBd2">
                                        <div>
                                          <label>#{manageDMV.confidence}</label>
                                            <div>
                                                <h:inputText id="confidenceLevel"
                                                  styleClass="formsInputText"
                                                 value="#{genaticFeaturePlantTraitBean.confidenceLevel}"/>
                                            </div>
                                        </div>
                                      <div>
                                          <label>#{manageDMV.explanation}</label>
                                            <div>
                                               <h:inputText id="varianceExplanation"
                                                       styleClass="formsInputText"
                                                       value="#{genaticFeaturePlantTraitBean.varianceExplanation}"/>
                                            </div>
                                      </div>
                                       <div>
                                          <label>#{manageDMV.effectType}</label>
                                            <div>
                                                <h:selectOneMenu id="effectTypeList"      
                                                     value="#{genaticFeaturePlantTraitBean.effectType}">
                                                  <f:selectItems value="#{manageDMVBean.dmVersionHeaderBean.effectTypeList}" />
                                                  <a4j:support id="support${status.index}"   ajaxSingle="true"
                                                          event="onchange" action="changeEffectType"
                                                          reRender="effects,outputPanelee" />
                                                </h:selectOneMenu>
                                            </div>
                                       </div>
            
                                              <div></div>
                                              <div></div>
                                              <div></div>
                                              <div>
                                                  haplotypeEffectsGrid${status.index}
                                                  id#{genaticFeaturePlantTraitBean.id}
                                                
                                                  <rich:extendedDataTable id="haplotypeEffectsGrid"
                                                         tableState="#{genaticFeaturePlantTraitBean.haplotypeEffectsGrid.tableState}"
                                                         binding="#{genaticFeaturePlantTraitBean.haplotypeEffectsGrid.dataGridComponent}"
                                                         width="100%" onRowClick="selectCheckBox(this);"
                                                          rendered="#{genaticFeaturePlantTraitBean.showGrid}">

                                                      <rich:column title="#{manageDMV.editLink}"
                                                                   label="#{manageDMV.editLink}">
                                                          <f:facet name="header">
                                                              #{manageDMV.editLink}
                                                          </f:facet>

                                                          <a4j:commandButton id="editLink"
                                                                             image="../style/gfx/icons/edit.png" immediate="true"/>
                                                          <rich:toolTip for="editLink" value="#{manageDMV.editLink}"/>
                                                      </rich:column>
                                                      <h:inputHidden id="haplotypeEffectsGrid"
                                                                     value="#{genaticFeaturePlantTraitBean.haplotypeEffectsGrid}"/>
                                                  </rich:extendedDataTable>
                                              </div>

                                   
                                </div>
                          </div>
                      </div>
                  </div>
                 <!--Put grid here if exist-->
                                                            
           </a4j:repeat>
           </a4j:form>
         </div>
      </div>
      </a4j:outputPanel>