Skip to Content
author's profile photo Former Member
Former Member

Assign value search on Input field in Table

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Aug 22, 2011 at 09:05 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

  • author's profile photo Former Member
    Former Member
    Posted on Aug 22, 2011 at 11:14 AM
    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.