Duplicate id problem 
---------------------

         Key: TOMAHAWK-454
         URL: http://issues.apache.org/jira/browse/TOMAHAWK-454
     Project: MyFaces Tomahawk
        Type: Bug

 Environment: Windows XP, Eclipse 3.1, MyEclipse, Tomcat 5.0.28
    Reporter: Sreedevi


I am using myfaces tomahawk and tiles to design an application.

In one page i have a panelgrid with a listbox that contains a list of items, 
and the selected item should be moved to the right list box on click of the 
move button. This happens without any error. I'm doing server-side validation 
to check if the right listbox is empty. if i don't select any item and submit 
the page, the error is displayed on the page. But if i subsequently try to add 
an item to the right side list box i get the foolowing error:

javax.faces.FacesException: ServletException in '/example/tilesLayout.jsp': 
ServletException in '/pm/PmProfileAdd.jsp': cannot add component with id 
'select' and path : {Component-Path : [Class: 
javax.faces.component.html.HtmlPanelGrid,Id: select]} to its parent component. 
This might be a problem due to duplicate ids.

How do I fix this problem?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ page language="java" contentType="text/html; charset=iso-8859-1" %>
<%@ taglib uri="http://java.sun.com/jsf/html"; prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core"; prefix="f" %>
<%@ taglib uri="http://myfaces.apache.org/tomahawk"; prefix="t" %>


        
<h:form>

                                
     <t:panelGrid title="shuttle"  id ="shuttledev" columns="3" cellspacing="2" 
cellpadding="5" border="2">
                                        
        <t:selectManyListbox id="devices" converter="#{deviceConverter}" 
value="# {MyBean.selectManyValues}">
                <f:selectItems value="#{MyBean.selectDevices}"/>
        </t:selectManyListbox>
             
                 <t:panelGrid  id ="select"  title="selButtons" columns="1">
                        <t:commandButton   value=" > "   rendered="true" 
actionListener="#{MyBean.moveSelectedToList}" 
                                   action="none" id="move"/>                 
         <t:commandButton   value="  <   "   rendered="true" 
actionListener="#{MyBean.moveSelectedToDevices}"  
                            action="none" id="moveBack"/>
                </t:panelGrid>
                                 
                  <t:selectManyListbox  id="selectedDevices" 
converter="#{deviceConverter}" value="#{MyBean.selectedValues}">
            <f:selectItems value="#{MyBean.selDevicesLst}"/>
        </t:selectManyListbox>
                     
       </t:panelGrid>
        
<t:commandButton value="Create" action="#{mybean.create}" / >   
        
</h:form>



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to