cancel
Showing results for 
Search instead for 
Did you mean: 

How to enable ENTER button on Keyboard

0 Kudos

In my Sales Order Create WDA App,

I am able to trigger the valdiation of the Data

and then Simulation of Sales order

when a button is clicked on the Create Sales Order View.

How to achive the same functionality when the ENTER button on the Keyboard is pressed?

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Chandra ,

You can set Focus to the UI element based on your condition and the if you press enter your button action will trigger .

In below screen shot i have set the focus to the button (you can see the button is highlighted )

and after just i presed enter .. its triggered the action assigned to the button

modify view method

  DATA: lr_elem TYPE REF TO if_wd_view_element.
  lr_elem = view->get_element( 'BUTTON_ID' )." pass the UI element ID you want to set focus
  view->request_focus_on_view_elem( lr_elem ).

Regards,

Chinnaiya Pandian

former_member184578
Active Contributor
0 Kudos

Hi Chinnaiya sir,

If we set focus on button, let say if I enter value on 1st input field or any other field that focus will shift from button to input field. So creating an onEnter event for input field(s) and use the same action of button event will be fine I feel.

Thanks & Regards,

Kiran

Former Member
0 Kudos

@ Kiran,

If the user is not entering any detail in 5th field and cursor is not going to that field  what will happen in that case?

former_member184578
Active Contributor
0 Kudos

Hi Pintu,

Yes thats also one case.. I have mentioned that input field(s).. but normally we expect user will enter all values and hit enter.. not in testers perspective.. and yes we need to take care of this..

Regards,

Kiran

Former Member
0 Kudos

Yes kiran i accept your point. Focus will change one you put cursor on other fields. That’s why I have mention

set Focus to the UI element based on your condition

 

This is purely based on his requirement. Either he can do by setting the focus or handle by on enter event.

But he needs to look into all the case situations. Or else if he want the easy solution & can convince the client he can assign a hot Key for the button.

Regards

Chinnaiya Pandian

0 Kudos

TIMEDTRIGGER refreshes the screen per interval specified and this can be used to set focus on a button for which the ENTER action can be attached.

You can find examples of this interface element in the system in the Web Dynpro application WDR_TEST_UI_ELEMENTS, and in the component WDR_TEST_EVENTS in the view TIMEDTRIGGER

Answers (1)

Answers (1)

former_member184578
Active Contributor
0 Kudos

Hi,

Ley say in the view there are 5 input fields, now in the 5th input field create an action for onEnter event( you can find it under properties of the input field in the view ) . Now place the same code of button in onAction of Enter .

Hope this helps u.,

Thanks & Regards,

Kiran