You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xap-dev@incubator.apache.org by "Trevor Oldak (JIRA)" <xa...@incubator.apache.org> on 2007/01/18 20:55:30 UTC
[jira] Created: (XAP-270) Xmodify: Elements in xModify can't have
same ID as elements in UI document
Xmodify: Elements in xModify can't have same ID as elements in UI document
--------------------------------------------------------------------------
Key: XAP-270
URL: https://issues.apache.org/jira/browse/XAP-270
Project: XAP
Issue Type: Bug
Components: XModify
Reporter: Trevor Oldak
If an element in a document is being replaced, the ID for the original object cannot be preserved. The macro below would throw an error because the button replacing testComponent has the same id. We cannot set the id of an element after it has been created. Therefore, there is no way to 'reset' an element through a macro, without removing every possible attribute.
<macro:macro id="resetButton" xmlns:macro="http://openxal.org/core/macro">
<xm:modifications xmlns:xm="http://openxal.org/core/xmodify">
<xm:replace select="id('testComponent')">
<button id="testComponent" text="foo"/>
</xm:replace>
</xm:modifications>
</macro:macro>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (XAP-270) Xmodify: Elements in xModify can't have
same ID as elements in UI document
Posted by "Michael Mikhaylov (JIRA)" <xa...@incubator.apache.org>.
[ https://issues.apache.org/jira/browse/XAP-270?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12495117 ]
Michael Mikhaylov commented on XAP-270:
---------------------------------------
I don't think it is possible to have duplicate ID in XAL document. But, in this case, there is an easy workaround:
<xal xmlns="http://openxal.org/ui" xmlns:macro="http://openxal.org/core/macro" xmlns:xm="http://openxal.org/core/xmodify">
<rootPane>
<verticalBoxPane>
<button id="testComponent" text="bar" onCommand="macro:resetButton.execute('testComponent')"/>
</verticalBoxPane>
</rootPane>
<macro:macro id="resetButton">
<xm:modifications>
<xm:replace select="id('{0}')">
<button id="{0}" text="foo"/>
</xm:replace>
</xm:modifications>
</macro:macro>
</xal>
> Xmodify: Elements in xModify can't have same ID as elements in UI document
> --------------------------------------------------------------------------
>
> Key: XAP-270
> URL: https://issues.apache.org/jira/browse/XAP-270
> Project: XAP
> Issue Type: Bug
> Components: XModify
> Reporter: Trevor Oldak
>
> If an element in a document is being replaced, the ID for the original object cannot be preserved. The macro below would throw an error because the button replacing testComponent has the same id. We cannot set the id of an element after it has been created. Therefore, there is no way to 'reset' an element through a macro, without removing every possible attribute.
> <macro:macro id="resetButton" xmlns:macro="http://openxal.org/core/macro">
> <xm:modifications xmlns:xm="http://openxal.org/core/xmodify">
> <xm:replace select="id('testComponent')">
> <button id="testComponent" text="foo"/>
> </xm:replace>
> </xm:modifications>
> </macro:macro>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.