cancel
Showing results for 
Search instead for 
Did you mean: 

Input field validation and populate text view other than OnEnter event

kshamatha_eda2
Explorer
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

bradp
Active Participant
0 Kudos

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

Former Member
0 Kudos

This is very good solution to identify some data has changed in the form.

Thanks.

Uma

Answers (2)

Answers (2)

former_member184578
Active Contributor
0 Kudos

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.

kshamatha_eda2
Explorer
0 Kudos

Thanks Guys i needed this confirmation before i moved on with other solutions.

Former Member
0 Kudos

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

kshamatha_eda2
Explorer
0 Kudos

I am not using tabstirps. Tab - Navigate from one input field to another field using tab key.

Former Member
0 Kudos

Oh ok actually Tab key is pre-configured you c'nt create any event for the same.

It can only be used to move from 1 field to other no event can be triggered for the same.

Thanks

Bhanu