cancel
Showing results for 
Search instead for 
Did you mean: 

Trapping text edit data change on loss of focus

mike_mcinerney
Participant
0 Kudos

(This is watered down from our application, but will serve for discussion.)

Picture a multi-view web dynpro application u2013 the first view contains a text edit input (lv_KeyValue) which is used as a lookup key. Another view contains the detailed information that was looked up (ls_Structure). Other views exist as well.

The user populates the KeyValue , hits enter, and a REFRESH action and handler are called to rebuild the detail display.

For various reasons, u2026. there is a desire to update the detail display when the KeyValue field is changed even without pressing the enter key. Essentially, they want the update to occur also when the user

  • sets focus on the input field

  • changes the value

  • moves focus away from the field

I guess Iu2019m looking for a way to trap the field's ON_ FOCUS_LOSS (or something like that) so that I can attempt to push through my action.

Is this possible ?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi

There is no straight way to do that. I am not even sure the following work around is recommended by SAP. So it is up to you to use it wisely.

You can subscribe to the event of CL_WDR_CONTEXT_ELEMENT ON_ATTRIBUTE_CHANGED event.

you need to create a class which act as listener to the above said class and event.

Thanks to Chris paine for his wonderful experience on documenting that in a blog. This blog deals with standard value help but it is also very closely applicable for your case as well. Here is the link (press Blog)

[Blog|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/20054] [original link is broken] [original link is broken] [original link is broken];

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>You can subscribe to the event of CL_WDR_CONTEXT_ELEMENT ON_ATTRIBUTE_CHANGED event.

This won't give you the event on change of focus, however. This would only fire when a server event occurs. What is being asked for is basically an extra server event which isn't offered by the current UI element. This isn't possible.

Also rather than subscribing to this context event, you should just use the Context Change Log. But that too isn't going to really help in this situation since it only fires on server event also.