Duplicate component ID error while refresh
[Logo]
Forums for ICEfaces and ICEpdf
[Search] Search   [Recent Topics] Recent Topics   [Groups] Home Page | www.icefaces.org  [Register] Register  [Login] Login 
Duplicate component ID error while refresh  XML
Forum Index -> Components Go to Page: 1, 2 Next 
Author Message
satyajitchainy

Joined: 29/12/2006 00:00:00
Messages: 7
Offline


Hi,
With the below code when I am trying to refresh the page,I am getting the following error.I find it is the dtatatable binding after adding which I am getting the error.Would somebody please help me to solve the problem.

- Failed to execute JSP lifecycle.
java.lang.IllegalStateException: Duplicate component ID : myForm:itemID:_id8
at com.icesoft.faces.webapp.parser.Parser.executeJspLifecycle(Parser.java:176)

Code:
<f:view xmlns:h="http://java.sun.com/jsf/html"
 	xmlns:f="http://java.sun.com/jsf/core"
 	xmlns:ice="http://www.icesoft.com/icefaces/component">
 
 	<ice:outputDeclaration doctypeRoot="HTML"
 		doctypePublic="-//W3C//DTD HTML 4.01 Transitional//EN"
 		doctypeSystem="http://www.w3.org/TR/html4/loose.dtd" />
 
 	<html>
 	<head>
 	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></meta>
 	<link href="css/showcase_style.css" rel="stylesheet" type="text/css" />
 
 	</head>
 
 	<body>
 
 	<ice:form id="myForm">
 		<ice:dataTable value="#{testBean.tableData}" id="itemID" rows="5"
 			var="pnt" binding="#{testBean.myDataTable}">
 
 			<ice:column>
 				<f:facet name="header">
 					<ice:outputText value="name" />
 				</f:facet>
 				<ice:outputText value="#{pnt.name}" />
 			</ice:column>
 		</ice:dataTable>
 	</ice:form>
 	</body>
 	</html>
 </f:view>


Code:
package com.test;
 
 
 import com.icesoft.faces.component.ext.HtmlDataTable;
 
 public class TestBean {
 
 	HtmlDataTable myDataTable = null;
 
 	public Parent[] getTableData() {
 
 		return dataList;
 	}
 
 	private Parent[] dataList = new Parent[] { new Parent("XXX"),
 			new Parent("YYY"), new Parent("ZZZ") };
 
 	public class Parent {
 		String name;
 
 		public Parent(String name) {
 			this.name = name;
 		}
 
 		public String getName() {
 			return name;
 		}
 
 		public void setName(String name) {
 			this.name = name;
 		}
 
 	}
 
 	public HtmlDataTable getMyDataTable() {
 		return myDataTable;
 	}
 
 	public void setMyDataTable(HtmlDataTable myDataTable) {
 		this.myDataTable = myDataTable;
 	}
 
 }


Code:
<managed-bean>
         <description>
             Backing bean that controls panel layout
         </description>
         <managed-bean-name>testBean</managed-bean-name>
         <managed-bean-class>
             com.test.TestBean
         </managed-bean-class>
         <managed-bean-scope>session</managed-bean-scope>
  </managed-bean>


Any help will be highly appreciated.

Thanks
Satyajit


adnan.durrani


Joined: 19/01/2006 00:00:00
Messages: 436
Offline


Hi Satyajit,

Thanks for clean posting, I was able to create an application using the code provided by you without making any changes, the good part is that I never found any exception on page refresh.

I have tested it against ICEFaces release 1.5.1 and 1.5.2 both are working very well. Just wondering what version of icefaces you are using?

I am also attaching a war file of your example. Try to deploy it in your environment to see if it works for you as well?

Thanks,
-- Adnan Durrani --

 Filename datatable.war [Disk] Download
 Description datatable testcase
 Filesize 4316 Kbytes
 Downloaded:  117 time(s)

[Email]
satyajitchainy

Joined: 29/12/2006 00:00:00
Messages: 7
Offline


Hi,
Thanks for attaching the war.I have tried it in my environment,it is working perfectly.
Don't know why it is not working when I am tring to build my war.I have included ice 1.5.2 jars.My environment is Tomcat 5.5.20,jdk version 1.5.Would it be possible for you to deploy it.Possibly I am missing something.But not able to figure out the mismatch.

