on 02-20-2008 1:50 PM
Dear All!
I would like store some data in the view controller.
It is a value attribut and has the type java.util.List.
1. How can I add now many values into this attribut
2. How can I get this values again ?
Regards
sas
Hi,
use as follows
//Lets say liststore is you context attribute of type list
List list = wdContext.currentContextElement().getListStore();
list.add(<object>); // add your objects to the list
//store the list back to the context
wdContext.currentContextElement().setListStore(list);
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
but I have many Objects.
In this case I can populate list only with one object?
What happens of having more object (e.g. 200)
list.add(<object>); // add your objects to the list
regards
sas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sas,
The list is similar to any value node.
You can add elements like this.
for(int i=0;i<SIZE;i++)
{
IPrivate<viewname>.I<node>Element ele = wdContext.create<node>Element();
ele.set<attribute>(" "+i);
wdContext.node<node>().addElement(ele);
}
You can get elements like this:
for(int i=0;i<SIZE;i++)
{
IPrivate<viewname>.I<node>Element ele = wdContext.node<node>().get<node>().ElementAt(i);
ele.get<attribute>();
wdContext.node<node>().addElement(ele);
}
regards,
Siva
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 have a value Node ex. "MyList".Now add value attribute say "MyName" of type String under the value node.set the cardinality of the node MyList to 0:n.
Now you can add the elements by
IMyListElement ele=wdContext.nodeMyList().createMyListElement();
ele.setMyName="name";
wdContext.nodeMyList().addElement(ele);
Repeat the above lines to add more elements.
Regards,
Sudhir
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
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.