Dialog Design - Disable button if no text entered.
Hello All,
I have a hopefully simple and straightforward question about how to hide a button on a dialog when there is no text entered in a Edit box.
The scenario is that when our user install our software they are requested to enter in details into a Edit Field box which is assigned a property ("PXSERVERNAME"), should this ="" then the button is hidden.
This works upon loading the dialog as the Edit Field is blank by default, however when text is entered into the box then the button is still disabled. I can get this logic to work with other controls like the Radio/Check buttons however from reading the ControlEvents help it would appear that Edit fields react differently.
I suspect that the answer lies in the Subscribe/Publish event functions, however I dont seem to be able to marry the two.
Does anyone know how this is done?
Kind Regards
Paul
I have a hopefully simple and straightforward question about how to hide a button on a dialog when there is no text entered in a Edit box.
The scenario is that when our user install our software they are requested to enter in details into a Edit Field box which is assigned a property ("PXSERVERNAME"), should this ="" then the button is hidden.
This works upon loading the dialog as the Edit Field is blank by default, however when text is entered into the box then the button is still disabled. I can get this logic to work with other controls like the Radio/Check buttons however from reading the ControlEvents help it would appear that Edit fields react differently.
I suspect that the answer lies in the Subscribe/Publish event functions, however I dont seem to be able to marry the two.
Does anyone know how this is done?
Kind Regards
Paul
0 Comments
[ + ] Show comments
Answers (2)
Please log in to answer
Posted by:
john.pirvu
14 years ago
Hi Paul,
Unfortunately this is not supported by Windows Installer. To conditionally enable or disable controls you can use control conditions in ControlCondition table. However, the condition is evaluated when another control takes keyboard focus. So you cannot update another control while typing in an edit box. Subscribed events cannot be used because they designed for detecting internal installer operations and edit boxes cannot have published events.
I usually recommend some sort of Validate button which the user can press after typing so control conditions can work. A more complicated approach is to use an external UI which supports this.
Unfortunately this is not supported by Windows Installer. To conditionally enable or disable controls you can use control conditions in ControlCondition table. However, the condition is evaluated when another control takes keyboard focus. So you cannot update another control while typing in an edit box. Subscribed events cannot be used because they designed for detecting internal installer operations and edit boxes cannot have published events.
I usually recommend some sort of Validate button which the user can press after typing so control conditions can work. A more complicated approach is to use an external UI which supports this.
Posted by:
package_aligator
14 years ago
Like John mentioned: ControlCondition Table is the fastest way out but not so reliable due to the control focus thing.
A different approach would be to condition the NewDialog event launched by the button with your property PXSERVERNAME.
In case PXSERVERNAME="" launch a message box asking for the edit field box to completed.
A different approach would be to condition the NewDialog event launched by the button with your property PXSERVERNAME.
In case PXSERVERNAME="" launch a message box asking for the edit field box to completed.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.