cancel
Showing results for 
Search instead for 
Did you mean: 

How to search the content in a Table

Former Member
0 Kudos

Hi all,

How can i search the content in a table. is there any UI Element is there to do this? Can any body give me any sample code for this

regards,

VJR

Accepted Solutions (1)

Accepted Solutions (1)

abhijeet_mukkawar
Active Contributor
0 Kudos

Hi,

you gotta do that programmatically,

here is a sample code:

int sizeOfstudent = wdContext.nodeCtx_vn_student().size();
//Ctx_vn_student is the node associated with the table ie its dataSource property
String filtername = wdcontext.currentContextElement.getSName();
//sName is the name to be searched , it is a context attribute
		for(int i = sizeOfstudent-1;i>=0;i--)
		{
			String matchValue = recNode.getElementAt(i).getAttributeAsText("Name");
//get the name of 1st record(in table) or 1st elememnt in node, "Name" here is value attribute of that node
//so we are fetching its value and comparing it like..
			if(matchValue.equalsIgnoreCase(filtername))
			{
				//here you can add the action to be taken on mathing name 			}
		}

hope it helps

regards

Answers (1)

Answers (1)

former_member286976
Active Participant
0 Kudos

Hi,

If this is from the UI perspective, you could implement a filter for the table. See the blog link for details <a href="/people/peter.vignet/blog/2007/01/03/generic-web-dynpro-java-table-filter:///people/peter.vignet/blog/2007/01/03/generic-web-dynpro-java-table-filter

Regards,

Sudeep