0 Replies Latest reply on Mar 3, 2009 2:09 PM by Eugene Kisly

    reRender area with dinamically id

    Eugene Kisly Newbie

      Need to rerender component with id generated by c:forEach

      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
      <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j" %>
      <%@ taglib uri="http://richfaces.org/rich" prefix="rich" %>
      <%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
      
      <%--
      <a4j:repeat id="juridicalRepeat" value="#{reportRequestLimitManager.requestsPerPageByPrincipalCount}" var="currentNumber"
       rowKeyVar="rowVar">
      --%>
      <c:forEach begin="1" end="${reportRequestLimitManager.requestsPerPageByPrincipal}" var="counter" varStatus="index">
       <h:form id="reportJuridicalForm${index.current}">
       <h:panelGrid id="registrationNumberPanel" columns="4">
       <h:outputText value="#{bundle.registrationNumber}"/>
       <h:inputText id="juridicalIdentification" value="#{juridicalReportPageBeanRequest.registrationNumber}"
       onkeydown="registrationNumberChange(this.value)" maxlength="8"/>
      
       <a4j:commandButton id="getReportButton" value="#{bundle.getreport}"
       action="#{juridicalReportPageBeanRequest.getData}" reRender="includePage:a4jPanel${index.current}">
       <f:setPropertyActionListener
       target="#{juridicalReportPageBeanRequest.subjectType}" value="Juridical"/>
       </a4j:commandButton>
      
      
       </h:panelGrid>
       </h:form>
      
       <h:form id="a4jPanel${index.current}">
       <a4j:outputPanel>
       <h:dataTable id="reportsTable" value="#{resultBean.reportId}" var="reportId">
       <h:column id="reportresult">
       <f:facet name="header">
       <h:outputText value="reports"/>
       </f:facet>
       <h:outputText value="#{reportId}"/>
       </h:column>
       </h:dataTable>
      
       </a4j:outputPanel>
       </h:form>
      </c:forEach>
      <%--
      </a4j:repeat>
      --%>
      
      <h:form>
       <div style="padding-top: 5px;">
       <%--
       <a4j:commandButton id="showButton" action="#{juridicalReportPageBean.show}" value="Show All"/>
       --%>
      
       <a4j:commandButton id="newReport" value="Add new report" reRender="includePage"
       action="#{juridicalReportPageBean.addNewJuridical}"/>
      
       <a4j:commandButton id="clearButton" onclick="clearJuridical()" value="Clear" style="margin-left: 10px;"
       reRender="includePage"/>
      
       <a4j:commandButton id="reportsButton" style="margin-left: 10px;" value="Get reports"
       reRender="reportJuridicalForm" status="juridicalLoading"
       action="#{juridicalReportPageBean.getAllReports}"/>
      
       <a4j:status id="juridicalLoading" onstart="reportButtons(true)" onstop="reportButtons(false)" forceId="true"
       style="padding-left:10px;">
       <f:facet name="start">
       <h:graphicImage value="theme/images/ajax-loader.gif"/>
       </f:facet>
       <f:facet name="stop">
       </f:facet>
       </a4j:status>
      
       </div>
      </h:form>


      Get error According to TLD or attribute directive in tag file, attribute reRender does not accept any expressions

      When
      reRender="includePage:a4jPanel#{index.current}"

      all id are like 'includePage:a4jPanel' (#{index.current} is empty sting)

      Please help solve this problem