binding data

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
Report Content as Inappropriate

binding data

This post has NOT been accepted by the mailing list yet.
I subscribe but it seems as if it tells me I am not. However, I am logged into the user forum ?

My question:

I wish to attach userData to my custom component.  I attach it to my object by putting it into the UserData dictionary.
Now  I wish to get it.  however I wish to have my constructor parse some of it for display so that the skin comes up with it.  So it isn't a simple setThis.  I am not sure the best way to do this. Can someone suggest?

I have so far :

MyComponent myComponent = new MyComponent();
mycomponent.getUserData.put("file", file);

now in my constructor :

MyComponent() {
file = (File)this.getUserData().get("file");
parseData();  ??????

File file;

but this bad form since the constructor is building the class as I would be called a method of the class.
So If I remove parseData from the constructor and make it a public method I can call :


However I am unsure how to get my parsed data entries into the user directory without explicitly putting them in. i would like acccess the same way that the styles dictionary works, ie. the setThis(), setThat() methodology where This and That are then styles in the Styles dictionary.  Does UserData dictionary have an equivalent.