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

Viewstate not maintained in Internet Explorer



I am calling a controller function using apex:commandlink


<apex:commandLink action="{!Next}" rendered="true" reRender="CustomList">{!showNext}</apex:commandLink>


When using Firefox browser function call is working properly, but with IE control again goes to <init> and next() function is not called.


Also, the viewstate is not maintained when using IE. Crippled around this for many days,  can somebody please advice.


Thank in advance.




Best Answer chosen by Admin (Salesforce Developers) 
Move your apex:detail outside of your form tags. I think I've actually run into this before.

All Answers


Can you post more of the page and controller?


Without seeing more of your code, my first guess is that IE is not handling the ajax rerender properly. Make sure the id referenced in the rerender attribute actually exists, and that the case is correct. If {!Next} is a pageReference method, make sure you're not setting "setRedirect = true".




Thanks for the reply but i have rechecked the code and i am unable to identify the reason;


Visualforce code looks like:


<apex:page standardController="Account" extensions="relatedCampaignHistory">
<apex:form >
 <apex:detail relatedList="true" relatedListHover="true"></apex:detail>
  <apex:pageblock id="CustomList" title="Campaign History">
    <apex:pageBlockTable id="CampaignHistoryTable" value="{!cmph}" var="c" rendered="{!NOT(ISNULL(cmph))}" rows="{!hiddenField}">
      <apex:column headerValue="Action">
      <apex:outputLink value="/{!}" id="editLink"><b>Manage</b></apex:outputLink>
        <apex:column id="CampaignName" headerValue="Campaign Name" value="{!c.CampaignId}"/>
        <apex:column id="ContactName" headerValue="Contact Name" value="{!c.contactId}"></apex:column>
        <apex:column id="MemberStatusUpdated" headervalue="Member Status Updated" value="{!c.LastModifiedDate}" />
     <apex:outputLabel value="No records to display" rendered="{!(ISNULL(cmph))}"></apex:outputLabel>
    <apex:commandLink id="CommandLink" action="{!Next}" rendered="true" reRender="CustomList">{!showNext}</apex:commandLink>


There is a single command link and i am rerendering the 'CustomList' page block. Then also it is not wroking. {!Next} method is only and computation function wherein no pageReference object is used.


Could you please suggest why the code is not working in IE.  Its working completely fine with Firefox.


Thanks in advance.


Move your apex:detail outside of your form tags. I think I've actually run into this before.
This was selected as the best answer

Fantastic..... Thank you very much. Just could you please explain the reason why it behaved like that in Internet explorer.


Thanks once again

Having the apex detail there creates nested form tags and probably throws a wrench into the way ajax sees element id's. Mozilla & webkit browsers handle it gracefully and ie doesn't.