cancel
Showing results for 
Search instead for 
Did you mean: 

How to change table LeadSelection through embedded Button

Former Member
0 Kudos

Hi everyone,

I'm currently facing an unusual problem. I'm developing a simple web dynpro java application, which targets mobile devices.

The application consists one view with a table, displaying data and a button for each row.Clicking the button fires a plug to the details view, where the details for the row, where the button was located should be displayed.

Since the requirements for this application demand this button, i am unable to use the normal way, where I just make the table rows selectable and then proper node mapping handles the rest.

So now the question is, how I can get the rowIndex of the row where the button is triggered, to set the lead selection accordingly.

I hope somebody has a solution for this.

Kind Regards,

Carl Heckmann

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

That sounds like a solution to my problem but I still have some problems to realize it.

My Context structure which is bound to the table is:

Et_Worklist_Filtered

+Statustext

+Wd_Id

+Wd_Text

+Wd_Type

No I included the following code into the wdDoModifyView() method:

if (firstTime) {			
   IWDButton theButton = (IWDButton) view.getElement("WFButton");			
   theButton.mappingOfOnAction().addSourceMapping("Et_Worklist_Filtered", "nodeElement");
}

and the following code to my eventhandler

IEt_Worklist_FilteredElement el = (IEt_Worklist_FilteredElement) wdEvent.getObject("nodeElement");
wdContext.nodeEt_Worklist_Filtered().setLeadSelection(el.index());

But when i click the button I get a NullPointerException.

Do you have any Idea?

former_member201361
Active Contributor
0 Kudos

Hi Carl,

Have a look to this link :

[]

Thanks and Regards'

Former Member
0 Kudos

Instead of


theButton.mappingOfOnAction().addSourceMapping("Et_Worklist_Filtered", "nodeElement");

use


theButton.mappingOfOnAction().addSourceMapping("nodeElement", "Et_Worklist_Filtered");
//or better, if available in your release:
theButton.mappingOfOnAction().addSourceMapping(IWDButton.IWDOnAction.NODE_ELEMENT, "Et_Worklist_Filtered");

(or better use the Parameter Mapping Editor inside the View Designer).

Add a parameter named "Et_Worklist_Filtered" of type "IEt_Worklist_FilteredElement" to the action (and its handler) and implement it as


wdContext.nodeEt_Worklist_Filtered().setLeadSelection(Et_Worklist_Filtered.index());

(you already did that correctly)

Armin

Answers (3)

Answers (3)

sanyev
Active Participant
0 Kudos

Hi Carl,

1. Create a parameter of type IWDNodeElement for your action.

2. Navigate to the view and select the button from the layout.

3. Right click and select parameter mapping.

4. map the nodeElement under the onAction of the button to the newly created parameter for you action.

Once this is done at runtime when you click on the button the action handler will receive the parameter of type IWDNodeElement.

Regards,

Sanyev

former_member185086
Active Contributor
0 Kudos

Hi Carl

Simplest Solution is

1. Create one action with parameter of type Table node i.e if your table node name is TableData so the parameter type is ITableData of Iprivate<view name>.

3. Parameter mapping of this action to nodeElemtnt .

2. Associate this action to that button by which u want to navigate and write the following line of complete action

public void onActionTest(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, com.incture.rssfeedcomp.wdp.IPrivateRssFeedCompView.IChildUrlNodeElement index )

{

//@@begin onActionTest(ServerEvent)

wdContext.nodeChildUrlNode().setLeadSelection(index.index());

//@@end

}

Note : Set RowSelectable property of table false

Thats it

Best Regards

Satish Kumar

Edited by: satish jhariya on Mar 3, 2009 10:07 AM

former_member201361
Active Contributor
0 Kudos

Hi Carl,

Solution for ur query is Action Paramter Mapping.

search in this forum for parameter mapping , u will find lot of links and solution.

Thanks and Regards