0

I came across similar posts but my solution is not working at all. I have to show two options with radio buttons and render different outputpanel for each selection. Code Snippet is below. Initailly ExistingEntity value present hence 'availSection' section is displayed by default. When i click 'Create New Parent Entity' option, the correponding block is rendering.Pbm is when i switch back to 'Select Existing Parent Entities' then i dont see either actionSuport or setter are being invoked. Please advise me how to make it work.

<apex:pageBlockSection id="choice" title="Choice" collapsible="false" columns="1">
 <apex:selectRadio value="{!selectedOption}">
 <apex:selectOption itemValue="ExistingEntity" itemLabel="Select Existing Parent Entities"/>
 <apex:selectOption itemValue="NewEntity" itemLabel="Create New Parent Entity"/>
 <apex:actionSupport event="onchange" reRender="newSection,availSection"/>
 </apex:selectRadio>
 </apex:pageBlockSection>

<apex:outputPanel id="availSection">
<apex:outputPanel id="innerSec">
<apex:pageBlockSection title="Available Records" collapsible="false" columns="1" rendered="{!IF(selectedOption == 'ExistingEntity', true, false)}">
</apex:outputPanel>
</apex:outputPanel>

<apex:outputPanel id="newSection">
 <apex:outputPanel id="newSectionInner">
 <apex:pageBlockSection title="Create New Entity" collapsible="false" columns="2" rendered="{!IF(selectedOption == 'NewEntity', true, false)}">
<apex:outputPanel>
</apex:outputPanel>

Let me know if you need any more details.

  • Can you include your code? Both the VF page and the controller/extension. – Nick Cook Dec 1 '15 at 1:19
  • Page:<apex:pageBlockSection id="choice" title="Choice" collapsible="false" columns="1"> <apex:selectRadio value="{!selectedOption}"> <apex:selectOption itemValue="ExistingEntity" itemLabel=" Existing Entities" itemDisabled="{!IF(showParentEntitieInfo.size == 0, true, false)}"/> <apex:selectOption itemValue="NewEntity" itemLabel="Create New Entity"/> <apex:actionSupport event="onchange" reRender="newSection,availSection"/> </apex:selectRadio> </apex:pageBlockSection> – Bharat Dec 1 '15 at 2:00
  • outputpanel1: <apex:outputPanel id="availSection"> <apex:outputPanel id="innerSec"> <apex:pageBlockSection title="Available Parent Entities" collapsible="false" columns="1" rendered="{!IF(selectedOption == 'ExistingEntity', true, false)}"> </apex:pageBlockSection> </apex:outputPanel> </apex:outputPanel> – Bharat Dec 1 '15 at 2:02
  • Outputpanel2:<apex:outputPanel id="newSection"> <apex:outputPanel id="newSectionInner"> <apex:pageBlockSection title="Create New Entity" collapsible="false" columns="2" rendered="{!IF(selectedOption == 'NewEntity', true, false)}"> <apex:pageBlockSectionItem </apex:pageBlockSection> </apex:outputPanel> </apex:outputPanel> – Bharat Dec 1 '15 at 2:03
  • 2
    Please at least make an effort to help people help you. Can you put your code in the actual question? This is close to impossible to read. – Nick Cook Dec 1 '15 at 2:58

Your Answer

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

Browse other questions tagged or ask your own question.