You need to sign in to do that
Don't have an account?
Simrin
SelectRadio not working properly with actionListener
Hello,
I am calling action Function from selectRadio but it is not getting caled.
It works perfectly if i replace selectRadio with selectList.
Why the behaviour is difference for Radio button.
I am calling action Function from selectRadio but it is not getting caled.
It works perfectly if i replace selectRadio with selectList.
Why the behaviour is difference for Radio button.
<script type="text/javascript"> function initJSChoice(id1){ initColumn(document.getElementById(id1).value); } </script> <apex:form id="map"> <apex:actionFunction name="initColumn" action="{!matrix}" reRender="map,search"> <apex:param name="param1" value="" /> </apex:actionFunction> <apex:selectRadio value="{!choice}" id="contentForDisplay" onchange="initJSChoice('{!$Component.contentForDisplay}');" > <apex:selectOption itemLabel="a" itemValue="a"/> <apex:selectOption itemLabel="b" itemValue="b"/> <apex:selectOption itemLabel="c" itemValue="c"/> </apex:selectRadio> </apex:form>
What actually you want to pass through param ? If you want to pass the select option value you can get from choice varibale which is already available in your class .
You can try with the code I have posted above and just change the debug statement like below .
System.debug('********************'+choice);
Thnaks
Manoj
All Answers
Try to change the event to onSelect it will help .
I also tried immediate="true" but that didnt work out too
I have tried with a small POC with your code it is working fro me .I have checked the debug log .
Please have a try with below code it is working .
Thanks
Manoj
as the document.getElementById(id1).value is undefined then the actionfuntion is not getting called and hence the controller function not getting called.
What actually you want to pass through param ? If you want to pass the select option value you can get from choice varibale which is already available in your class .
You can try with the code I have posted above and just change the debug statement like below .
System.debug('********************'+choice);
Thnaks
Manoj