on 09-07-2007 1:18 PM
Hi all,
I have a table in java web dynpro with buttons in all cells (TableCellEditor -> Button). All buttons refer to the same action and eventhandler. Within this eventhandler I need to determine which cell was selected. I only got the parameter com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent in the event handler method, but I don't know if this is sufficient for what I want.
All help is welcome.
Thanks,
Richard
Richard,
for each button in the table do the following
1) Add following parameters to Action associated with button (in addition to wdEvent)
param1 : type String
element: type (Node Element of the table node)
(Now you have 3 parameters in onAction event for buttons)
2)
Add the following code in wdDoModifyView
if(firstTime)
{
IWDButton mybutton1 = (IWDButton)view.getElement("btn1");
//parameter to know the column of the cell
mybutton1.mappingOfOnAction().addParameter("param1", "column1");
//add an element to know the row number of the cell
mybutton1.mappingOfOnAction().addSourceMapping("nodeElement", "element");
}
3) Now access the parameters added in the onAction event of the button
wdComponentAPI.getMessageManager().reportSuccess("Button clicked in column: " + param1 + " Row: " + element.index());
Thanks
Deepak
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Deepak ,
Problem is solved, rewarded points.
regards,
Richard
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Richard,
wdContext.nodeXX().getleadSelection();
will give you selected coloumn number.
Regards,
Naga
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.