You are right about the serializer. Yes I looked at that as well when I thought about sticking a name into the component. But I think the name has many uses so a setter, getter will make this easier today and as pivot matures.
-----Original Message----- From: Greg Brown (JIRA) [mailto:j...@apache.org] Sent: Tuesday, June 08, 2010 5:42 PM To: dev@pivot.apache.org Subject: [jira] Commented: (PIVOT-520) add a name property to Component [ https://issues.apache.org/jira/browse/PIVOT-520?page=com.atlassian.jira.plug in.system.issuetabpanels:comment-tabpanel&focusedCommentId=12876817#action_1 2876817 ] Greg Brown commented on PIVOT-520: ---------------------------------- No changes should be necessary to the serializer. All you would need to do is add the name getter and setter to Component and the getNamedComponent() method to Container. However, there is another potential solution to your use case that does not rely on this change - you could use the user data dictionary of your container: <BoxPane wtkx:id="myBoxPane"> <Label wtkx:id="myLabel"/> <PushButton wtkx:id="myButton"/> <userData myLabel="$myLabel" myButton="$myButton"/> </BoxPane> In your code, you can call myBoxPane.getUserData().get() to retrieve the named objects. > add a name property to Component > -------------------------------- > > Key: PIVOT-520 > URL: https://issues.apache.org/jira/browse/PIVOT-520 > Project: Pivot > Issue Type: Improvement > Components: wtk > Reporter: Appddevvv > Priority: Minor > Fix For: 1.6 > > > Add a name property to Component > a) A getter/setter > b) A method to Container for Component getNamedComponent(String componentName) > The name should default to an the wtkx:id if one is specified for that component or if the name is not specified, null. If a name is specified and no wtkx:id is specified , it should become the wtkx:id of that component. The name must be a valid java identifier, otherwise an serialization exception should be thrown. The name used in the component should be left and right whitespace trimmed. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.