myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kai Wiemer" <k_ae...@web.de>
Subject Re: Duplicate Id problem with panelNavigation2
Date Mon, 05 Jan 2009 07:25:47 GMT
Hi!

Thanks for your reply.

For my example it makes no difference if I remove the forceId
attribute. The exception is even thrown after _all_ the ids have been
removed.

<%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<f:view>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    </head>
    <body>
    <t:div>
        <t:div>
            <h:form>
                <t:panelNavigation2 layout="list" itemClass="navigationItem"
                    activeItemClass="selectedNavigationItem"
openItemClass="openNavigationItem">
                    <t:navigationMenuItem value="Navigation Item 1"
action="welcome" />
                    <t:navigationMenuItem value="Navigation Item 2"
action="welcome" />
                    <t:navigationMenuItem value="Navigation Item 3">
                        <t:navigationMenuItem value="Navigation Item 3.1">
                            <t:navigationMenuItem value="Navigation Item 3.1.1"
                                action="noActionForThisExample" />
                        </t:navigationMenuItem>
                    </t:navigationMenuItem>
                </t:panelNavigation2>
            </h:form>
        </t:div>
    </t:div>
    <t:div>
        <t:div>
            <h:form>
                <h:panelGrid border="0" columns="2">
                    <h:outputText value="You are logged in as:"></h:outputText>
                    <h:outputText value="name (role: myRole)"></h:outputText>

                    <h:outputText value="old password"></h:outputText>
                    <h:inputSecret id="is1" required="true" />

                    <h:outputText value="new password"></h:outputText>
                    <h:inputSecret id="is2" required="true" />

                    <h:outputText value="repeat new password"></h:outputText>
                    <h:inputSecret id="is3" required="true" />

                    <h:outputText />
                    <h:commandButton styleClass="dialogButton" value="save"
                        action="noActionForThisExample"></h:commandButton>
                </h:panelGrid>
                <h:message for="is1" />
                <h:message for="is2" />
                <h:message for="is3" />
            </h:form>
        </t:div>
    </t:div>
    </body>
    </html>
</f:view>

Besides I need to assign the ids manually due to css reasons.

Firstly I tried the above example with 'client' for context parameter
'javax.faces.STATE_SAVING_METHOD' => the exception is thrown. Secondly
with 'server' => no exception thrown.

So, unfortunately no difference for me.

Bye

Kai

