1

When i used value attribute in selectRadio as below, i got an error such as

Invalid selectOptions found. Use SelectOption type in Apex.

But it works with itemValue instead. Any suggestions please.

                    <apex:selectRadio value="{!SAPData.SAPSFDCKey2}" rendered="{!if(!SAPData.GSSRecomm,true,false)}" onClick="shouldDisableRadio(this,'{!SAPData.GSSCnt}');">
                        <apex:selectOption Value="{!SAPData.SAPSFDCKey2}"/>
                    </apex:selectRadio>

I have referred the documentation and does not find any notes on itemValue attribute which when used does not throw any error.

  1. What is the difference between the attribute value and itemValue in selectRadio?

  2. Is itemValue old and that is the reason the documentation does not contain any notes on it?

UPDATE:

The below screen shot shows multiple radios selected. I fixed that issue now. Now, if i select a radio from each group for example, a radio from University of Arizona and a radio from Grand Hotels and Resorts Ltd and so on, i need to check which radio has been selected. Still now, i am not able to get which radios have been selected.

enter image description here

  • what is the type of SAPData.SAPSFDCKey2 field / variable ? – Vamsi Krishna Aug 3 '14 at 7:19
  • Thanks @VamsiKrishna. the issue is i am trying to check the radio buttons which has been selected and get the value of them inside of the controller. Please see the updated post. – Bforce Aug 3 '14 at 7:28
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 attributes

in your code, you are using individual selectOption element and binding it to SAPData.SAPSFDCKey2 which i don't think is of type selectOption or selectItem. if so you need to use itemValue attribute.

0

value will contain list of SelectOption like List and value will contain String property define in controller. I would say please again refer the document that you are referring you will get the clear idea.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.