I have a dynamically generated picklist, which generates fine below:
> public string ConNames {get;set;}
> List<SelectOption> options = new
> List<SelectOption>(); Public list<SelectOption> getAccCons(){
> system.debug('>>> Generating contact list');
> List<Contact> conList = New List<Contact>();
> conList = [SELECT Id, Name FROM Contact WHERE AccountId = :AccId];
> options.add(new SelectOption('--None--','--None--'));
> For (Contact con : ConList){
> options.add(new SelectOption(con.Id,con.Name));
> options.add(new SelectOption('Create New Contact','Create New Contact'));
> }
> return options;}
Which is used in a VF page as below:
<apex:selectList value="{!ConNames}" size="1" label="Select Contact">
<apex:selectOptions value="{!AccCons}"/>
<apex:actionSupport event="onchange" reRender="test"/>
</apex:selectList>
If the select value = 'Create New Contact' I wanted to rerender the outputpanel 'Test'. I'm currently trying to use:
rendered="{!ConNames = 'Create New Contact'}">
But this is always returning false as ConNames is always null, what am I missing? I can see the rerender is working.
selectedContactId
in situations like this.