+ Start a Discussion
StaciStaci 

rerenderd field not editable

I have a field that when the radio button is yes, the field appears and needs to be filled in.  I have the title appearing, but the box to fill it in is not showing up.  What am I missing?  I'm just posting the snippet of the rerender and the field that needs to be filled in. User-added image
 
<apex:actionRegion >           
              <apex:selectRadio value="{!selectedOption}">
            
            <apex:selectOption itemValue="Yes" itemLabel="Yes" />
            <apex:selectOption itemValue="No" itemLabel="No" />
            <apex:actionSupport event="onchange" rerender="form" />
        </apex:selectRadio>
        </apex:actionRegion>
               
                            
                                                    
                <apex:panelGrid id="xxx" rendered="{!IF(selectedOption='Yes',True,False)}">
                    <apex:facet name="header">Date</apex:facet>
                    <apex:inputfield value="{!e1.asset.Date__c}" style="width:95px" required="true"/>
                </apex:panelGrid>

 
PriyaPriya (Salesforce Developers) 
Hi,

It will display fields based only on the radio button selected.
Say there are 2 radio buttons and two Text fields if radiobutton1 is selected it must show field1  and radiobutton2 is selected it must show field2.
How to achieve this scenario in the lightning component.

here is the sample code for it :
<aura:component>
    <aura:attribute name="options" type="List" default="[
         {'label': 'apples', 'value': 'apples'},
         {'label': 'oranges', 'value': 'oranges'}
    ]"/>
    <aura:attribute name="radioValue" type="String" default="apples"/>
    
    <lightning:radioGroup 
        aura:id="mygroup"
        name="radioButtonGroup"
        label="Radio Button Group"
        options="{! v.options }"
        value="{! v.radioValue }"
        
         />
    
   <aura:if isTrue="{!v.radioValue == 'apples'}">
      <lightning:input label="Apples" name="apple" />
   <aura:set attribute="else">
        <lightning:input label="oranges" name="oranges" /> 
   </aura:set>
        
    </aura:if> 
    
</aura:component>


Thanks
let us know if it helps you by marking it as best answer.
StaciStaci
@priya

I'm using classic, would this still work if I added it in classic?