pe:masterDetail problems - doesn't navigate

Community Driven Extensions Project
jakorsme
Posts: 58
Joined: 10 Dec 2010, 02:43

31 Aug 2012, 05:38

Everything shows up fine until I click the link that's supposed to make it navigate. Then I get:

SEVERE: Error Rendering View[/users.xhtml]
java.lang.IllegalStateException: Component ID form:userTable:j_id2 has already been found in the view.

Followed by:
WARNING: StandardWrapperValve[Faces Servlet]: PWC1406: Servlet.service() for servlet Faces Servlet threw exception
java.lang.IllegalStateException: CDATA tags may not nest

I heavily researched both primefaces forums and google for the id2 duplication. The fixes don't work which is primarily; wrap facet contents in </h:panelGroup>

The id duplication seems to be in the :
<p:commandLink id="cmdLink" value="#{userRec.usrName}">
<pe:selectDetailLevel id="sdl" contextValue="#{userRec}" />

-------------
type: org.primefaces.component.column.Column@22da9af3
+id: cmdLink
type: org.primefaces.component.commandlink.CommandLink@3df2d965
+id: j_id2
type: javax.faces.component.UIParameter@129e95a9
+id: j_id3
type: javax.faces.component.UIParameter@697393cb
+id: j_id4
type: javax.faces.component.UIParameter@22ec2a83
+id: j_id2
type: javax.faces.component.UIParameter@3edb105e
+id: j_id3
type: javax.faces.component.UIParameter@200fab8f
+id: j_id4
type: javax.faces.component.UIParameter@64c849ba
+id: j_id2
type: javax.faces.component.UIParameter@19608607
+id: j_id3
type: javax.faces.component.UIParameter@fff4295
+id: j_id4
type: javax.faces.component.UIParameter@3f6c4c67
+id: j_id2
type: javax.faces.component.UIParameter@5f0c1eb8
+id: j_id3
type: javax.faces.component.UIParameter@14b4f2c8
+id: j_id4
type: javax.faces.component.UIParameter@73af3316
+id: j_idt46
type: org.primefaces.component.column.Column@734324af
+id: j_idt47
type: javax.faces.component.html.HtmlOutputText@3d1d9847
+id: j_idt48
type: org.primefaces.component.column.Column@61f87ca9
----------------------

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:pe="http://primefaces.org/ui/extensions">
    >
    <h:head>

    </h:head>

    <h:body>

        <ui:composition template="/templates/fullpageT.xhtml">

            <ui:define name="centerT">

                <h:form id="form">
                    <p:growl id="messages"/>
                    <h:panelGroup>
                    <pe:masterDetail id="masterDetail" selectLevelListener="#{selectLevelListener.handleNavigation}"
                                     showAllBreadcrumbItems="true">  
                        <pe:masterDetailLevel level="1">  
                            <f:facet name="label">  
                                <h:panelGroup>
                                <h:outputFormat value="Overview">
                                </h:outputFormat>  
                                    </h:panelGroup>
                            </f:facet>  

                            <p:dataTable id="userTable" var="userRec" value="#{user.userList}" rowKey="#{userRec.usrId}" 
                                         selection="#{user.selectedUser}" selectionMode="single"
                                         paginator="true" rows="100" 
                                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
                                         rowsPerPageTemplate="10,25,50,100,250,500"
                                         >  
                                <f:facet name="header">
                                    <h:panelGroup>
                                    <h:outputFormat value="User Management"/> 
                                    </h:panelGroup>
                                </f:facet>  

                                <p:column headerText="Name" sortBy="#{userRec.usrName}" filterBy="#{userRec.usrName}">
pe:
                                    <p:commandLink id="cmdLink" value="#{userRec.usrName}">  
                                        <pe:selectDetailLevel id="sdl" contextValue="#{userRec}" />  
                                    </p:commandLink>
                                </p:column>
                                <p:column headerText="Email" sortBy="#{userRec.usrEmail}" filterBy="#{userRec.usrEmail}">  
                                    <h:outputText value="#{userRec.usrEmail}" />  
                                </p:column>
                                <p:column headerText="Status" sortBy="#{userRec.usrStatus}" filterBy="#{userRec.usrStatus}">  
                                    <h:outputText value="#{userRec.usrStatus}" />  
                                </p:column>
                                 
                            </p:dataTable>
                        </pe:masterDetailLevel> 
                        <pe:masterDetailLevel level="2" contextVar="uRec" levelLabel="User Detail">  
                            <h:panelGrid id="userDetail" columns="2">  
                                <h:outputText value="Name (string)"/>  
                                <p:inputText value="#{uRec.usrName}" required="true" label="Name"/>  
                                <h:outputText value="Email (string)"/>  
                                <p:inputText value="#{uRec.usrEmail}" required="true" label="Email"/>  
                                      
                                
                                <h:outputText value="Status (boolean)"/>  
                                <p:inputText value="#{uRec.usrStatus}" required="true" label="Status"/>  
                                    
                            </h:panelGrid>
                        </pe:masterDetailLevel>
                    </pe:masterDetail>
                       </h:panelGroup>
                </h:form>
            </ui:define>
        </ui:composition>

    </h:body>
</html>
Primefaces: 4.0
Primefaces-extensions: 1.1.0
JSF: 2.2

Glassfish 4
Netbeans 7.3

sreedharg
Posts: 8
Joined: 05 Apr 2012, 09:19

03 Sep 2012, 16:33

I have the same issue, i encountered when i moved to 3.4 RC1 and mojarra 2.1.13...
i ripped of all my code... as you said.. <h:panelGroup> does not work... looks like issue is w.r.t JSF....

Any solutions is highly appreciated.. mean while changing version of mojarra!!

User avatar
Oleg
Expert Member
Posts: 3803
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

03 Sep 2012, 23:41

Hi guys,

I haven't tested MasterDetail with new Mojarra 2.1.13 and PrimeFaces 3.4. But I had Mojarra issues with MasterDetail in the past (reported them and they were fixed by Mojarra's team). I will do tests with new versions before our release of course. I think I even know what is wrong here. There was an issue with ID generation of dynamic components (from view or closest naming container). I guess I should adjust ID generation in MasterDetail to new Mojarra's approach.

Can you create an issue ticket regarding this in our issue tracker? Thanks!
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

jakorsme
Posts: 58
Joined: 10 Dec 2010, 02:43

03 Sep 2012, 23:48

I created defect # 246 with the same title as this thread.
I pointed to this thread for details and sample code.

John

P.S. primefaces-extensions version: 0.5.1
Primefaces: 4.0
Primefaces-extensions: 1.1.0
JSF: 2.2

Glassfish 4
Netbeans 7.3

User avatar
Oleg
Expert Member
Posts: 3803
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

04 Sep 2012, 06:51

Thanks, I will look into this. I think the issue is on the Mojarra's side. It seems dynamic added component is not removed correct.
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

jakorsme
Posts: 58
Joined: 10 Dec 2010, 02:43

04 Sep 2012, 18:02

Thank you Oleg.

This bug has our Primefaces development virtually halted.

John
Primefaces: 4.0
Primefaces-extensions: 1.1.0
JSF: 2.2

Glassfish 4
Netbeans 7.3

User avatar
Oleg
Expert Member
Posts: 3803
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

04 Sep 2012, 18:45

I suggest to move temporary to Mojarra 2.1.10. We have 2.1.10 and MasterDetail works fine. There are no big differences between 2.1.10 and 2.1.13, expect bugs ;)
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

jakorsme
Posts: 58
Joined: 10 Dec 2010, 02:43

04 Sep 2012, 21:32

I will try the .10 release.
But note that I am on the .11 release, not .13

Thanks.
Primefaces: 4.0
Primefaces-extensions: 1.1.0
JSF: 2.2

Glassfish 4
Netbeans 7.3

jakorsme
Posts: 58
Joined: 10 Dec 2010, 02:43

05 Sep 2012, 03:47

Just moved 2.1.10 (from 2.1.11) and the bug is still there, exactly as before with 11.

<!-- JSF 2 -->
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.1.10</version>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>2.1.10</version>
</dependency>
Primefaces: 4.0
Primefaces-extensions: 1.1.0
JSF: 2.2

Glassfish 4
Netbeans 7.3

User avatar
Oleg
Expert Member
Posts: 3803
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

05 Sep 2012, 17:46

Hmm... strange. This could be ID on pe:selectDetailLevel. Why do you use ID?

Code: Select all

<pe:selectDetailLevel id="sdl" .../>
I think you should use it without ID. Can you try this please?

Code: Select all

<pe:selectDetailLevel .../>
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests