cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
321tseug
Level 3

How to request focus ?

In a custom dialog,there are some ISTextfeild.

I added a listener to query exit.

public void queryExitXXXDialog(com.installshield.event.ui.ISDialogQueryContext arg0) {
  if ( A_IsTextfield.getText().length() == 0 ) {
    arg0.getWizardUI().displayUserMessage("Error","Please input arguments!",WizardServicesUI.ERROR);
    arg0.setReturnValue(false);
    A_ISTextfield.requestFocus();//how to make A_IsTextfield request Focus ?
    //coz I have many ISTextfield to validate their values, I have checked the advance api of Installsheild for ISTextField, but I can't find any requestFocus() method likes Swing does.
    return;
  }
}

any ideas?
thanks for help
Labels (1)
0 Kudos
(2) Replies
enanrum
Level 9

I do not think this can be done With IS Universal! I've asked in the past to no avail!

Not only that - if you notice when you install the Universal and have to put the product key - you have to Tab to the next field; which leaves me to believe that if it could have been done - they wouldv'e did it here when you entered the appropriate number of text in the field to give the next text box focus!

At least that's what I was trying to do and couldn't find a way of doing!

If you find a way - please let me know!
Regards,
Tom
0 Kudos
shibinpaul
Level 2

In import field :
import com.installshield.ui.controls.*;
import javax.swing.JTextField;

This is how we get focus for a text box

ISTextField nextTextField = (ISTextField)arg0.getISContainer().getControl("ISTextFieldDef1");
JTextField jText = (JTextField) nextTextField.getNativeComponent();
jText.selectAll();
jText.requestFocus();
0 Kudos