On Sun, Jan 4, 2009 at 18:43, Volker Weber <v.weber@inexso.de> wrote:
> Hi Kai,
>
> please try without forceId!
>
> I don't know if it could help, but forceId is very evil. And as log as
> forceId is used you should always expect dublicateId exceptions.
>
> see:
> http://wiki.apache.org/myfaces/forceId#head-801527c2f31f404d73f943966595e2d0dd200d76
>
> Regards,
>    Volker
>
> 2009/1/2 Kai Wiemer <k_aexon@web.de>:
>> Hello together,
>> I've got a problem concerning duplicated ids with tomahawks's
>> panelNavigation2. My current configuration is tomahawk-1.1.8 and
>> myfaces-1.2.5. Ok, here's the jsp:
>>
>> <%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
>> <%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
>> <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
>> <%@taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
>> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
>>   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
>> <f:view>
>>   <html xmlns="http://www.w3.org/1999/xhtml">
>>   <head>
>>   </head>
>>   <body>
>>   <t:div id="navigation" forceId="true">
>>       <t:div id="navigation-inside" forceId="true">
>>           <h:form>
>>               <t:panelNavigation2 layout="list" itemClass="navigationItem"
>>                   activeItemClass="selectedNavigationItem"
>> openItemClass="openNavigationItem">
>>                   <t:navigationMenuItem value="Navigation Item 1"
>> action="welcome" />
>>                   <t:navigationMenuItem value="Navigation Item 2"
>> action="welcome" />
>>                   <t:navigationMenuItem value="Navigation Item 3">
>>                       <t:navigationMenuItem value="Navigation Item 3.1">
>>                           <t:navigationMenuItem value="Navigation Item 3.1.1"
>>                               action="noActionForThisExample" />
>>                       </t:navigationMenuItem>
>>                   </t:navigationMenuItem>
>>               </t:panelNavigation2>
>>           </h:form>
>>       </t:div>
>>   </t:div>
>>   <t:div id="main" forceId="true">
>>       <t:div id="main-inside" forceId="true">
>>           <h:form>
>>               <h:panelGrid border="0" columns="2">
>>                   <h:outputText value="You are logged in as:"></h:outputText>
>>                   <h:outputText value="name (role: myRole)"></h:outputText>
>>                   <h:outputText value="old password"></h:outputText>
>>                   <h:inputSecret id="is1" required="true" />
>>                   <h:outputText value="new password"></h:outputText>
>>                   <h:inputSecret id="is2" required="true" />
>>                   <h:outputText value="repeat new password"></h:outputText>
>>                   <h:inputSecret id="is3" required="true" />
>>                   <h:outputText />
>>                   <h:commandButton styleClass="dialogButton" value="save"
>>                       action="noActionForThisExample"></h:commandButton>
>>               </h:panelGrid>
>>               <h:message for="is1" />
>>               <h:message for="is2" />
>>               <h:message for="is3" />
>>           </h:form>
>>       </t:div>
>>   </t:div>
>>   </body>
>>   </html>
>> </f:view>
>>
>> Now the web.xml:
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xmlns="http://java.sun.com/xml/ns/javaee"
>> xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
>> xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
>> http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
>> id="WebApp_ID" version="2.5">
>> <display-name>Keineahnung</display-name>
>> <welcome-file-list>
>> <welcome-file>index.html</welcome-file>
>> <welcome-file>index.htm</welcome-file>
>> <welcome-file>index.jsp</welcome-file>
>> <welcome-file>default.html</welcome-file>
>> <welcome-file>default.htm</welcome-file>
>> <welcome-file>default.jsp</welcome-file>
>> </welcome-file-list>
>> <servlet>
>> <servlet-name>Faces Servlet</servlet-name>
>> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
>> <load-on-startup>1</load-on-startup>
>> </servlet>
>> <servlet-mapping>
>> <servlet-name>Faces Servlet</servlet-name>
>> <url-pattern>*.jsf</url-pattern>
>> </servlet-mapping>
>> <context-param>
>> <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
>> <param-value>client</param-value>
>> </context-param>
>>
>>  <!-- TOMAHAWK -->
>> <filter>
>> <filter-name>MyFacesExtensionsFilter</filter-name>
>> <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
>> <!--
>> <filter-class>org.apache.myfaces.component.html.util.ExtensionsFilter</filter-class>
>> -->
>> <init-param>
>> <param-name>uploadMaxFileSize</param-name>
>> <param-value>10m</param-value>
>> </init-param>
>> <init-param>
>> <param-name>uploadThresholdSize</param-name>
>> <param-value>50k</param-value>
>> </init-param>
>> <init-param>
>> <param-name>uploadRepositoryPath</param-name>
>> <param-value>/tmp</param-value>
>> </init-param>
>> </filter>
>> <filter-mapping>
>> <filter-name>MyFacesExtensionsFilter</filter-name>
>> <url-pattern>*.jsf</url-pattern>
>> </filter-mapping>
>> <filter-mapping>
>> <filter-name>MyFacesExtensionsFilter</filter-name>
>> <url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
>> </filter-mapping>
>>   <!-- TOMAHAWK -->
>> </web-app>
>>
>> faces-config.xml is empty and finally the errormessage i receive when
>> clicking on save button (maybe html is more comfprtable?
>> http://www.grafik-und-text.de/files/error.html):
>>
>> Client-id : j_id_jsp_1037428323_3_j_id_jsp_1037428323_4_item0 is
>> duplicated in the faces tree. Component :
>> j_id_jsp_1037428323_3_j_id_jsp_1037428323_4_item0, path:
>> {Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId:
>> /duplicatedId.jsp][Class: org.apache.myfaces.custom.div.Div,Id:
>> navigation][Class: org.apache.myfaces.custom.div.Div,Id:
>> navigation-inside][Class: javax.faces.component.html.HtmlForm,Id:
>> j_id_jsp_1037428323_3][Class:
>> org.apache.myfaces.custom.navmenu.htmlnavmenu.HtmlPanelNavigationMenu,Id:
>> j_id_jsp_1037428323_4][Class:
>> org.apache.myfaces.custom.navmenu.htmlnavmenu.HtmlCommandNavigationItem,Id:
>> j_id_jsp_1037428323_3_j_id_jsp_1037428323_4_item0]}
>>
>> Caused by:
>> java.lang.IllegalStateException - Client-id :
>> j_id_jsp_1037428323_3_j_id_jsp_1037428323_4_item0 is duplicated in the
>> faces tree. Component :
>> j_id_jsp_1037428323_3_j_id_jsp_1037428323_4_item0, path:
>> {Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId:
>> /duplicatedId.jsp][Class: org.apache.myfaces.custom.div.Div,Id:
>> navigation][Class: org.apache.myfaces.custom.div.Div,Id:
>> navigation-inside][Class: javax.faces.component.html.HtmlForm,Id:
>> j_id_jsp_1037428323_3][Class:
>> org.apache.myfaces.custom.navmenu.htmlnavmenu.HtmlPanelNavigationMenu,Id:
>> j_id_jsp_1037428323_4][Class:
>> org.apache.myfaces.custom.navmenu.htmlnavmenu.HtmlCommandNavigationItem,Id:
>> j_id_jsp_1037428323_3_j_id_jsp_1037428323_4_item0]}
>>
>>
>> java.lang.IllegalStateException: Client-id :
>> j_id_jsp_1037428323_3_j_id_jsp_1037428323_4_item0 is duplicated in the
>> faces tree. Component :
>> j_id_jsp_1037428323_3_j_id_jsp_1037428323_4_item0, path:
>> {Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId:
>> /duplicatedId.jsp][Class: org.apache.myfaces.custom.div.Div,Id:
>> navigation][Class: org.apache.myfaces.custom.div.Div,Id:
>> navigation-inside][Class: javax.faces.component.html.HtmlForm,Id:
>> j_id_jsp_1037428323_3][Class:
>> org.apache.myfaces.custom.navmenu.htmlnavmenu.HtmlPanelNavigationMenu,Id:
>> j_id_jsp_1037428323_4][Class:
>> org.apache.myfaces.custom.navmenu.htmlnavmenu.HtmlCommandNavigationItem,Id:
>> j_id_jsp_1037428323_3_j_id_jsp_1037428323_4_item0]}
>>       at org.apache.myfaces.application.jsp.JspStateManagerImpl.checkForDuplicateIds(JspStateManagerImpl.java:419)
>>       at org.apache.myfaces.application.jsp.JspStateManagerImpl.checkForDuplicateIds(JspStateManagerImpl.java:431)
>>       at org.apache.myfaces.application.jsp.JspStateManagerImpl.checkForDuplicateIds(JspStateManagerImpl.java:431)
>>       at org.apache.myfaces.application.jsp.JspStateManagerImpl.checkForDuplicateIds(JspStateManagerImpl.java:431)
>>       at org.apache.myfaces.application.jsp.JspStateManagerImpl.checkForDuplicateIds(JspStateManagerImpl.java:431)
>>       at org.apache.myfaces.application.jsp.JspStateManagerImpl.checkForDuplicateIds(JspStateManagerImpl.java:431)
>>       at org.apache.myfaces.application.jsp.JspStateManagerImpl.saveSerializedView(JspStateManagerImpl.java:372)
>>       at javax.faces.application.StateManager.saveView(StateManager.java:87)
>>       at org.apache.myfaces.application.jsp.JspViewHandlerImpl$StateMarkerAwareWriter.flushToWriter(JspViewHandlerImpl.java:608)
>>       at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:392)
>>       at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
>>       at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:140)
>>       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:155)
>>       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>>       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>>       at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:301)
>>       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>>       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>>       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>>       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>>       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>>       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>>       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>>       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
>>       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
>>       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>>       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
>>       at java.lang.Thread.run(Unknown Source)
>>
>> The strange thing about is is, that when i use "server" as
>> javax.faces.STATE_SAVING_METHOD, the validation works and no
>> duplicated id error is thrown. I read something about a bug that
>> should have been fixed in a former version of tomahawk. Maybe it's
>> still existent?
>>
>> Any suggestions? Thanks in andvance.
>>
>> Kai
>>
>
>
>
> --
> inexso - information exchange solutions GmbH
> Bismarckstra├če 13      | 26122 Oldenburg
> Tel.: +49 441 4082 356 |
> FAX:  +49 441 4082 355 | www.inexso.de
>

Mime
View raw message