简体   繁体   中英

Install4j configurable form text field reset from validation expression

In install4j I'm having a Configurable form with Username and Password fields in it. Once the user enters username and password and hit's Next button, using webservice we are checking whether the credentials are valid and proceeding to the next screen. If it's not valid then we'll be throwing a message to user on the same screen as "Invalid credentials - Please enter correct username/password" by using Util.showErrorMessage(wrappedMsg); Once user clicks Ok on this new window now I've to clear the UserName and Password that is peviously entered. I'm populating the error message from Configurable Form->Properties->Validation Expression present in control flow. Please tell me how to set the UserName and Password field text to null again from the validation expression ?

Probably it's easiest if you just set the values of the text fields directly. In a validation expression you could do

((JTextField)formEnvironment.getFormComponentById("123").
    getConfigurationObject()).setText("");

where "123" is the ID of the form component.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM