• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4983
  • 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

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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