jsf 2 - Duplicate IDs in JSF -


i trying automatic code-generation jsf pages. along problem duplicate ids showed up, not understand.

the follwing code snippet

<h:form id="myform" prependid="true" >     <p:panelgrid id="mypanel1">          <p:panelgrid id="grid" />     </p:panelgrid>     <p:panelgrid id="mypanel2">         <p:panelgrid id="grid" />     </p:panelgrid> </h:form> 

results in "duplicat id error", says id myform:grid has been found on page. expected 2 different ids pattern myform:mypanel1:grid , myform:mypanel2:grid

in component tree shows "panelids"

+id: myform    type: javax.faces.component.html.htmlform@3720dee3         +id: mypanel1          type: org.primefaces.component.panelgrid.panelgrid@4f09255b           +id: grid  <===============            type: org.primefaces.component.panelgrid.panelgrid@6173a1e6         +id: mypanel2          type: org.primefaces.component.panelgrid.panelgrid@6e8a3505           +id: grid  <===============            type: org.primefaces.component.panelgrid.panelgrid@339f13f5 

what problem here? , how can make "grid-ids" unique?


i using primefaces 4.0 mojarra 2.1.27 running on gf 3.1.2.2

(however, problem occures when using plan jsf, not tag special primefaces-question)

only components implement namingcontainer provide namespaces descendant component identifiers.

it possible control container without performing function. uipanel instances control layout , don't incur overhead involved in this.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -