on 03-02-2009 1:44 PM
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
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.