0

I have a problem. Just sometimes i get this error "duplicate Id for a component mainForm:_id251:_id254" when i press one of those buttons. What i'm doing wrong?

<ui:decorate template="/tags/panelPage.jspx">
<ui:define name="content">
<a4j:region>
....
<a4j:commandButton actionListener="#{pageBean.filter}" id = "filter" 
     rendered="true" 
     reRender="block6include,block7include, block8include, block9include">
</a4j:commandButton>
<a4j:commandButton actionListener="#{pageBean.resetFilter}" id = "reset" 
     rendered="true"
     reRender="block6include, block7include, block8include, block9include">
</a4j:commandButton>

     <!-- BLOCK6-->
     <h:panelGroup id="block6include">    
        <a4j:include viewId="block6.jspx"/>
     </h:panelGroup>
     <!-- /BLOCK6-->

     <!-- BLOCK7 -->
     <h:panelGroup id="block7include">  
        <a4j:include viewId="block7.jspx"/>
     </h:panelGroup>
     <!-- /BLOCK7 -->

     <!-- BLOCK8 -->
     <h:panelGroup id="block8include">
        <a4j:include viewId="block8.jspx"/>
     </h:panelGroup>
     <!-- /BLOCK8-->

     <!-- BLOCK9 -->
     <h:panelGroup id="block9include">
        <a4j:include viewId="block9.jspx"/>
     </h:panelGroup>
     <!-- /BLOCK9-->
...
</ui:define>
</ui:decorate> 
</a4j:region>

"/tags/panelPage.jspx"

...
<a4j:form id="mainForm" enctype="#{entype}">
...
<ui:insert name="content"/>
...
</a4j:form>

"block6.jspx"

<ui:composition>
<ui:decorate template="/tags/panelBlock.jspx">
<ui:param name="id" value="block61"/>
<ui:define name="content">
...
</ui:define> 
</ui:decorate>

<ui:decorate template="/tags/panelBlock.jspx">
<ui:param name="id" value="block62"/>
<ui:define name="content">
...
</ui:define> 
</ui:decorate>
</ui:composition>

"/tags/panelBlock.jspx"

<rich:panel  id="#{id}">
...
<ui:insert name="content"/>  
...
</rich:panel>
  • The problem is not in those buttons. The problem is in the way how the component `mainForm:_id251:_id254` is being built. You'd better show the code for that instead. – BalusC Nov 28 '13 at 10:17
  • But why this happens just sometimes? It happens just randomly after i press few times one of those buttons. – user3045188 Nov 28 '13 at 11:41
  • For example, because you're using `binding` on a view/session scoped bean property. Really, this isn't answerable without seeing a valid SSCCE. See also this answer for an overview of possible causes: http://stackoverflow.com/questions/2101755/im-getting-duplicate-id-error-after-adding-binding-attribute/2101768#2101768 In rare cases it's really a bug in JSF implementation used. Try upgrading to latest available. – BalusC Nov 28 '13 at 11:46

0 Answers0