Let's say I want to conditional rendering of outputPanel markup
<apex:page controller="SOQLBC">
<apex:outputPanel id="sobj" rendered="{!LEN(sObj)>0}">
<span> --- {!sObj} --- </span>
</apex:outputPanel>
<apex:form>
-- {!LEN(sObj)>0} --
<apex:selectList value="{!sObj}" size="1">
<apex:selectOptions value="{!sObjList}"/>
<apex:actionSupport event="onchange" reRender="sobj"/>
</apex:selectList>
</apex:form>
controller
public with sharing class SOQLBC {
public SOQLBC() {
sObj = '';
}
public string sObj {get; set;}
public List<System.SelectOption> getsObjList() {
List<System.SelectOption> options = new List<System.SelectOption>();
options.add(new SelectOption('', '-- Select SObject --'));
for(Schema.EntityDefinition entity : SchAccess.getsObjectsLite()) {
options.add(new SelectOption(entity.qualifiedapiname, entity.label));
}
return options;
}
}
I want to show updatePanel only if sObj does not equal '' but I can't reach my goal - updatePanel is always hided
<apex:outputPanel id="sobj">
<apex:outputPanel rendered="{!LEN(sObj)>0}">
<span > --- {!sObj} --- </span>
</apex:outputPanel>
</apex:outputPanel>
helped me