cancel
Showing results for 
Search instead for 
Did you mean: 

wdEvent.getString()

Former Member
0 Kudos

Hi

I am trying to get the column id by using

wdEvent.getString(<NameOfColumn>);

But I always get null.

Any idea why?

thank you for your help and regards

yuval

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

1. Edit your action and add a new parameter of type int and call it "fromcolum". Check that your event handler is also updated with this new parameter.

2. Add this code to the "wdDoModifyView()":

if (firstTime){

IWDTableColumn column = (IWDTableColumn )view.getElement("<id of the tablecolum UI element>");

column.mappingOfOnAction().addParameter("fromcolum",1);

}

3. In your event handler simply access this parameter to find out which column was clicked.

Thanks

Abhilasha

Edited by: Abhilasha Dahare on May 6, 2009 10:57 AM

Former Member
0 Kudos

Abhilasha

I did exactly as you suggest. Thanks

column.mappingOfOnAction().addParameter("type","type"); //random name

but when i try to run the code

String type = wdEvent.getString("type");

I still get null!

Thank you

regards

yuval

Former Member
0 Kudos

If you are working in NW 7.0, you should map the predefined event parameter "col" to an action parameter of type "string". See

http://help.sap.com/javadocs/NW04S/current/wd/com/sap/tc/webdynpro/clientserver/uielib/standard/api/...

In NW >= 7.1 you shouldn't use the "onAction" event anymore.

Armin

Former Member
0 Kudos

Hallo Armin

As you mention elsewhere on the forum javadoc does not specify what "name-of-action-parameter" // (type String) " mean.

Just to recapitualte:

On the one hand I have a col name "Type". Its onAction is bound to onActionSort.

On the other hand I have the wdDoModify whee i have the foll code:

if(firstTime)

{

IWDAbstractTableColumn col = (IWDAbstractTableColumn ) view.getElement("Type");

col.mappingofAction.addSourceMapping(IWDAbstractTableColumn.IWDOnAction.COL,

"wdEvent");

IWDTable table = (IWDTable) view.getElement("MyTable");

wdContext.currentContextElement.setTableSorter(new TableSorter(table, wdThis.wdGetSortAction,

null));

}

In addition of course I have onActionsort:

public void onActionSort(wdevent)

{

wdContext.currentContextElemet().getTableSorter().sort("Type", wdContext.myNode(), false);

wdContext.nodemyNode().moveFirst();

}

I put a berakpoint at TableSorter.sort() and interestingly enough the method returns after

ReversibleComperator reversible = (ReversibleComparator) comperatorForColumn.get(column);

because reversible gets null. Any idea??

Thank you!!

regards

Yuval

Former Member
0 Kudos

As I said, add an action parameter "columnId" (name is arbitrary, but not "wdEvent") of type "string" and map the predefined event parameter to it:


col.mappingOfOnAction().addSourceMapping(
  IWDAbstractTableColumn.IWDOnAction.COL,
  "columnId"
);

Armin

Former Member
0 Kudos

Hi Armin

Sorry for the late reply.

Apparently the problem, as always, was the version.

There are two versions of "TableSorter" one is for ECC6 and one for ECC7.

To implement my solution I have been referring to

Bertram Ganz' blog: 'WDTableSorter_NW04s.zipEnhanced Web Dynpro Java TableSorter for SAP '

which can be found here:

/people/bertram.ganz/blog/2006/03/07/enhanced-web-dynpro-java-tablesorter-for-sap-netweaver-04s

Former Member
0 Kudos

thank you all

yuval peery

gill367
Active Contributor
0 Kudos

Hi,

Can you elobrate your problem a bit more.

can you tell us which column id you are trying to access.

Sarbjeet Singh