on 04-17-2011 5:24 PM
Hi Experts,
I've an attribute of type(simple type) which is binded to a drop down by key UI element. The values in the drop down get populated from the enumerated values maintained in the Simple Type.
Now, I want to dynamically play with the values of the drop down based on certain actions. But I am not sure how to do that.
My requirement is that how can we remove the values and add them again in the dropdown based on certain actions as they are static values coming from the values maintained in the simple type.
Kindly suggest if it is possible to play with these values and share the code to achieve it.
Please note that the values are stored in the attribute when the component is instantiated.
Regards,
Anurag
Hi Anurag,
As per your requirement Using drop down by key is relevant and make sense, in real time we face the same scenario while some model attribute needs to be displayed in drop down. Here in such case you can't use the simple type and can not modify its type because its a model attribute. In such case as segmentation fault suggested we can use modifiable simple type. I am providing the sample code which we used in one of our project hope it helps.
IWDAttributeInfo custClassAttributeInfo = wdContext.node<Node Name>().getNodeInfo().getAttribute(
IPublic<Component Name>.I<Node Name>Element.<Attribute Name>);
ISimpleTypeModifiable custClassType = custClassAttributeInfo.getModifiableSimpleType();
IModifiableSimpleValueSet custClassValueSet = custClassType.getSVServices().getModifiableSimpleValueSet();
for (int i = 0; i < wdContext.nodeReturnCustomerClass().size(); i++) {
custClassValueSet.put(wdContext.nodeReturnCustomerClass().getReturnCustomerClassElementAt(i).getId(), wdContext.nodeReturnCustomerClass().getReturnCustomerClassElementAt(i).getName());
}
Regards
Jeetendra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Anurag,
The best way you should handle this is through Drop Down by Index which can be populated dynamically.
Regards,
HImanshu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi anurag
If it is possible as per your requirement u use drop down by index because in drop down by index u can control the values of drop down through coding.On certain action you can change the values of the drop down by index.
Make a node of 0-n cardinality add an attribute to it
Use that attribute to bind drop down by index.
For initialization write your code on wdinit to add initial values on drop down
and when you have to change values write in the any action where u want
Hope it works in your case.
Best regards
Suresh joshi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Search the forum for "getModifiableSimpleValueSet".
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.