cancel
Showing results for 
Search instead for 
Did you mean: 

How to press a button with the enter key at Webdynpro ?

Former Member
0 Kudos

Hello:

I have a simple webdynpro app which has a button, the button should be press with the mouse or with the enter on the keyborad. How to make it?.

Thanks.

RLS.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

You must assign a view controller action to the Button.<i>onAction </i>event.

Armin

Former Member
0 Kudos

Thanks for answer Armin.

The code at "onAction" is execute after I make a click with the mouse on the button. So, <b>the fire event is </b>"<b>the click on the button with the mouse</b>", I want the fire event: "the user press the enter at the keyboard" besides the user would be able to make a click with the mouse on the button. I can't insert javascript code at webdynpro to do it...how can I get the result?.

Thanks again.

RLS

Former Member
0 Kudos

If the button has keyboard focus, it is also triggered by pressing the ENTER key. If you want to trigger a button that has no keyboard focus, you have to set is as default button of a container.

Armin

Former Member
0 Kudos

Exactly! but I see the button properties (layout and code)and has none "keyboard focus" or "default" to set it as default button or make it a keyboard focus button....I'm with NW2004.

Thanks for your time.

RLS

Former Member
0 Kudos

Hi,

if you want to set a focus on the button.

write the following in DoModify()

if(FirstTime)

{

IWDButton b=(IWDButton)view.getElement("<ButtonID>");

b.requestFocus();

}

it may help you.

Former Member
0 Kudos

You have to set the following properties at the <b>container</b>:

- defaultButtonID = ID of default button

- isLayoutContainer = false

(If your Web Dynpro version already has them)

Armin

Former Member
0 Kudos

Armin:

NWDS 2.0.16 (NW2004) don't have that properties...is only available at NWDS 7.0.07 (NW2004s). I'm working with NWDS 2.0.16 (NW2004), that's why I post it.

Thanks a lot for your time.

RLS

Former Member
0 Kudos

Thanks for answer Karthikeyan Ramasamy.

The code don't make permanent the "on focus". Every time I write on the input field the focus is set at this UI and left the button focus...so, the enter key is ignore. The page is not reload until the input is filling up and the button is press.

Thanks.

RLS