• maha123
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 4
    Replies

Hello

I hope that someone can help me with my code

first, I have a vf page. In this page, there are sections that supposed to be hidden/shown according to the value of a multi-picklist. The standardController "Client Session Record" is a custome object

 

<apex:page standardController="Client_Session_Record__c">

  <apex:sectionHeader title="New client Session Record"
                      subtitle="{!Client_Session_Record__c.name}"/>
  <apex:form >
    
    <apex:pageBlock title="Client Session Record Edit" id="thePageBlock" mode="edit">
      <apex:pageMessages />
 
          <!--the buttons block  -->
          <apex:pageBlockButtons >
            <apex:commandButton value="Save" action="{!save}"/>
            <apex:commandButton value="Cancel" action="{!cancel}"/>
          </apex:pageBlockButtons>
          <!--end of buttons block -->  

      <apex:actionRegion >
        <!--Section 1 -->   
        <apex:pageBlockSection title="Information" columns="2">
            

                  <apex:inputField value="{!Client_Session_Record__c.name}"/>
                  
                  <apex:pageBlockSection >
                      <apex:pageBlockSectionItem >

                      </apex:pageBlockSectionItem>

                      <!-- empty selectItem-->
                      <apex:pageBlockSectionItem />
                  </apex:pageBlockSection>
                  
                  
                  <apex:inputField value="{!Client_Session_Record__c.Date_of_visit__c}"/>
                  <apex:inputField value="{!Client_Session_Record__c.Advisor__c}"/>              
                  <apex:inputField value="{!Client_Session_Record__c.Client__c}"/>
                  <apex:inputField value="{!Client_Session_Record__c.X2nd_Advisor__c}"/>
                 
                  <!-- the condition -->
                  <apex:pageBlockSectionItem >              
                      <apex:outputLabel value="Session Type"/> 
                      <apex:outputPanel > 
                          <apex:inputField value="{!Client_Session_Record__c.Session_Type__c}">
                               <apex:actionSupport event="onchange"
                                            reRender="Section2, Section4"
                                            immediate="true"
                                            
                                            status="status"/>
                          </apex:inputField>
                          <apex:actionStatus startText="Updating the value..."
                                         id="status"/>
                      </apex:outputPanel> 
                  </apex:pageBlockSectionItem>
                  <!-- end of condition -->
                  <apex:inputField value="{!Client_Session_Record__c.Next_Review_Date__c}"/>
                  <apex:inputField value="{!Client_Session_Record__c.Location__c}"/>
                  
                          
        </apex:pageBlockSection>
        <!--Section 1 -->     
        
      </apex:actionRegion>
      

    <!--Section 2 -->  
          
      <apex:pageBlockSection title="Initial" id="Section2"
            columns="2" collapsible="true"  
            Rendered="{!if(Client_Session_Record__c.Session_Type__c=='Initial Assessment',true,false) }"  > 
                     
                     <apex:inputField value="{!Client_Session_Record__c.Recommended_AT__c}"
                         required="true" />  
                         
      </apex:pageBlockSection> 
       
    <!--Section 2 -->       
       
    </apex:pageBlock>
  </apex:form>
</apex:page>

 My problem is that , it didn't work!

 

Hello

I hope that someone can help me with my code

first, I have a vf page. In this page, there are sections that supposed to be hidden/shown according to the value of a multi-picklist. The standardController "Client Session Record" is a custome object

 

<apex:page standardController="Client_Session_Record__c">

  <apex:sectionHeader title="New client Session Record"
                      subtitle="{!Client_Session_Record__c.name}"/>
  <apex:form >
    
    <apex:pageBlock title="Client Session Record Edit" id="thePageBlock" mode="edit">
      <apex:pageMessages />
 
          <!--the buttons block  -->
          <apex:pageBlockButtons >
            <apex:commandButton value="Save" action="{!save}"/>
            <apex:commandButton value="Cancel" action="{!cancel}"/>
          </apex:pageBlockButtons>
          <!--end of buttons block -->  

      <apex:actionRegion >
        <!--Section 1 -->   
        <apex:pageBlockSection title="Information" columns="2">
            

                  <apex:inputField value="{!Client_Session_Record__c.name}"/>
                  
                  <apex:pageBlockSection >
                      <apex:pageBlockSectionItem >

                      </apex:pageBlockSectionItem>

                      <!-- empty selectItem-->
                      <apex:pageBlockSectionItem />
                  </apex:pageBlockSection>
                  
                  
                  <apex:inputField value="{!Client_Session_Record__c.Date_of_visit__c}"/>
                  <apex:inputField value="{!Client_Session_Record__c.Advisor__c}"/>              
                  <apex:inputField value="{!Client_Session_Record__c.Client__c}"/>
                  <apex:inputField value="{!Client_Session_Record__c.X2nd_Advisor__c}"/>
                 
                  <!-- the condition -->
                  <apex:pageBlockSectionItem >              
                      <apex:outputLabel value="Session Type"/> 
                      <apex:outputPanel > 
                          <apex:inputField value="{!Client_Session_Record__c.Session_Type__c}">
                               <apex:actionSupport event="onchange"
                                            reRender="Section2, Section4"
                                            immediate="true"
                                            
                                            status="status"/>
                          </apex:inputField>
                          <apex:actionStatus startText="Updating the value..."
                                         id="status"/>
                      </apex:outputPanel> 
                  </apex:pageBlockSectionItem>
                  <!-- end of condition -->
                  <apex:inputField value="{!Client_Session_Record__c.Next_Review_Date__c}"/>
                  <apex:inputField value="{!Client_Session_Record__c.Location__c}"/>
                  
                          
        </apex:pageBlockSection>
        <!--Section 1 -->     
        
      </apex:actionRegion>
      

    <!--Section 2 -->  
          
      <apex:pageBlockSection title="Initial" id="Section2"
            columns="2" collapsible="true"  
            Rendered="{!if(Client_Session_Record__c.Session_Type__c=='Initial Assessment',true,false) }"  > 
                     
                     <apex:inputField value="{!Client_Session_Record__c.Recommended_AT__c}"
                         required="true" />  
                         
      </apex:pageBlockSection> 
       
    <!--Section 2 -->       
       
    </apex:pageBlock>
  </apex:form>
</apex:page>

 My problem is that , it didn't work!