cancel
Showing results for 
Search instead for 
Did you mean: 

How to set the cursor in an input field on page load

Former Member
0 Kudos

Hi all,

I have to inpuitfields followed by a button.If the user clicks on the button with out entering data in one of the input filels it has to show a popup message as Please enter the Value and it has to place the cursor in that respective inputfiled with focus on it..

Can anyone please help me out

Regards

Padma N

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

Use as follows


IWDConfirmationDialog confirmationDialog = wdComponentAPI.getWindowManager().createConfirmationWindow(confirmationText, eventHandlerId, label)
	  confirmationDialog.setTitle("");

Regards

Ayyapparaj

nikhil_bose
Active Contributor
0 Kudos

padma,

You have to set it in the wdDoModifyView()

if ( firstTime ) {

{

IWDInputfield inp_field = (IWDInputfield) view.getElement("<inputField_ID>");

inp_field.requestFocus();

}

regards,

nikhil

xxxxxxxxxxxxxxx

Edited by: Armin Reichert on Feb 23, 2008 6:29 PM

Former Member
0 Kudos

Hi Padma..

Use this to set focus on input field..

In your WdDoModifyView method of the view controller,

if(firsttime)

{

// get the UI element you want to focus In this case i am taking a input field

IWDInputfield inputfield = (IWDInputfield)view.getElement("<UI element ID>");

inputfield.requestFocus();

GS

Former Member
0 Kudos

Hi,

1. You can open a Confirmation dialog box with the message "please enter some value" and clicking on the OK button of the Confirmation dialog box set the cursor to the input field using the request.setFocus() method.

Regards,

Murtuza

Former Member
0 Kudos

Hi Murtuza,

Actually it is a message not a confirmation window..For confirmation window it is comming top as Confirmation window.

Is it not possible to remove that message "Confirmation window"

Regards

Padma N

Former Member
0 Kudos

Hi,

Just try to see if you can set some value for WindowTitle for your window instance created for the confirmation dialog.

You would get setTitle("") method for the confirmationDialog object.

Try passing null to this.

Regards,

Murtuza

Edited by: Murtuza Kharodawala on Feb 15, 2008 2:12 PM