cancel
Showing results for 
Search instead for 
Did you mean: 

Assign value search on Input field in Table

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

yogesh_galphade
Contributor
0 Kudos
Former Member
0 Kudos

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.

Former Member
0 Kudos

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