+ Start a Discussion
SivaGSivaG 

dynamic display of 2 Pageblocksectionitems in visualforce page

Hi,

I have added 2 pageblocksectionitems in a visualforce page. But I want to display those based on a field value. How can I accomplish this?

Code snippet -
<apex:pageBlockSectionItem id="emvQn">
                    <apex:outputPanel id="emvQSpan">
                        <apex:outputLabel style="color:red">*</apex:outputLabel>
                        <apex:outputLabel value="If you have a non-EMV"/><br/> 
                        <apex:outputLabel value="compliant card reader, would" /><br/>
                         <apex:outputLabel value="you like to purchase an"/><br/>
                         <apex:outputLabel value="EMV-compliant card reader:" />
                    </apex:outputPanel>
                    <apex:outputPanel id="emvQOSpan">
                        <apex:selectList Value="{!ReaderOption}" id="ReaderOptionsId" onchange="Readerdef('select');" size="1" style="width:250px" onkeypress="handleKeyPressSearch(event);">
                            <apex:selectOption itemValue="None" itemLabel="--None--" />
                            <apex:selectOption itemValue="Yes" itemLabel="Yes"/>                            
                            <apex:selectOption itemValue="No" itemLabel="No" />
                        </apex:selectList>                        
                    </apex:outputPanel>
                </apex:pageBlockSectionItem>
                
               <apex:pageBlockSectionItem id="emvOpn">                
                    <apex:outputPanel id="emvOpnSpan">
                      <apex:outputLabel style="color:red">*</apex:outputLabel>                        
                      <apex:outputLabel value="Reader Type:"/>
                    </apex:outputPanel>
                    <apex:outputPanel id="emvReadSpan">
                      <apex:selectList Value="{!NewSRSMPODLead.Reader_Type__c}" id="ReaderTypeId" size="1" style="width:250px" onkeypress="handleKeyPressSearch(event);">
                            <apex:selectOption itemValue="None" itemLabel="--None--" />
                            <apex:selectOption itemValue="EMV Card Reader" itemLabel="EMV"/>
                            <apex:selectOption itemValue="MSR Card Reader" itemLabel="MSR"/>                            
                            <apex:selectOption itemValue="Not Applicable" itemLabel="No thanks"/>
                      </apex:selectList>                                                
                   </apex:outputPanel>
                </apex:pageBlockSectionItem>

Thanks
Kumar
Best Answer chosen by SivaG
Tejpal KumawatTejpal Kumawat
Hello Kumar,

Place rendered attribute in <apex:pageBlockSectionItem component with  field value condition.like : 
 
<apex:pageBlockSectionItem id="emvQn" rendered="{!field = 'field Value'}">


If this answers your question mark Best Answer it as solution and then hit Like!
 

All Answers

Tejpal KumawatTejpal Kumawat
Hello Kumar,

Place rendered attribute in <apex:pageBlockSectionItem component with  field value condition.like : 
 
<apex:pageBlockSectionItem id="emvQn" rendered="{!field = 'field Value'}">


If this answers your question mark Best Answer it as solution and then hit Like!
 
This was selected as the best answer
SivaGSivaG
Hi Tejpal,

Actually my requirement is these two pageblocksectionitems should be hidden by default when the page loads initially and in the backend they will flip the FEE field value(not displayed on the page) to 5.99 then these 2 pageblocksectionitems should be displayed conditionally(which Ialready handled).

Thanks
Kumar