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
SamarthyaSamarthya 

<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}"/>
</apex:selectRadio>

 

 

 

. 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}"/>
</apex:selectRadio>
</apex:pageBlock>
</apex:form>
</apex:page>

 

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'));
	}
}

 

 

 

Pradeep_NavatarPradeep_Navatar

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:selectRadio>
</apex:pageblocksection>
<apex:pageBlockSection rendered="{!ProductOptionval}">
<apex:outputlabel value="FIXED OPTION WAS SELECTED!"/>
</apex:pageBlockSection>
</apex:pageblock>
</apex:form>
</apex:page>

hattihatti

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:selectradio>

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

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

  </apex:selectOption>

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

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

  </apex:selectOption>

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

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

  </apex:selectOption>

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

</apex:selectradio>