Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X
Hello,
I am trying to use two radio button widgets in a mashup on 9.3.5.
I have set them to the same Radiogroup:
And I feel like I am missing something super obvious, but shouldn't I be able to know which of the buttons in the group I have selected? Otherwise I'm not sure I see the reason to group them...
For now I'll just use the "Generic Radio Button" widget instead.
Thanks,
Jens
Solved! Go to Solution.
*Explanation*
It seems like there are different use cases for each type of radio button widget.
For my particular use case it is simpler to just use the Generic Radio Button widget as I would like to use it to quickly select one or the other option in it.
For other use cases such as somewhere you would like to have a multi select (similar to check boxes) but want to limit the user in only selecting one option, then the Themable Radio Button widget might be better.
I hope this explanation covers most situations in case someone else stumbles upon this post.
Also, have a look at @nitinsriv answer as well.
Thanks,
Jens
In case you are trying to achieve something like below:
red marked is radio group, while the blue one is generic radio button.
Then I have a binding to trigger service which just displays option selected as a basic example.
But hopefully this can be extended to fit your needs with some tweaking.
Hello,
I think I see what you have done.
Basically if the first radio button is not "true" then the second radio button would be (if you have set one of the buttons to true by default).
This approach does work, I was even thinking of having both radio buttons states passed into an expression and do a check like:
if (button1 && !button2) {
output = 'button1 selected';
else if (!button1 && button2) {
output = 'button2 selected';
}
But this would get really annoying if I need to add more buttons in the future.
I suppose if I don't want to use the Generic Radio Button widget I'd have to build my own widget or wait for an update of the regular "Radio button" widget.
Thanks,
Jens
The radio group only "makes sure" that only one is active. To find out which one you are on the right track I think.
As an alternative you can use the "ButtonBar" which may be easier to use but needs a StateDefinition. E.g. with alert priority State definition:
Hi Jens,
This is also true if you need to set the values on loading your mashup. Each button has to be set individually and it does get more complicated/annoying depending on the amount of buttons in the group.
Travis
*Explanation*
It seems like there are different use cases for each type of radio button widget.
For my particular use case it is simpler to just use the Generic Radio Button widget as I would like to use it to quickly select one or the other option in it.
For other use cases such as somewhere you would like to have a multi select (similar to check boxes) but want to limit the user in only selecting one option, then the Themable Radio Button widget might be better.
I hope this explanation covers most situations in case someone else stumbles upon this post.
Also, have a look at @nitinsriv answer as well.
Thanks,
Jens