cancel
Showing results for 
Search instead for 
Did you mean: 

Getting the coulmn selected in table

Former Member
0 Kudos

Hi all,

Is there any way to know which column is selected when i click on particular record n the table. There is a parameter as column ID for the action mappingOfOnLeadSelect() method, but how to use it?

Regards,

Jaydeep

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

in wdDOModifyView

if(firstTime){
    IWDTable t = (IWDTable)view.getElement("Table1");
    t.mappingOfOnLeadSelect().addSourceMapping("col","col");
} 

And in the action mapped to lead select... create a parameter.. "col".

IN your code if you access this parameter it will contain the value of the selected column.

Regards

Bharathwaj

Answers (1)

Answers (1)

Former Member
0 Kudos

See the Javadoc for method mappingOfOnLeadSelect():

Returns the parameter mapping for event onLeadSelect.

To access UI element event parameters in the attached action handler, an event parameter mapping has to be defined.

Add code like the following inside the view controller method wdDoModifyView():

 if (firstTime)
 {
   IWDTable element = (IWDTable) view.getElement("<ID of Table>");
   element.mappingOfOnLeadSelect().addSourceMapping
   (
     "col", // name of UI element event parameter
     "<action handler parameter>" // an action handler parameter of type String
   ); 
   element.mappingOfOnLeadSelect().addSourceMapping
   (
     "row", // name of UI element event parameter
     "<action handler parameter>" // an action handler parameter of type int
   ); 
 }

Parameters of event onLeadSelect:

String col - The ID of the selected column.

int row - The zero based index of the selected row.

Returns:

the parameter mapping for event onLeadSelect

See Also:

getOnLeadSelect()

Armin

Former Member
0 Kudos

Hi Armin,

The problem that I am facing with this solution is the following:

1. select a column in the table -> you can find the column and row values.

2. select another column in the same row from before -> becuase the lead slection was not changes, the LeadSelect action is not catched and I can not figure out the column ID.

Any suggestions?

Thank,

Aviad

Former Member
0 Kudos

You could assign an action to some event of the cell editor in that column and use the implicit event parameter "nodeElement" to determine the row in the action handler.

However, this does only work when you click on the editor, there is no event like "TableCellSelected".

Armin