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>
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>
A possible solution is described here: http://forums.sun.com/thread.jspa?threadID=524925&start=15
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;
Verified with RHQ JBoss AS server. RHEL5.3, x86_64, PostgreSQL8.2.4, java 1.6.0_13, JON RHQ SVN rev# 3663
re-opening because the work in RHQ-1957 has risk of regressing this, and i want reconfirmation that this still works.
Lukas is eager to fix this :)
The fix for RHQ-1957 needed to reimplement the fix for this issue. Please retest.
Tested in FF3. Both test cases gave me: An Error Occurred: duplicate Id for a component selectTemplateForm:j_id354
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.
Fixed, rev3819
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