cancel
Showing results for 
Search instead for 
Did you mean: 

WDDOMODIFYVIEW Screen Input Fields values before enter

former_member425121
Participant
0 Kudos

Hello experts

I have some wda with screen input fields and this wda receives every some time (some seconds) one event that causes the WDDOMODIFYVIEW method of the wda view is executed. The problem is that when the user is writing the fields in the screen , when the WDDOMODIFYVIEW is executed that fields values returns to the original value , if the user has not given enter or the user has not changed the cursor position to other field.

I mean, if the screen field appears with some value 'FIRST_VALUE'  and the user is writing 'SECOND_VALUE'  , when the wda recives the event (and modifyview method is executed) then the field reurns to the original value 'FISRT_VALUE' , it simply erase the new characters the user were writing and put again the original value. Of course this happends because when the WDDOMODIFYVIEW method is executed, for the WDA the screeen field has yet the original value although in the screen the field has the new value writen by user (if user gives enter or change to other screen field, then when the modifyview method is executed the new value written by user does remains).

Does somebody knows if there is some whay to force in WDDOMODIFYVIEW method that some screen field value remains even if the user has not given enter or changed to other screen field ?

Regards

Frank

Accepted Solutions (1)

Accepted Solutions (1)

former_member184578
Active Contributor
0 Kudos

Hi,

This is not possible as we don't have onFocus onBlur events like in javascript. You need to press Enter to read the new values.

Regards,

Kiran

former_member425121
Participant
0 Kudos

If i read in wmodifyview method the field (with get_attribute) it has still the initial value displayed '123' even in the screen the field has now the new value written by user '456'  ; this is because the user has not given enter or the user has not changed to other screen field ; so i guess there is not way to get the value being writing by user before he gives enter.

That field is a commentary field i mean in this field the user writes a long character comments.What i wanted to do is to avoid the user tell me he was writing some value and then the screen puts againg the initial value and erase the characters he was writing; and he's ritght , it should not be happening. 

Best Regards

Frank

Answers (3)

Answers (3)

Former Member
0 Kudos

You should look into using method WdDoBeforeAction. This method is triggered when any action is triggered for your WDA view. A timer is still an action so you should be able to save data into the corresponding context nodes/elements in the WdDoBeforeAction method.

Former Member
0 Kudos

Hi,

You can store the inital values in a internal table say for example ITAB_BUFFER.

In the modify view you can compare the context new values and old values stored in buffer internal table.

You can compare the new values with old values and set the old values again if it has been changed.

Or you can also use context change log functionality.

Hope it helps.

former_member425121
Participant
0 Kudos

Hello Bhanu, the value i need to get is the value being writing by user before he gives <enter> because the problem is that when wmodifyview method is executed that value being writing is lost , it just is erased and then in the field appears again the initial value displayed in the screen field ; this is because that screen value is not yet atached to the context field (because user has not given enter or user has not changed position to other screen field) ; even if user has written other value this value is ignored and the initial value is restored in screen .  I guess there is no way to get that value being writing by user because this value appears in screen but it is not attached to screen field yet .    Thanks , Frank.

former_member184578
Active Contributor
0 Kudos

Hi,

even if user has written other value this value is ignored and the initial value is restored in screen .

You need to read the new value using get_attribute method and update.

My Understanding:

->Let say you have one input fied. ( In DOMODIFYVIEW method your are setting the value say 123 to the input field from data base/ from other application!! )

-> Now 123 is displayed on the screen. You change the value to 456 and press Enter again 123 is displaying!!

this is because, you are always setting the old value in DOMODIFYVIEW method. Instead you have to read the new value using get_attribute method and update it back.

Regards,

Kiran

Former Member
0 Kudos

Hi Frank,

Check using first_time = 'X' .

Regards,

Mahidhar.

former_member425121
Participant
0 Kudos

Hello Mahidhar

I check first_time value and its help me to know when the modifyview methos is executing by first time, but however when the method is executed the screen field being writing by user returns to the original value wich the view was shown intitially with.

Is there any way in this method to detect the screen field value even the user has not given enter or the user has not changed to other screen field ?

Regards

Frank

former_member425121
Participant
0 Kudos

Any idea ?

former_member425121
Participant
0 Kudos

I assume there is not way to do what i need .

Best Regards

Frank