cancel
Showing results for 
Search instead for 
Did you mean: 

searching data from a node for table as an input parameter

ashish_shah
Contributor
0 Kudos

Hi experts ,

Consider the folowing scenario:

1) I have some data in a node , the node has one child node( Singleton false , cardinality 0..n) and that child node has one more child node ( Singleton false , cardinality 0..n) , lets call this "datanode'

2) there is an input table where user enters the search criteria , i have bound this to one context with similar structure , lets call this "searchinputnode".

3) Now depending on user's input i have to loop through the datanode and get the corresponding data into another node , lets call this "outputnode".

Now my question is , how do i loop on the datanode with the search fields of the searchnode and store the result in resultnode ?

An example code would be useful.

I am open for some different suggestions also.

Appriciate your help on this.

Regards,

Ashish Shah

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

HI,

To Loop over the node

for(int i=0; i<node<name of the name>().size())

{

}

here <name of the node> is the node on which you want to loop at.

<b>To add data to the node:</b>

IPrivate<viewname>.I<nodename>Element ele = wdContext.node<nodename>.create<nodename>Element();

ele.set<attributename>(<attrtibutevalue>);

wdContext.node<nodename>().addElement(ele);

This is how you can add elements to your output node.

<b>To get element from the node</b>

for(int i=0; i<node<name of the name>().size())

{

wdContext.node<nodename>().get<nodename>ElementAt(i).get<attributeName>();

}

Regards,

Murtuza

former_member185029
Active Contributor
0 Kudos

Hi,

Why dont you use table filters for searching on table?

Ashu

ashish_shah
Contributor
0 Kudos

Hi Ashutosh ,

Can you give me an example of the table filters?

For your information , i am using Was server 6.40 sp16 and NWDS 2.0.16

Regards,

Ashish Shah

former_member185029
Active Contributor
0 Kudos

Hi,

refer to <a href="/people/peter.vignet/blog/2007/01/03/generic-web-dynpro-java-table-filter">this</a> blog.

Ashu