View Full Version : How to request focus ?

04-06-2006, 01:20 AM
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);
****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.

any ideas?
thanks for help

04-06-2006, 07:10 AM
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!

10-18-2007, 06:36 AM
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();