cancel
Showing results for 
Search instead for 
Did you mean: 

how to retrieve selected row values in table

Former Member
0 Kudos

hi all,

I have table with context attributes name,id ,dateofcreation,stauts.

I have to retrieve the selected row in table I can able to delete particular selected row like this

int i = wdContext.nodeStatus().getLeadSelection();

wdContext.nodeStatus().removeElement(wdContext.nodeStatus().getElementAt(i));

But I have to retrive the values form the i th row of tablenode and set that values means getname(),getId(),getdateofcreation(),getstatus() to some javabean class to delete from db also.

please help

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You can remove the selected row as follows

wdContext.nodeStatus().removeElement(wdContext.currentStatusElement());

Regards, Anilkumar

Former Member
0 Kudos

Hi Anil,

I have the code like this

int i = wdContext.nodeStatus().getLeadSelection();

wdContext.nodeStatus().removeElement(wdContext.nodeStatus().getElementAt(i));

String application =wdContext.currentStatusElement().getApplication();

try{

mdao.deleteMobileApplication(application);

}catch(Exception e)

{e.printStackTrace();

}

In Status table application is the primarykey I can able to delete from the table and database also but it is not deleting selected row from db. how to get the selected row values like getApplication() from table so then I pass it to db.

please help

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

The value selected should be removed from the node and from the DB .Is it ?

If so ! The first part is done by the remove element you have mentioned.

Assuming you are using the id as the primary key ,

use a delete query to delete it .Pass this to a bean method and use this inside it !

Where is the problem ! Does it help ?

Regards

Bharathwaj

Former Member
0 Kudos

hi ,

like this below code If I select row in a table it is picking above the row of selected row but not the selected row value of getApplication().

String application =wdContext.currentStatusElement().getApplication();

if I write code

int i = wdContext.nodeStatus().getLeadSelection();

form above statement how i can i select the getApplication() vlaue.

please help.

Former Member
0 Kudos

Hi,

Whatever is selected will be the current element.

If the attribute application is inside a node specify

wdContext.nodeStatus().currentStatusElemetn().getApplication();

int i = wdContext.nodeStatus().getLeadSelection();

will give the number of the row which is selected

Generically

 you can use wdContext.nodeStatus().getStatusElementAt(i).getApplication();

Regards

Bharathwaj

Regards

Bharathwaj