cancel
Showing results for 
Search instead for 
Did you mean: 

setting focus on a button

Former Member
0 Kudos

Hi all,

I have created a view that contains a "Submit" button.

I want that whenever i press "Enter" button from keyboard, The focus should go to that "Submit" button of my view & action of that button is called.

Thanks,

Arch

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

I just stumbled across this thread and wanted to contribute. We use code like to following to give input focus to a button:

    wdControllerAPI.requestFocus (wdThis.wdGetShowSelectionCriteriaAction());

where <i>ShowSelectionCriteria</i> is the name of the action for the button that we want to have focus.

Regards,

Kelly

Former Member
0 Kudos

Thanks all for reply...

Former Member
0 Kudos

Hi,

For the Enter button to work you need to have a InputField ot TextEdit in your view.

Create a action and associate it with the OnEnter event of the UI elements.

Note: For the action to be called you need to have focus on the InputField or TextEdit whose event OnEnter is associated with a action. If you have more than one inputfield or textedits then it will be difficult to manage the focus.

To focus again you need to invoke wdDoModifyView method of the view controller, which inturn requires some eventing or action in the view.

Former Member
0 Kudos

Hai Siva,

You may have any Input Fields or TextEdits in Your View, bind OnActionEnter to Submit Buttons Action.

in wddomodify make those to be set focus initially.

view.getElement("Inputfield").requestFocus();

then this element is to focused, if you press enter action of this inputfield is invoked and the action is processed.

Regards,

Naga

former_member186016
Active Contributor
0 Kudos

The only closest behavior i see is that on each UI element in your view which support Enter Key Listener i.e. have onEnter property you fire the action to submit the form/view.

Regards,

Ashwani Kr Sharma

former_member189631
Active Contributor
0 Kudos

Hi Siva,

  • I dont think its Possible to set focus on a Button.

Regards,

</b>Ramganesan K</b>