• Ryley Oroku 10
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies
Hi all,

I seem to be having a problem with <apex:form>. When I run my visualforce page without out it, my page has no problem loading. However, when I add that tag, it get the view state limit reached error message. Even just putting <apex:form></apex:form> with nothing in between causes the error. Here is my code. 
<apex:page controller="VisitReportPrototypeController">
  <apex:pageBlock>
    <apex:form>
      <apex:outputText value="Select a term: "/>
      <apex:selectList value="{!selectedTermNumber}" multiselect="false" size="1">
        <apex:selectOptions value="{!termOptions}"/>
      </apex:selectList>
    </apex:form>
    <apex:pageBlockTable value="{!group1Rows}" var="row">
      <apex:column value="{!group1[row]}" headerValue="Totals" style="width:150px"/>
      <apex:column value="{!total[row]}" style="width:150px"/>
      <apex:column value="{!totalsFirstYear[row]}" style="width:150px"/>
      <apex:column value="{!totalsTransfer[row]}" style="width:150px"/>
    </apex:pageBlockTable>
    <br />
    <apex:pageBlockTable value="{!group1Rows}" var="row">
      <apex:column value="{!group1[row]}" headerValue="Visited" style="width:150px"/>
      <apex:column value="{!visited[row]}" style="width:150px"/>
      <apex:column value="{!visitedFirstYear[row]}" style="width:150px"/>
      <apex:column value="{!visitedTransfer[row]}" style="width:150px"/>
    </apex:pageBlockTable>
    <br />
    <apex:pageBlockTable value="{!group1Rows}" var="row">
      <apex:column value="{!group1[row]}" headerValue="Not Visited" style="width:150px"/>
      <apex:column value="{!didNotVisit[row]}" style="width:150px"/>
      <apex:column value="{!notVisitedFirstYear[row]}" style="width:150px"/>
      <apex:column value="{!notVisitedTransfer[row]}" style="width:150px"/>
    </apex:pageBlockTable>
    <br />
    <apex:pageBlockTable value="{!group2Rows}" var="row">
      <apex:column value="{!group2[row]}" headerValue="Summary" style="width:150px"/>
      <apex:column value="{!summaryVisited[row]}" style="width:150px"/>
      <apex:column value="{!outOf[row]}" style="width:150px"/>
      <apex:column value="{!percentage[row]}" style="width:150px"/>
    </apex:pageBlockTable>
  </apex:pageBlock>
</apex:page>
User-added image
Also, you can see that the viewstate size is way under the limit. Could anyone tell me why I might be getting this error?
Thanks.
Hi all,

I seem to be having a problem with <apex:form>. When I run my visualforce page without out it, my page has no problem loading. However, when I add that tag, it get the view state limit reached error message. Even just putting <apex:form></apex:form> with nothing in between causes the error. Here is my code. 
<apex:page controller="VisitReportPrototypeController">
  <apex:pageBlock>
    <apex:form>
      <apex:outputText value="Select a term: "/>
      <apex:selectList value="{!selectedTermNumber}" multiselect="false" size="1">
        <apex:selectOptions value="{!termOptions}"/>
      </apex:selectList>
    </apex:form>
    <apex:pageBlockTable value="{!group1Rows}" var="row">
      <apex:column value="{!group1[row]}" headerValue="Totals" style="width:150px"/>
      <apex:column value="{!total[row]}" style="width:150px"/>
      <apex:column value="{!totalsFirstYear[row]}" style="width:150px"/>
      <apex:column value="{!totalsTransfer[row]}" style="width:150px"/>
    </apex:pageBlockTable>
    <br />
    <apex:pageBlockTable value="{!group1Rows}" var="row">
      <apex:column value="{!group1[row]}" headerValue="Visited" style="width:150px"/>
      <apex:column value="{!visited[row]}" style="width:150px"/>
      <apex:column value="{!visitedFirstYear[row]}" style="width:150px"/>
      <apex:column value="{!visitedTransfer[row]}" style="width:150px"/>
    </apex:pageBlockTable>
    <br />
    <apex:pageBlockTable value="{!group1Rows}" var="row">
      <apex:column value="{!group1[row]}" headerValue="Not Visited" style="width:150px"/>
      <apex:column value="{!didNotVisit[row]}" style="width:150px"/>
      <apex:column value="{!notVisitedFirstYear[row]}" style="width:150px"/>
      <apex:column value="{!notVisitedTransfer[row]}" style="width:150px"/>
    </apex:pageBlockTable>
    <br />
    <apex:pageBlockTable value="{!group2Rows}" var="row">
      <apex:column value="{!group2[row]}" headerValue="Summary" style="width:150px"/>
      <apex:column value="{!summaryVisited[row]}" style="width:150px"/>
      <apex:column value="{!outOf[row]}" style="width:150px"/>
      <apex:column value="{!percentage[row]}" style="width:150px"/>
    </apex:pageBlockTable>
  </apex:pageBlock>
</apex:page>
User-added image
Also, you can see that the viewstate size is way under the limit. Could anyone tell me why I might be getting this error?
Thanks.