function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Bakul Patel 9Bakul Patel 9 

apex:selectOption rendered not working

I think there is surely something missing in specification regarding following issue. I have a selectList and selectOption specified in page. Certain options are to be shown only in specific condition. I have specified that condition in rendered, but it does not work:
 
{!er.entry.Type__c='OD'}
                	<apex:selectList id="actionsList" multiselect="false" size="1"  value="{!er.action}"  >
                		<apex:selectOption itemValue="--None--" itemLabel="--None--" />  
                		<apex:selectOption itemValue="Edit" itemLabel="Edit" />
                		<apex:selectOption itemValue="Delete" itemLabel="Delete" />
                		<apex:selectOption itemValue="VAT+" itemLabel="VAT+" rendered="{!er.entry.Type__c='OD'}"/>  
                		<apex:selectOption itemValue="VAT-" itemLabel="VAT-" rendered="{!er.entry.Type__c='OD'}"/>
                		<apex:selectOption itemValue="RTB" itemLabel="RTB" rendered="{!er.entry.Type__c='OD'}" />
                		<apex:selectOption itemValue="Invoice+" itemLabel="Invoice+" rendered="{!er.entry.Type__c='OD'}"/> 
                		<apex:selectOption itemValue="VI" itemLabel="VI" rendered="{!er.entry.Type__c='OD'}"/> 
                		<apex:actionSupport event="onchange" action="{!takeAction}" reRender="masterPanel" status="statusSplash">
                			<apex:param value="{!er.entry.id}" name="EntryToUpdate"/>
                		</apex:actionSupport>
                	</apex:selectList>

This produces the view:
Produced list

Check the true/false written above dropdown, which is products from 1st line in code.

So, despite the condition returns true, respective options are not rendered.

Thanks,
Bakul Patel
VineetKumarVineetKumar
Just try replacing the rendered condition with a boolean true and false, to check of they are actually appearing or not
Waqar Hussain SFWaqar Hussain SF
Did you find any solution for that? I am also facing same issue.
Any help would be appriciated.

Thanks
Bakul Patel 24Bakul Patel 24
Unfortunately not. But you can have multilpe selectList elements and put rendered on them and have the hardcoded options for each scenario.
If your problem is solved, please accept the answer.
Waqar Hussain SFWaqar Hussain SF
Basically I need to put options based on another picklist field, So I used rendered condition on apex:selectionOption which work fine for some options but not working for 3-4 selectoptions.

I tested and verified that criteria and criteria is fine but still not rendering.