on 07-03-2011 9:58 AM
Hello,
In my application I have a table which displays rows retrieved from an RFC.
When user selects a row in this table....A form is displayed with detail view of selected row on the same page.
Now, I have to write some logic to display some additional data on displayed form....
This logic needs to be executed whenever user selects a row in the table...
I wrote that code in wddomodify() function...
But the problem is this function is not getting executed whenever user selects a new row in table.....
For this I understand that I will have to use OnLeadSelect event in table....
Can anybody provide me with an example on how to achieve this task using onleadselect.
I have written below two lines of code in my event handler which I am calling on "onLeadSelect" event:
int leadSelected = wdContext.nodeT_Disp_Data().getLeadSelection();
wdContext.nodeT_Disp_Data().setLeadSelection(leadSelected);
Now Lead selection is changing...and strangely wddomodifyview() is also getting executed.....
But the question is when I am not using this function as an event handler then why and keeping "onleadselect" property as blank...then why wddomodifyview() is not getting executed....!
Edited by: Saurabh Agarwal on Jul 3, 2011 4:02 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes John...lead selection changes automatically...
My problem is that I need to call wdDoModifyView() method whenever user selects a row in table...
Because there is some code I have written in wdDoModifyView() which should be executed whenever user selects a row in table....
What is happening is :
When I call my custom method on "ONSelectLead" event of table....then control first goes to my custom method when user selects a row in table....and after that control is going to wdDoModifyView()....
But if I do not call my custom method on "ONSelectLead" event of table....then control does not goes to wdDoModifyView() method....
Hi Saurabh,
The wdDoModifyView() method can call on two ways.
1. when view is loading at first time.
2. if any event has been triggered in particular view.
In webdynpro first the triggered event will execute then only wdDoModifyView() method will execute.
For your Requirement, you no need to write the code in wdDoModifyView() method unless untill if there is any dynamic generation of UI elements or need to create any attributes under the node dynamically.
if you simply wants to display the data in form based on row selection then you can write your code directly in ONSelectLead custom event.
if you need any dynamic UI generation or creating attributes then create one boolean attribute and set that value false in
wdDoInit() method and set that boolean attribute value true when lead selection happen( in custom event for onLeadselection).
finally write your code in wdDoModifyView() method if the boolean attribute value is true.
Thanks & Regards,
Bhargava
Thanks Bhargava,
I have a concern in reference to current question only....
( "onLeadSelect" property left blank....)
If I do not define any custom event handler called on "onLeadSect" event of table.....in that case my wdDoModify() method is not getting executed.....Debugger is not stopping there in this method......
( "onLeadSelect" property contains custom event handler function call....)
If I define a custom event handler on "onLeadSelect" event of table....then only wdDoModify() method is getting executed...after my custom event handler....breakpoint is then only getting triggered.........
You can yourself try this strange behaviour.......
hi Saurabh,
This is not the strange behaviour of webdynpro java/ abap.
This is the existing behaviour of webdynpro java.
the wdDoModifyView() method only calls if any event(more specifically all are custom events only) in that view and at first time of view is rendering otherwise wdDoModifyView() method will not be called at any situation.
Thanks & Regards,
Bhargava.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.