on 08-06-2008 5:37 PM
Hi,
I have drop down for which i have to assign values dynamically, I am getting values as a form of Array list.
Refer this code to populate data in drop down by index at runtime
String color[] = {"Red", "Green","Blue" };
IPrivatePrototypeView.IPaintElement elt ;
for(int i=0; i<color.length; i++){
elt = wdContext.createPaintElement();
elt.setColor(color<i>);
wdContext.nodePaint().addElement(elt);
}
Mandeep Virk
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
do you want to use drop down by key or drop down by index?
If drop down by key, use above code by siva.
If you want to use drop down by index, populate the value attribute with you array list data.
bind the drop down by index's "texts" property to this value attibute.
PradeeP
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can go for dropdownbyindex ui element too and copy your values in the arraylist to the context node binded to the texts property of the dropdownbyindex.
Regards,
Murtuza
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Venki,
Say your ArrayList is al . Create a value attribute under the root node. Say test. Bind this test to the DropdownByKey UI element. You can populate test attribute like this.
IWDAttributeInfo attributeInfo =
wdContext.getNodeInfo().getAttribute(IPrivate<viewname>View.IContextElement.TEST);
ISimpleTypeModifiable valuesType =
attributeInfo.getModifiableSimpleType();
IModifiableSimpleValueSet VS=
valuesType.getSVServices().getModifiableSimpleValueSet();
for (int i = 0; i < al.size(); i++) {
VS.put(al.get(i),""+al.get(i));
}
Regards
Siva
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.