How to vertically align radio buttons in Struts2 [duplicate] - struts2

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How to make Struts radio tag create a vertical list of radio buttons
How to vertically align radio buttons in Struts2, as the generated radio buttons are aligned horizontally by default.
I am iterating it over a list.
<s:radio theme="simple" list="masterList" name="selectedDatabase" onclick="gotoAction(this)"/>

<s:iterator value="masterList">
<s:radio theme="simple" name="selectedDatabase" list="#{id:name}"/><br>
</s:iterator>
where id will be the property of the list, you want to submit and name will be the label of the radio button.

Related

How to align two buttons side by side in struts 2

I am trying to align two buttons in struts2. I am beginner in struts so trying to figure out this. I am using <s:submit> tag. Its putting each button in a separate <tr> tag. That is why one button is coming below the second button. I want both the buttons side by side. Please provide information on this.

What is the use of data-role="fieldcontain"?

I just discovered that text inputs within a div with data-role="fieldcontain" don't expand to the 100%, but if you place a text input outside of a fieldcontain it expands to the fullest. This is a bug that they are fixing, but meanwhile...
So I was wondering what is the use of that data-role="fieldcontain" in the first place? Why to put it? I saw it on the documents and I just put it in my html, but what is the use of putting it?
Thanks!
Looks like it's a Field Container for Grouping and Display
http://jquerymobile.com/demos/1.1.1/docs/api/data-attributes.html
Field container Container with data-role="fieldcontain" wrapped around label/form element pair
Controlgroup DIV or FIELDSET container with data-role="controlgroup". Visually integrate multiple button-styled
inputs of a single type (checkboxes, link-based buttons, radio
buttons, selects) into a group. For grouping form checkboxes and radio
buttons, the fieldset container is recommended inside a div container
with the data-role="fieldcontain", to improve label styling.
data-mini true | false - Compact sized version for all items in the
controlgroupdata-type horizontal | vertical - For horizontal or
vertical item alignment
As of jquerymobile 1.4 data-role="fieldcontain" is deprecated!
use class="ui-field-contain" instead.
see release notes http://jquerymobile.com/changelog/1.4.0/

Struts2 checkboxlist

I have a Struts checkboxlist value="val" listkey="lk" listvalue="lv" and this checkboxlist is iterating and getting 5 checkboxes as per the list in the action class. My quesiton is when I click on first checkbox it should show div element right below the checkbox. Remember theme like "vertical" where we append break br in template. In the same way how can I achieve div element right below the check box when its clicked

How to align radio button list with text input list

With a my quiz creator interface, the user enters three answers then marks the correct one by setting the radio button:
http://jsfiddle.net/VLeph/2/
However, I cannot get the text input and checkbox to line up nicely. Preferably, I would like to do this without rounded corners between text input and checkbox. Like the horizontal radio group shown in the link below. But with text input on the left instead.
http://jsfiddle.net/CeN9z/ .
Do you have an idea how to do this?
thanks :)
Christian
You can try placing all the text inputs in one cell in the grid, and all the radio buttons in the other cell, then use a bit of styling to align them properly.
Something like jsfiddle

Radio buttons in Hobo Rails

How can I use radio buttons in a form in Hobo Rails? I want a gender field with two options "Male" and "Female". If I use the default enum_string type it creates drop down select instead of radio buttons.
Hobo does not currently support radio buttons. You have to do them yourself.
There is a half complete tag defined in this post.

Resources