10

Your apex:outputPanel with id="Travel_block" is not rendered by default, because the selectedAPTransport variable is not Yes. If it is not rendered, then it is not accessible by ID for actionSupport. You need to wrap this pannel with another panel without layout and rerender it (wrapperPannel in my example): <apex:selectRadio value="{!selectedAPTransport}...


7

The error you're seeing is occurring because a selectRadio can only have options as children; they can't wrap a table. That approach won't work because the selectRadio component isn't set up to do that. Lacey's answer certainly is one solution. When I've needed to do this, I've opted for using a backing wrapper class that has a "selected" Boolean attribute, ...


7

I have never used action function before as a child of the inputs, usually just use action support <input type="radio" name="satisfaction" value="1"> {!$Label.One} <apex:actionsupport event="onclick" action="{!ctrl.submitSatisfactionComment}" rerender="myPanel"/> </input> <input type="radio" name="satisfaction" value="2"> ...


6

Use the layout option on apex:selectRadio. This will determine the appearance of the elements: lineDirection: the values go across the screen (DEFAULT VALUE). pageDirection: the values go down the screen.


4

This is how you would make sure you are using jQuery (in this case taken from a CDN location): <apex:includeScript value="https://code.jquery.com/jquery-1.11.0.min.js"/> <script> var j$ = jQuery.noConflict(); function getSelectedContact() { var $radio = j$('input[name=group1]:checked'); var selected = $radio.attr('id'); afAssign(...


4

I noticed that you can wrap the first instance of the expression in standard HTML tags but you can't apply any inline css nor add any other properties. So I've come up with something like this: <apex:selectOption itemValue="" itemLabel="<h3>{!$Label.RestrictionTypeAttributeLabel1}</h3><br/><div style='font-size: 14px; padding-left: ...


3

The problem in your code is that the outputPanel is never rendered by default. That is it ID is not accessible by the actionSupport. To solve this you will need a "wrapper" outputPanel and rerender it. <apex:outputPanel id="otherDRDeliveryFormatPanel" layout="none"> <apex:outputPanel rendered="{!sObjectRFC.Mailshot_delivery_format__c=='Other'}"&...


3

Normally a selected value will assigned to the variable automatically when you submit the form. The syntax is very easy: Define a new variable Create a new select list Submit the form (with an action:support for example) Check selected variable in controller Apex class: public with sharing MyClass{ public String selectedValue { get; set; } ...


3

It's a bit nasty but I think your only real option here is to use HTML radio elements. You could use some javascript in the onClick event to copy the current value to an <apex:hidden> form element which is then bound do the desired variable in the controller. I've split out checkboxes by using a map and dynamic binding in the past, but again, without ...


2

I agree with jkraybill and LaceySnr, I think the only way to have/enforce a "selectRadio" is to jimmy rig something out of HTML elements + javascript (jQuery). I recently had the same situation, and I used a wrapper class + <apex:inputCheckbox>s + jQuery to enforce only checkbox can be checked out of my selection. Here's my example in case it helps: ...


2

You need to define a value parameter of the selectRadio component and assign some string variable to it: public String selectedValue { get; set; } public Component.Apex.selectRadio getCustomInsuranceProducts(){ Component.Apex.selectRadio myCustomRadio = new Component.Apex.selectRadio(); myCustomRadio.id = 'Insurance_Package'; ...


2

One solution is to use isDisabled property of SelectOption class. Check the SelectOption Constructors detail page, there is a constructor which can take 3 arguments (value, label, isDisabled). So if you set the value as true, the user can't select this radio option. You can use this constructor to make this option as Conditional Read-Only. Some code ...


1

Heres a quick example, based off the SelectRadio demo code. This controller provides a list of SelectOption's, which is populated with the contact name and ids from a given accountId. Adding ?AccountId= with a valid Id after it to the url of the page will provide the needed Id. For this example, the Save method puts the selected contact id inside a non-...


1

Please try below and fix the margin and size as per your need <apex:page lightningStylesheets="true" applyHtmlTag="true" > <apex:includeLightning /> <apex:slds /> <apex:form> <div class="slds-box slds-size_1-of-6 slds-m-left_xx-large slds-m-top_large" > <div class="slds-grid slds-gutters">...


1

From your code, it seems that during testing you are not entering mandatory input values which have been specified in inputField. Better, you should wrap the actionSupport code snippet within actionRegion so that it should not depend on any other inputs. <apex:pageBlockSection title="Add New Account"> <apex:inputField value="{!acc.Name}"/> ...


1

Here a javascript function is written which is performing the task of disabling the inputText. At javascript the "removeAttribute" is enabling your inputtext and ".setAttribute("disabled", true)" is disabling your inputText. Each and every time you need to check and make 1 full set enable and rest 2 full set disable. Here we are identifying the row selected ...


1

the best way to render which values to show on the page is by handling the logic in the controller Visual Force code: <apex:selectRadio value="{!radioSelect}" > <apex:selectOptions value="{!radioSelectList}"/> </apex:selectRadio> apex code: public list<SelectOption> getradioSelectList(){ list<SelectOption> options =...


1

Wrapping it in an output panel may help: <apex:outPutPanel layout="block"> <apex:selectRadio value="{!calculatorViewBasedOnFrequency}" layout="pageDirection"/> <apex:selectList value="{!CONTROLLERPROPERTY}" size="1" multiselect="false"> <apex:selectOptions value="{!calculatorViewBasedOnFrequency.frequencyforDaily}" /> ...


1

You need to replace : <apex:selectRadio> </apex:selectRadio> by : VF page : <apex:selectRadio value="{!e.name}" styleClass="myChk" onclick="changeValue(this)"> </apex:selectRadio> <script type="text/javascript"> function changeValue(radioButton) { var chk = document.getElementsByClassName('myChk'); for ...


1

The selectRadio area is rendered as a table. If you use layout="lineDirection", the elements go across, while if you use layout="pageDirection", they go up and down (the orientation may depend on the user's language). To control the size of the entire area, specify a class or id for the selectRadio, and then set its size: .mySelectRadio { width: 100%: }...


1

I chose an alternate way of making it required through apex code validations on Save, instead of checking it at the visualforce component.


1

Baskaran, You can either use apex:selectOptions element which binds to a List of selectOption or individual apex:selectOption element as child elements of SelectRadio. The page you are referring to has selectOptions in the code sample but if you refer this page, you will see the individual selectOption element being used along with itemValue and itemLabel ...


1

The straight HTML option looks like this: <apex:form id="theTable" > ....other components. <apex:repeat value="{!options}" var="option"> <input id="num_{!option}" name="{!SAPData.CustomerName}" type="radio" /> <label for="num_{!option}" onclick="saveOptionJS({!option})" >{!option}</label> </apex:...


Only top voted, non community-wiki answers of a minimum length are eligible