High,
im currently in transition from messagebox 2.x to 3.x and now i hit a big obstacle.
The 2x release provided the possibility to access a button object so it was possible to enable or disable the button programatically.
Is there any way to do this also in the 3.x release ?
peter
Last edit: Peter Katzmann 2016-09-02
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
yes. You have two methods "withButton()". One of them has a paramter with a Button. You simply create your own Button instance and added as parameter to the method. Another way is to get the window from the message with getWindow() and iterate throw the child components. But that is not so comfortable.
BTW, I'm interested in the use-case: Why do you need to disable a button? Is the state statically or does the button state change during a messagebox is displayed? Maybe a feature missing.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The Button State is changing due to some validation restrictions of some input fields.
Like you have an Dialog to fill Input data a and the save button is disabled till you have filled all necessary fields.
This is quite better then to let the user push the save and then complain about missing data....
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I looked for the withButton method and it is a possible work around but imho it would be better to provide something to retrieve a button object like it was possible in the 2.x series.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Ok, I understand your use case. I have identified 2 new enhancements:
1. You can change via ButtonOption the button state to disabled.
2. Lookup method like 'Button getButtonBy(ButtonType buttonType)'.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
High,
im currently in transition from messagebox 2.x to 3.x and now i hit a big obstacle.
The 2x release provided the possibility to access a button object so it was possible to enable or disable the button programatically.
Is there any way to do this also in the 3.x release ?
peter
Last edit: Peter Katzmann 2016-09-02
Hi Peter,
yes. You have two methods "withButton()". One of them has a paramter with a Button. You simply create your own Button instance and added as parameter to the method. Another way is to get the window from the message with getWindow() and iterate throw the child components. But that is not so comfortable.
BTW, I'm interested in the use-case: Why do you need to disable a button? Is the state statically or does the button state change during a messagebox is displayed? Maybe a feature missing.
The Button State is changing due to some validation restrictions of some input fields.
Like you have an Dialog to fill Input data a and the save button is disabled till you have filled all necessary fields.
This is quite better then to let the user push the save and then complain about missing data....
I looked for the withButton method and it is a possible work around but imho it would be better to provide something to retrieve a button object like it was possible in the 2.x series.
Ok, I understand your use case. I have identified 2 new enhancements:
1. You can change via ButtonOption the button state to disabled.
2. Lookup method like 'Button getButtonBy(ButtonType buttonType)'.
FYI, I have released a new version.
Yeah,
i saw it and will try it out immediately.
Thanks
peter