In my struts2 application, I would like to bind the boolean property (let it draw frobbed using isFrobbed () getter) on my controller with a couple of yes and no radio buttons (I know that I can use the checkbox, but for various reasons we preferred would be a clear yes and no)).
Using the checkbox, I will do something like this:
<@s.checkbox name="frobbed" label="would you like this to be frobbed?" />
However, with the switches I completely lost. I know there is a struts2 tag called "radio", but I'm not sure how it is used. For example, this does not work.
<@s.radio name="frobbed" value="true" label="Please frob this object" /> <@s.radio name="frobbed" value="false" label="No frobbing, thanks." />
I would like this to be related to the "frobbed" value in the controller, so that, for example, when the value is true, the yes camera is automatically selected.
Any ideas?
source share