Thanks again,
Satyajit
 Filename dttest.war [Disk] Download
 Description
 Filesize 4402 Kbytes
 Downloaded:  109 time(s)

adnan.durrani


Joined: 19/01/2006 00:00:00
Messages: 436
Offline


Hi Satyajit,

I have tested the war provided by you and I got the same exception as you got. I found the root cause as well, which is:

Code:
        <context-param>
             <param-name>com.icesoft.faces.concurrentDOMViews</param-name>
             <param-value>true</param-value>
     </context-param>


Setting the concurrentDOMViews to false in the web.xml eliminates this problem. I am adding this issue as a bug.

Thanks,
-- Adnan Durrani --
[Email]
philip.breau


Joined: 08/05/2006 00:00:00
Messages: 2628
Offline


Hi,

short story: when using concurrentDOMViews and binding your components to a backing bean, you have to put the backing bean in request-scope.

long-story: The root cause of this issue is that concurrentDOMViews is not compatible with session-scoped bound components. You can keep concurrentDOMViews if you set your beans to request-scope. When the component is bound, there is a single instance of that component set on the bean. If the bean is in session scope, then the component is not created again the next time it is used in the same session. If the component is used in a different view of the same page, as with using concurrentDOMViews, there will be two different JSF component trees with the same instance of the bound component. That's when the 'duplicate id' error arises.

Thanks,
Philip

.
satyajitchainy

Joined: 29/12/2006 00:00:00
Messages: 7
Offline


Hi,
Thanks for your explanation.It helped me a lot.
Thanks,
Satyajit
rob_gar_esp

Joined: 30/09/2008 00:00:00
Messages: 8
Offline


Hi,


I'm seeing this error happening again with ICEfaces 1.7.2 and JSF 1.1 running on OC4J.

I have tried all tips mentioned in this thread an others, like setting my bean to request scope instead session but it's not working.

I must mention that I have many session beans running in my application and this problem occurs with pages that don't capture information from the user such as an ice:inputText, it happens only with pages that only have command links and buttons.

So, if you have an alternative to this issue please let me know.

Thanks in advanced.

Willi

Joined: 19/07/2008 00:00:00
Messages: 42
Offline


I'm also very interested in a solution
rob_gar_esp

Joined: 30/09/2008 00:00:00
Messages: 8
Offline


The problem was solved by adding "id" attributes to all tags in the jspx files, for some reason the tags with no ids are duplicated creating the conflicts.

Good luck!
Willi

Joined: 19/07/2008 00:00:00
Messages: 42
Offline


That was a great hint! Thank's a lot!
rickpoole

Joined: 09/04/2009 00:00:00
Messages: 8
Offline


I just ran into this issue. I have way too many tags to put IDs on all of them. How quick can we get a fix so we don't have to put IDs on all tags?
Larry77

Joined: 12/05/2009 00:00:00
Messages: 9
Offline


putting the ids to all tags on page doesn't solve this problem for me
all beans has request scope
com.icesoft.faces.concurrentDOMViews = true


my environment is icefaces 1.8 with Liferay 5.2 on glassfish 2.1
Larry77

Joined: 12/05/2009 00:00:00
Messages: 9
Offline


The problem occurs in this case:
there is two pages.
first page contains <ice:dataTable binding="..."
second page with only one <ice:commandButton action="toFirstPage"

any refresh of first page does not throws this exception.
When click on commandButton of second page (to return to the first page) then this exception occurs
cdeepak

Joined: 28/11/2008 00:00:00
Messages: 30
Offline


I think you are using Icefaces request scope, so that the components persists even after the navigation. Use one of the following solution

  • Add <redirect /> to the <navigation-case> inside <navigation-rule> in Faces-Config.xml
  • Change to normal standard request scope by adding or modifying the following lines in Web.xml
    <context-param>
    <param-name>com.icesoft.faces.standardRequestScope</param-name>
    <param-value>true</param-value>
    </context-param>

    Hope this will help you.

  • Regards,

    Deepak C
    Web Developer,
    Eway India Pvt Ltd
    Larry77

    Joined: 12/05/2009 00:00:00
    Messages: 9
    Offline


    yes, last solution has helped me
    thx a lot!
     
    Forum Index -> Components Go to Page: 1, 2 Next 
    Go to:   
    Powered by JForum 2.1.7ice © JForum Team