Bug 535213 (RHQ-1933) - UI error "Duplicate Id for a component ..."
Summary: UI error "Duplicate Id for a component ..."
Keywords:
Status: CLOSED NEXTRELEASE
Alias: RHQ-1933
Product: RHQ Project
Classification: Other
Component: Core UI
Version: 1.2
Hardware: All
OS: All
high
medium
Target Milestone: ---
: ---
Assignee: Lukas Krejci
QA Contact: Jeff Weiss
URL: http://jira.rhq-project.org/browse/RH...
Whiteboard:
Depends On:
Blocks: RHQ-169
TreeView+ depends on / blocked
 
Reported: 2009-04-06 12:38 UTC by Heiko W. Rupp
Modified: 2014-11-09 22:49 UTC (History)
1 user (show)

Fixed In Version: 1.2
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)
Bild 1.png (114.08 KB, image/png)
2009-04-06 12:38 UTC, Heiko W. Rupp
no flags Details

Description Heiko W. Rupp 2009-04-06 12:38:00 UTC
This mostly happens when creating data sources, but this is not specific to the JBossAS plugin but a framework issue.

How to repeat:
- go to a JBossAS (e.g. RHQ server) , inventory tab
- click on "Create new datasource", then OK
- select e.g. oracle xa
- then either 
  * click back until you are back at the inventory tab 
 or
  * create the full datasource and get back to the inventory tab
- retry the same again

This results in a red box saying "duplicate Id for a component selectTemplateForm:j_id320"

I've added a screenshot of the component tree part where this happens. The code is in 
rhq/resource/inventory/createConfig-1.xhtml

         <h:form id="selectTemplateForm">

            <input type="hidden" name="id" value="#{ResourceUIBean.id}"/>
            <input type="hidden" name="type" value="#{CreateNewConfigurationChildResourceUIBean.resourceType.id}"/>
            <!--<h:inputHidden value="#{CreateNewChildResourceUIBean.resourceType}" converter="ResourceTypeConverter" binding="#{CreateNewChildResourceUIBean.resourceTypeInput}"/>-->

            <h:selectOneMenu value="#{CreateNewConfigurationChildResourceUIBean.selectedTemplateName}" binding="#{CreateNewConfigurationChildResourceUIBean.selectedTemplateNameInput}">
               <f:selectItems value="#{CreateNewConfigurationChildResourceUIBean.templateNames}"/>
            </h:selectOneMenu>

            <h:panelGrid id="buttonGrid" columns="2" styleClass="buttons-table" columnClasses="button-cell">
               <h:commandButton value="CONTINUE" action="#{CreateNewConfigurationChildResourceUIBean.selectTemplate}"
                                alt="Continue to Next Step" styleClass="buttonmed" id="continueButton">
                  <s:defaultAction />
               </h:commandButton>
               <h:commandButton value="CANCEL" action="#{CreateNewConfigurationChildResourceUIBean.cancel}"
                                alt="Cancel" styleClass="buttonmed" id="cancelButton"/>
            </h:panelGrid>

         </h:form>

Comment 1 Heiko W. Rupp 2009-04-06 12:48:15 UTC
This is the generated HTML on the first (successful) : 

<form id="selectTemplateForm" name="selectTemplateForm" method="post" action="/rhq/resource/inventory/create-config-1.xhtml" enctype="application/x-www-form-urlencoded">
<input type="hidden" name="selectTemplateForm" value="selectTemplateForm" />


            <input type="hidden" name="id" value="501555" />
            <input type="hidden" name="type" value="500599" />

            <!--<h:inputHidden value="" converter="ResourceTypeConverter" binding=""/>--><select name="selectTemplateForm:j_id319" size="1">	<option value="Oracle Local TX">Oracle Local TX - Local Transaction Template for Oracle</option>
	<option value="Oracle XA">Oracle XA - XA Transaction Template for Oracle</option>
	<option value="default" selected="selected">default - the default template</option>
</select><table id="selectTemplateForm:buttonGrid" class="buttons-table">
<tbody>
<tr>
<td class="button-cell"><input id="selectTemplateForm:continueButton" type="submit" name="selectTemplateForm:continueButton" value="CONTINUE" alt="Continue to Next Step" class="buttonmed" /><script language="JavaScript" type="text/javascript">document.forms['selectTemplateForm'].onkeypress = new Function("event", "{var keycode;if (window.event) keycode = window.event.keyCode;else if (event) keycode = event.which;else return true;if (keycode == 13) { document.getElementById('selectTemplateForm:continueButton').click();return false; } else return true; }");</script></td>
<td><input id="selectTemplateForm:cancelButton" type="submit" name="selectTemplateForm:cancelButton" value="CANCEL" alt="Cancel" class="buttonmed" /></td>
</tr>

</tbody>
</table>
<input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="j_id4" />
</form>


Comment 2 Heiko W. Rupp 2009-04-07 14:00:06 UTC
A possible solution is described here:
http://forums.sun.com/thread.jspa?threadID=524925&start=15

Comment 3 Joseph Marques 2009-04-09 13:11:04 UTC
rev3661 - workaround to eliminate session-caching oddities around "Create New" functionality that hangs off the inventory>overview sub-tab for a resource; 
this is another instance of RHQ-1841, which was solved in rev3516; 

Comment 4 Pavel Kralik 2009-04-10 15:18:24 UTC
Verified with RHQ JBoss AS server.

RHEL5.3, x86_64, PostgreSQL8.2.4, java 1.6.0_13, JON RHQ SVN rev# 3663 

Comment 5 Joseph Marques 2009-04-16 17:48:53 UTC
re-opening because the work in RHQ-1957 has risk of regressing this, and i want reconfirmation that this still works.

Comment 6 Heiko W. Rupp 2009-04-17 12:04:36 UTC
Lukas is eager to fix this :)

Comment 7 Lukas Krejci 2009-04-17 12:08:01 UTC
The fix for RHQ-1957 needed to reimplement the fix for this issue. Please retest.

Comment 8 Pavel Kralik 2009-04-20 15:11:36 UTC
Tested in FF3. Both test cases gave me: An Error Occurred: duplicate Id for a component selectTemplateForm:j_id354

Comment 9 Joseph Marques 2009-04-21 06:20:29 UTC
I tested this in FF3 and IE6 against HEAD and things seem to be working as expected.  Pavel, please retest with the latest QA build and let me know if this still fails.

Comment 10 Jeff Weiss 2009-04-22 17:47:42 UTC
Fixed, rev3819

Comment 11 Red Hat Bugzilla 2009-11-10 20:49:47 UTC
This bug was previously known as http://jira.rhq-project.org/browse/RHQ-1933
Imported an attachment (id=368701)
This bug duplicates RHQ-1590
This bug duplicates RHQ-1709
This bug relates to RHQ-1957



Note You need to log in before you can comment on or make changes to this bug.