cancel
Showing results for 
Search instead for 
Did you mean: 

Filter the Tabledata Entries

Former Member
0 Kudos

All,

I have a table, which has 100 entries, I want to filter the Rows programmatically. The prgram will set the filter value not from user.

How to do that?

Note: I dont want to show the Filter in the table and user will not have any control.

BM.

Message was edited by:

Bharathi M

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

HI Bharati,

If u want to do filtering from code, just implement the condition in the code at the time of adding elements

For example, if u want to add only the names which satrts with Bharati, then

IPrivate<view>.IMasterNode masterNode=wdContext.nodeMasterNode();

IPrivate<view>.ITableNode tableNode=wdContext.nodeTableNode();

IPrivate<view>.ITableElement tableElement;

for(int i=0;i<masterNode.size();i++)

{

String name=masterNode.getMasterElementAt(i).getName();

if(name.startsWith("Bharati")

{

tableElement=tablenode.createElement();

tableElement.setName(name);

tableNode.addElement(tableElement);

}

}

Regards,

Fahad Hamsa

Answers (2)

Answers (2)

former_member751941
Active Contributor
0 Kudos

Hi Bharathi,

Check this thread.

Regards,

Mithu

Former Member
0 Kudos

Hi Bharathi,

On what basis u r trying to filter the values??If user is not going to enter the value for filter,then which value u r goin to use for filtering??If u have already the value what u r goin to use for filtering,then u have to filter the node ,which u r using populate the table.

regards

Sumit

Former Member
0 Kudos

Based on some logic i need to filter it out. There is a field called Person ID, so based on the condition i need to show only specific Person ID..

BM

Former Member
0 Kudos

Hi Bharathi,

Just correct me if i m wrong in understanding ur problem.

U have a personID ,which u will be getting at runtime but user is not goin to enter that value.U have some records for the table in a node.Now u have to filter those records.

if this is ur problem,u can iterate the node ,get the values in a Collection & populate the values in the table or u can remove the elements from the node ,which are not associated to the personId.

regards

Sumit