• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 5181
  • Last Modified:

Aligning Radio Button in a JSP/JSF with its label

Hello:

I would like to achieve the following in a JSP/JSF environment:

Gender:   RadioButtonForFemale FEMALE    RadioButtonForMale  MALE

Basically, all the radio button should be in the same row as the lable (Gender in our case).

Attached is my current code. the radio button appear in the next row. My PanelGrid has 1 column.

thanks,
<<< Ali >>>
<h:panelGroup>
       <h:outputLabel for = "searchSex" value = "#{bundle.Sex_Label}" style ="width:15%;">
       </h:outputLabel>      
	   <h:selectOneRadio id="searchSex" value="#{yy.search_Sex}" style="verticle-align:top;font-size:95%;color:red;">
        <f:selectItem itemLabel="F" itemValue="F" />
        <f:selectItem itemLabel="M" itemValue="M"/>
	   </h:selectOneRadio>

Open in new window

0
MohammadAliQureshi
Asked:
MohammadAliQureshi
1 Solution
 
ramazanyichCommented:
Surround you <h:panelGroup> with <h:panelGrid id="grid" columns="1"> element.
You code would be:


<h:panelGrid id="grid" columns="1">
<h:panelGroup>
       <h:outputLabel for = "searchSex" value = "#{bundle.Sex_Label}" style ="width:15%;">
       </h:outputLabel>      
           <h:selectOneRadio id="searchSex" value="#{yy.search_Sex}" style="verticle-align:top;font-size:95%;color:red;">
        <f:selectItem itemLabel="F" itemValue="F" />
        <f:selectItem itemLabel="M" itemValue="M"/>
           </h:selectOneRadio>
..
</h:panelGroup>
</h:panelGrid>

Open in new window

0
 
MohammadAliQureshiAuthor Commented:
Thanks for your help and sorry for the delay ... being busy
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now