on 08-22-2011 9:18 AM
Hi,
I need to provide a value search for an input field in a table . I went through a few threads on the forum and wrote this piece of code:
IWDAttributeInfo attributeInfo =
wdContext.nodeVn_table().getNodeInfo().getAttribute("name");
ISimpleTypeModifiable valuex = attributeInfo.getModifiableSimpleType();
valuex.setFieldLabel("Value");
IModifiableSimpleValueSet valueSet =valuex.getSVServices().getModifiableSimpleValueSet();
valueSet.clear();
nodeSize = wdContext.nodeRt_Master_Projno().size();
int nodeSize = 5;
for (int i = 0; i < nodeSize; i++)
{
key= "age"+i;
value= "value"+i;
valueSet.put(key,value);
}
Vn_table is my node and name is the field for which I need to provide the value serach help.
When I run this code, nothing is populated in the table. Other columns have values which I have entered in the usual way but this particular column is blank.
The cardinality of the node is 1..N and this code is written in the Comp Controller with appropriate bindings done from the concerned view.
Is there anything else that needs to be done?
Using :
IWDAttributeInfo attributeInfo = wdContext.getNodeInfo().getAttribute(IPublicTestApp.IVn_tableElement.NAME);
gives a null pointer exception
NWDS Version: 7.02.06
Thanks ,
Himanshu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Himanshu,
Null pointer exception :
IWDAttributeInfo attributeInfo = wdContext.getNodeInfo().getAttribute(IPublicTestApp.IVn_tableElement.NAME);
Since you have kept the cardinality of the node as 1..N, it is expecting atleast one single element to be created.
Before creating an attributeInfo object keep this code
IPublicTestApp.IVn_tableElement tableEle = wdContext.createAndAddTestElement();
Or If you dont want to create an element change the cardinality of the node 0..n and give a try.
Hope this helps you.
Regards,
Saleem Mohammad.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Saleem,
The Vn_Table has already been populated before this method is called.
I get a null pointer exception with 0...N cardinality as well.
However with:
IWDAttributeInfo attributeInfo =
wdContext.nodeVn_table().getNodeInfo().getAttribute("name");
I, do not get a null pointer but the value help does not show up either.
Do you have any clue if I have missed something in my code.
Thanks ,
Himanshu
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.