cancel
Showing results for 
Search instead for 
Did you mean: 

How to use UIGenericPicker ?

tico
Champ in-the-making
Champ in-the-making
Hello you all,

I'd like to update a property from an aspect with external data. The idea is to use the UIGenericPicker to select the data in a filtered list.

I have created the aspect, and that worked fine,

I have created a generator class, extending BaseComponentGenerator. What I would like to do is, in edit-mode, display an UIOutputText, which is updated by the data selected in a UIGenericPicker.

I know how to display the UIOutputText, or the UIGenericPicker (with the external data), but not the both together, and neither how to update the UIOutputText data with the data selected in the UIGenericPicker.

I have investigated the Component Generator Framework and Component Library wiki pages, but didnt find any response…

Any help and code sample is very welcome.

Thanks and regards,

Eric.
4 REPLIES 4

dhalupa
Champ on-the-rise
Champ on-the-rise
I did not quite understand the requirements you have but it seems to me that you will have to write a custom component which will than be generated by component generator. The best possible examples of different components can be found within the source code of Web Client project

Kind regards,

Denis

tico
Champ in-the-making
Champ in-the-making
Thanks Denis,

This is exactly the  point. I have created a component generator. In view mode, I have created an UIOutputText component. But for edit mode, I need to select the data from a set of data.

Thus I believe I need to use a UIGenericPicker. What I think is to create an UIOutputText to display the data, and an UIGenericPicker to select the correct value in the list.

I have two issues here:
1/ I have no idea how to make the both component displayed
Either the UIOutputText (which is not updatable by the user), or the GenericPicker (which I was not able to figure out how to update the value) is displayed, not both.

2/ I have no idea how to update the UIOutputText when the user click on the [Add] button from the UIGenerickPicker.
I believe I need to call the UIGenericPicker.addActionListener(Arg0), but I have no idea how to retreive the ActionListener awaited by the method.

Thanks and regards.

Eric.

dhalupa
Champ on-the-rise
Champ on-the-rise
Well, component generator will allways return the same component. The difference is that, when property is in readonly mode the "disabled" attribute of the component returned will be set to true. Now you can play and render different user interface depending on the value of that attribute. For other questions I would suggest that you try to google for "JSF custom components", go through few articles, and try to understand the basics of JSF component creation. After that, take a look at the source code for examples.

Sorry for not being more helpfull but you have to do the homework first Smiley Happy

Denis

tico
Champ in-the-making
Champ in-the-making
Thank you Denis, here is a good starter !!

Nevertheless, I'll follow your advices, it will just take a bit longer to find the glue.

Thanks & regards,

Eric.