|
Re: Selecting buttons in a RadioButtonGroup [message #1841403 is a reply to message #1841384] |
Fri, 14 May 2021 13:42 |
|
This should work. I recommend setting a break point and inspecting the data. You can also step into the getButtonFor() method to see which buttons are available and what their "radio value" is. If you have multiple classes of the same name in your workspace (e.g. two different GenderCodeTypes), ensure that you use the correct imports.
Two additional remarks:
- Radio button groups are value fields, so you might be able so simplify your code to something like this: getGenderGroup().setValue(extractGenderCode(employee)).
- I don't now exactly how your application is structured, but in general "enum" values should always be stored as technical ID and not as a display text. TEXTS.get() might return different values for users with different languages, so your "if" statements would fail if a record stored by user with language A is opened by another user with language B. That's exactly why RadioButtons (and SmartFields) always provide the key as their value, not the display text.
Regards,
Beat
|
|
|
|
Powered by
FUDForum. Page generated in 0.03071 seconds