on 04-18-2012 2:11 PM
Hi,
I have input field which when populated i would like to auto-populate a text view next to it. Right now i have the code to populate text view onEnter event of the input field. Wondering if there is any other way i can auto populate textview. Eg. When user uses tab to move to next field can we auto populate.
thanks
Kshamatha
Hi,
There is no event for change of focus as stated above. But a little workaround that I have used in the past to monitor changes to fields and perform actions accordingly is by using the Context Change Log to monitor for changes to fields in the Context.
get the context reference from wd_context->get_context( ).
call the ENABLE_CONTEXT_CHANGE_LOG method to enable context change logging.
Then in the WDDOMODIFYVIEW for each view, call a custom method that you create, either in component controller or assistance class. You can call it CHECK_CHANGED_FIELDS or whatever you want.
In there, call the GET_CONTEXT_CHANGE_LOG method in the context reference (IF_WD_CONTEXT) which you got from wd_context->get_context( ).
Loop through the change list and perform whatever actions you would like to perform for the changed field you are monitoring.
The only down side of this, is it still requires an event to occur, it wont just trigger on pressing the tab key. However on the plus side, it doesnt require you having to press enter on a specific field. Since the WDDOMODIFYVIEW is triggered after any event occurs on the screen, it is hard to not have it triggered.
Your alternative is a dropdown and use the ON_SELECT event.
Hope thats useful.
Cheers,
Brad
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
It is not possible as we don't have events onBlur or onKeyUp in Web Dynpro like in javascript. we have to use the existing event i.e onEnter.
Or, instead of input field, you can take drop down, and in onSelect populate the text.
Regards,
Kiran.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can auto fill text view when you click on "Tab" to move to next tab.
If i understand correctly you are using tabstrips and you want to auto populate text view before you move to next tab.
1. Bind selectedTab property to context attribute.
2. Save currentTab in some variable
3. Now in onSelect action handler you have access to previously selected tab and the new tab (context attribute will reflect selection). Here you can check if i/p field is not empty then you can fill text view accordingly.
Thanks
Bhanu
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 | |
11 | |
10 | |
9 | |
9 | |
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.