function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

<apex:selectRadio> + Label

When I am using



<apex:selectRadio id="slctRd" dir="ltr" required="true" layout="pageDirection" value="{!selectedValue}" immediate="true" onclick="alert('hi);">
<apex:selectOptions id="selRdOptn" value="{!Options}"/>




. The label is appearing before the radio button is it by default? I did not find any option to change the Radio button from Extreme right orientation to extreme left orientation.


- Samarthya

Shoby Abdi.ax910Shoby Abdi.ax910

I tested it with some of your code and the text is appearing after the radio button by default


<apex:page controller="SelectRadioController">
<apex:form >
<apex:pageBlock >
<apex:selectRadio id="slctRd" dir="ltr" required="true" layout="pageDirection" value="{!selectedValue}" immediate="true">
<apex:selectOptions id="selRdOptn" value="{!Options}"/>


public with sharing class SelectRadioController {
	public String selectedValue {get; set;}
	public List<SelectOption> Options {get; set;}
	public SelectRadioController() {
		Options = new List<SelectOption>();
		Options.add(new SelectOption('test', 'test'));
		Options.add(new SelectOption('test', 'test'));
		Options.add(new SelectOption('test', 'test'));





Find below a sample code in which layout="Pagedirection" property for apex:radiobutton for assigning the redio button vertically is used :

<apex:page id="pageid" controller="ProductSelection" >
<apex:form id="formid">
<apex:pageblock title="Product Selection" id="theBlock">
<apex:outputtext value="Which product would you like to add to the oppoortunity? (select one)" />
<apex:pageblocksection columns="1">
<apex:selectRadio id="fectdata" value="{!ProductOption}" layout="pageDirection" dir="LTR">
<apex:actionSupport event="onchange" rerender="theBlock" />
<apex:selectOptions value="{!Products}"/>
<apex:pageBlockSection rendered="{!ProductOptionval}">
<apex:outputlabel value="FIXED OPTION WAS SELECTED!"/>


I have a simple requirement which says, <apex:selectRadio> has 4 Permanent Selectoptions.

Below each of the first three options in the list I need to display a output panel with content. Though I put output panel tag in each selectOption. All Of them come at the start, Then select Radio button for each option follows. Please help solve this.


Sample syntax: Might not be perfect



  <apex:selectOption itemName="" itemLabel="">

       <apex:outputPanel>hello world1</apex:outputPanel>


  <apex:selectOption itemName="" itemLabel="">

       <apex:outputPanel>hello world2</apex:outputPanel>


  <apex:selectOption itemName="" itemLabel="">

       <apex:outputPanel>hello world3</apex:outputPanel>


<apex:selectOption itemName="" itemLabel=""/>