On visualforce page I have a selectlist. If A, B , or C is selected. I want to show the second pageBlockSectionItem. If it's not one of those values I want to show the first pageBlockSectionItem section.
The problem I am having is when I select A the second pageblockSectionItem shows, but it doesn't show if I select B or C.
I would like the second pageblockSectionItem section to show also if A, B or C is selected It seems to only work correctly if A is selected only.
VisualForce
<apex:actionFunction name="manageType2" action="{!manageType}"
rerender="pbSecCharges" status="typeStatus" immediate="true">
<apex:param name="dealType" value="" assignTo{!SelectedType}"/>
</apex:actionFunction>
<apex:selectList value="{!Opty.Deal_Rent__c}" required="true"
id="ddlRentType" onchange="manageType(this);" size="1" >
<apex:selectoption itemLabel="A" itemValue="A"></apex:selectoption>
<apex:selectoption itemLabel="B" itemValue="B"></apex:selectoption>
<apex:selectoption itemLabel="C" itemValue="C"></apex:selectoption>
<apex:selectoption itemLabel="D" itemValue="D"></apex:selectoption>
</apex:selectList>
<apex:pageBlockSectionItem rendered="{!Show}" id="itemRealEstate">
<apex:inputField value="{!Opty.Permanent_Tax__c}" id="txtRealEstate"
required="true" />
<apex:inputField value="{!Opty.Permanent_Tax_Notes__c}"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem rendered="{!!Show}">
<apex:outputLabel value="$0.00"/>
<apex:inputField value="{!Opty.Permanent_Tax_Notes__c}"/>
</apex:pageBlockSectionItem>
Apex Class
public class RentExtension{
public string SelectedType {get;set;}
public Boolean Show {get;set;}
public void manageType() {
Show = show(SelectedType);
}
private static boolean show(string dealType) {
boolean show = false;
if(dealType != null){
show = (dealType != Utility.DEAL_A || dealType != Utility.DEAL_B
||dealType != Utility.DEAL_C);
}
return show;
}