I'm trying to set up some visualforce input and output to display if a select list is sent to a certain value. I've got my select list set to rerender the entire panelgrid on change and the inputs and outputs set to render if the selectlist value == "yes". I have had success with similar rendering in the past but can't get this to work.
Here are some samples of my code:
Controller setting the select list and a string to hold the value:
public class createContact {
public string createOrg {get;set;}
public List<selectOption createOrgList {get {
List<selectOption orgOptions = new List<selectOption ();
orgOptions.add(new selectOption('Yes', 'Yes'));
orgOptions.add(new selectOption('No', 'No'));
return orgOptions;
}
private set;
}
}
panelGrid with select list and two fields dependent on rendering:
<apex:panelGrid columns="2" cellpadding="2" columnClasses="colleft, colright" id="AccountCheck"/>
<apex:outputLabel value="Create New Organization?" for="createNewOrg" />
<apex:selectList id="createNewOrg" value="{!createOrg}" size="1">
<apex:selectOptions value="{!createOrgList}"/>
<apex:actionSupport event="onchange" rerender="AccountCheck"/>
</apex:selectList>
<apex:outputLabel value="Organization Name - Required" for="Name" rendered="{!IF(createOrg == 'Yes',true,false)}" />
<apex:inputText id="Name" value="{!strAccountName}" rendered="{!IF(createOrg == 'Yes',true,false)}"/>
The fields aren't showing up at all, any advice?