title: Salesforce (Visualforce): Rerender - pull values from page, not the record?
body: <p>I'm stuck on my rendered argument here - I'm fairly positive i'm pulling values from the record itself and not from the visualforce page. When I change the value (are_you_kp__c) from the record to a "No" - the pageblocksection shoud render, but for some reason it doesn't. Does anybody know why?</p>
  
  <p>I think I need some controller work here - but not sure where to go from here...</p>
  
  <pre><code>&lt;apex:pageBlock title="New Bid" mode="maindetail" tabStyle="Proposal__c"&gt;
      &lt;apex:messages/&gt;
      &lt;apex:actionRegion&gt;
      &lt;apex:pageBlockSection columns="2" title="Bid Information" collapsible="false" showHeader="true"&gt;
          &lt;apex:inputField value="{!rfp.Bid_Amount__c}"/&gt;
          &lt;apex:outputField value="{!rfp.Bid_Date__c}"/&gt;
          &lt;apex:inputField value="{!rfp.Bid_Deliver_By__c}"/&gt;
          &lt;apex:inputField value="{!rfp.Bid_Comments__c}"/&gt;
          &lt;apex:pageBlockSectionItem&gt;
                 &lt;apex:outputLabel value="Are you the Key Appraiser?"/&gt;
                 &lt;apex:outputPanel&gt;             
                     &lt;apex:inputField value="{!rfp.are_you_kp__c}" required="true"&gt;
                         &lt;apex:actionSupport status="StatusChange" event="onchange" rerender="PageErrors, appraiserInfo"/&gt;
                         &lt;apex:actionStatus startText="Updating page ..." id="StatusChange"/&gt;
                     &lt;/apex:inputField&gt;  
                 &lt;/apex:outputPanel&gt;
          &lt;/apex:pageBlockSectionItem&gt; 
      &lt;/apex:pageBlockSection&gt;
      &lt;/apex:actionRegion&gt;
      &lt;apex:pageBlockSection title="Testing" columns="2" rendered="{!rfp.are_you_kp__c == 'No'}" id="appraiserInfo"&gt;
          &lt;apex:pageBlockSectionItem&gt;
              &lt;apex:outputLabel value="Single Point of Contact" for="spoc"/&gt;
                  &lt;apex:selectList id="spoc" value="{!rfp.SPOCL__c}" size="1" title="Single Point of Contact Select"&gt;
                      &lt;apex:selectOptions value="{!SPOCS}"&gt;&lt;/apex:selectOptions&gt;
                  &lt;/apex:selectList&gt;
          &lt;/apex:pageBlockSectionItem&gt;
      &lt;/apex:pageBlockSection&gt;
  &lt;/apex:pageBlock&gt;
  </code></pre>
  
  <p>Updated - wrapped the to be rendered element in outputPanel with correct id: Still have the problem of toggling my rendered boolean as a result of a change on an inputField - how would I toggle this in the controller? I think i need to evaluate if the inputField value = No, and set the rendered to true by that - i'm not sure how though...</p>
  
  <pre><code>&lt;apex:outputPanel id="appraiserInfo"&gt;
  &lt;apex:pageBlockSection title="Testing" columns="2" rendered="{!rfp.are_you_kp__c == 'No'}"&gt;
      &lt;apex:pageBlockSectionItem&gt;
          &lt;apex:outputLabel value="Single Point of Contact" for="spoc"/&gt;
              &lt;apex:selectList id="spoc" value="{!rfp.SPOCL__c}" size="1" title="Single Point of Contact Select"&gt;
              &lt;apex:selectOptions value="{!SPOCS}"&gt;&lt;/apex:selectOptions&gt;
              &lt;/apex:selectList&gt;
      &lt;/apex:pageBlockSectionItem&gt;
  &lt;/apex:pageBlockSection&gt;&lt;/apex:outputPanel&gt;
  </code></pre>
  
  <p>Alright one more attempt - this time it works, but I don't quite get why...only that it does. This is in addition to adding action="{!updateAnswer}" to the actionSupport above (or below, whichever way you see it)</p>
  
  <pre><code>    public pageReference updateAnswer(){
         if(this.p.are_you_kp__c == 'No')
         rfp.are_you_kp__c = 'No';
         try{
          update rfp;
            }
          catch (DmlException ex){
              ApexPages.addMessages(ex);
              return null;
         }
         return null;
      }
  </code></pre>
  
  <p>Probably relevant controller code</p>
  
  <pre><code>public ProposalExtension(ApexPages.StandardController pCon) {
      this.p = (Proposal__c)pCon.getRecord();
  }
  </code></pre>