function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Rerender rerender part of page but then whole page is refeshed

Im using a controller extension to account for this page. However, what happens when you click Go! is that first the list of accounts is rerendered and after a second or so, the hole page is refreshed.
In the real program that wipes out data created in other sections by JS.
I would expect only the portion mentioned in the rerender to be refreshed.
Looks like onclick event is the culprit. Changing the page so that the rerender is triggered onchange on the select list, works as expected. Still, I want my onclick for other purposes
Any ideas?

<apex:page standardController="Account" recordSetvar="accounts"


<script src="{!mapkey}" type="text/javascript"></script>

<script src="{!mapkey}" type="text/javascript" ></script>

<apex:form >

<apex:pageBlock >

  <apex:pageBlockSection title="Select Account List" columns="1" collapsible="false">

    <apex:outputPanel > Select an account list view to map :

      <apex:selectList value="{!filterId}" size="1">

        <apex:selectOptions value="{!listviewoptions}" />


      <apex:commandButton value="Go!" >

      <apex:actionSupport event="onclick" reRender="accTable" status="accStatus" />


      <apex:actionStatus id="accStatus" startText="(incrementing...)" stopText="(done)"/>



  <apex:pageBlockSection >

    <apex:dataTable value="{!accounts}" var="a" id="accTable" rows="3">

      <apex:column value="{!}" rendered="false"/>

      <apex:column value="{!}" rendered="true"/>






Message Edited by PerGeert on 11-22-2008 06:19 PM

Message Edited by PerGeert on 11-22-2008 07:50 PM

I think you'll find that the 'actionSupport' tag is rerendering the list, then the commandButton is refreshing the page (both asking for the same data), so if you move the rerender and status bits from the actionSupport tag into the commandButton tag, then remove the actionSupport tag, it should work ok.

<apex:commandButton value="Go!" rerender="accTable" status="accStatus" />     
<apex:actionStatus id="accStatus" startText="(incrementing...)" stopText="(done)"/> 


Thanks, that was the problem.