gwt - MTextBox setFocus() not showing the focus on textfield on view load, MGWT -


I created an app with gwt, mgwt and gwtphonegap. Some text fields have one of my thoughts, I have a requirement that I need to set the default focus on my first field when I visit that view,

  first input field = new MTextbox (); FirstInputField.setFocus (true);   

// I'm not calling setFocus () on the remaining fields. But when my first input field is not focused, when the view is loaded. If there are any direct or alternative ways to do this, please provide me

Thanks in advance,

Arun Kumar.

The box should be added to the DOM, if you only create a box, any of the browser HTML Without context, it can not control the focus.

Add the box to your view and set your focus, if it is not working, try wrapping the set focus in the scheduled command:

  Scheduler gate (). Schedule Unlisted (New Scheduler.ScheduledCommand) {@Override Public Zero Execute () {firstInputField.setFocus (true);}});   

The indexed commm will be removed, followed by renderlap, and all HTML elements are ready, and the focus can be set.

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -