[jboss-user] [JBoss jBPM] - Re: Web console failing

brado do-not-reply at jboss.com
Wed Jul 12 19:06:52 EDT 2006


It turns out this is a bug in JSF. I'll give the solution in just a moment, but first, my proposed solution above to getting the left navigation links to work on the default page before logging in actually causes other problems once you do log in. So there is a bug here, but the bug is either that the login screen should not have "Home", "Administration", and "Monitoring" links, OR a separate block of code should address the not-logged-in vs. logged-in situations. I suppose this could be done with a conditional block or adding a header3.jsp, and header2.jsp could be used prior to login, and header3.jsp could be used after login. 

Now to the problem: 


  | java.lang.IllegalStateException: Client-id : _id1 is duplicated in the faces tree.
  | 

Apparently this is a JSF bug, and it is caused by a problem in auto-assigning of component ID's to web components where ID's have not been specified (i.e., when created programmatically). The error is occurring in home.jsp, specifically in the block of code which creates the "Start new process execution" data table. The solution is to drop both data tables in home.jsp into subviews that have explicit ID's assigned to them. Here then is the entire code of home.jsp (with changes) that eliminate the _id1 duplication problem: 


  | <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
  | <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
  | 
  | <f:view>
  | 
  | <jsp:include page="header1.jsp" />
  | Home
  | <jsp:include page="header2.jsp" />
  | 
  | <b><h:messages /></b>
  | 
  | <h4>Tasklist</h4>
  | <f:subview id="taskInstanceTable">
  | <h:dataTable value="#{homeBean.taskInstances}" var="taskInstance" headerClass="tableheader" columnClasses="tablecell">
  |   <h:column >
  |     <f:facet name="header">
  |       <h:outputText value="Task Form Link" />
  |     </f:facet>
  |     <h:commandLink action="#{homeBean.selectTaskInstance}">
  |       <f:param name="taskInstanceId" value="#{taskInstance.id}"/>
  |       <h:outputText value="#{taskInstance.name}" />
  |     </h:commandLink>
  |   </h:column>
  |   <h:column>
  |     <f:facet name="header">
  |       <h:outputText value="Process" />
  |     </f:facet>
  |     <h:outputText value="#{taskInstance.taskMgmtInstance.taskMgmtDefinition.processDefinition.name}" />
  |   </h:column>
  |   <h:column>
  |     <f:facet name="header">
  |       <h:outputText value="Version" />
  |     </f:facet>
  |     <h:outputText value="#{taskInstance.taskMgmtInstance.taskMgmtDefinition.processDefinition.version}" />
  |   </h:column>
  | </h:dataTable> 
  | </f:subview>
  | 
  | <h4>Start New Process Execution</h4>
  | <f:subview id="processInstanceTable">
  | <h:dataTable value="#{homeBean.latestProcessDefinitions}" var="processDefinition" headerClass="tableheader" columnClasses="tablecell">
  |   <h:column>
  |     <f:facet name="header">
  |       <h:outputText value="Start Process Link" />
  |     </f:facet>
  |     <h:commandLink action="#{homeBean.startProcessInstance}">
  |       <f:param name="processDefinitionId" value="#{processDefinition.id}"/>
  |       <h:outputText value="#{processDefinition.taskMgmtDefinition.startTask.name}" />
  |     </h:commandLink>
  |   </h:column>
  |   <h:column>
  |     <f:facet name="header">
  |       <h:outputText value="Process" />
  |     </f:facet>
  |     <h:outputText value="#{processDefinition.name}" />
  |   </h:column>
  |   <h:column>
  |     <f:facet name="header">
  |       <h:outputText value="Version" />
  |     </f:facet>
  |     
  |     <h:outputText value="#{processDefinition.version}" />
  |   </h:column>
  | </h:dataTable> 
  | </f:subview>
  | 
  | <jsp:include page="footer.jsp" />
  | </f:view>
  | 

If similar duplicate ID problems are happening elsewhere, I'd try the same approach, of wrapping data tables in subviews and explicitly assigning id values to them. 

Cheers,

Brad

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3957569#3957569

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3957569



More information about the jboss-user mailing list