Here "Risk Assessment" is a Picklist and "Peer Reviewer" is a Lookup field.
<apex:pageBlockSectionItem > <apex:outputLabel value="Risk Assessment"></apex:outputLabel> <apex:actionRegion> <apex:inputField value="{!thisCon.theCase.Risk_Assessment__c}" rendered="{!thisCon.caseRTN ame == 'OD Change'}"> <apex:actionSupport event="onchange" rerender="pr,prr" />
</apex:inputField> </apex:actionRegion> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem > <apex:outputLabel value="Peer Reviewer"></apex:outputLabel> <apex:outputPanel id="pr"> <apex:outputPanel rendered="{!if(thisCon.theCase.Risk_Assessment__c != null,true,false)}"> <apex:inputField value="{!thisCon.theCase.Peer_Reviewer__c}" rendered="{!thisCon.caseRTNam e == 'OD Change'}" required="true"/> </apex:outputPanel> </apex:outputPanel> </apex:pageBlockSectionItem>
This is another way:-
<apex:actionRegion > <apex:inputField value="{!thisCon.theCase.Risk_Assessment__c}" required="true" rendered="{! thisCon.caseRTName == 'OD Change'}"> <apex:actionSupport event="onchange" rerender="pr,rp" /> </apex:inputField> </apex:actionRegion> <apex:pageBlockSectionItem > <apex:outputPanel id="rp" > <apex:outputText value="Risk Assessment" rendered="{!if(thisCon.theCase.Risk_Assessment__c != null,true,false)}"/> </apex:outputPanel> <apex:outputPanel id="pr"> <apex:outputPanel rendered="{!if(thisCon.theCase.Risk_Assessment__c != null,true,false)}"> <apex:inputField value="{!thisCon.theCase.Peer_Reviewer__c}" rendered="{!thisCon.caseRTNam e == 'OD Change'}" /> </apex:outputPanel> </apex:outputPanel> </apex:pageBlockSectionItem>