+ Start a Discussion
aadit_13aadit_13 

Viewstate not maintained in Internet Explorer

Hi,

 

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.

 

Aditya

 

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

All Answers

Duncan_IdahoDuncan_Idaho

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".

aadit_13aadit_13

Hi,

 

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="/{!c.id}" id="editLink"><b>Manage</b></apex:outputLink>
      </apex:column>
        <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:pageBlockTable>
     <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>
   </apex:pageblock>
 </apex:form>
</apex:page>

 

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.

Aditya

Duncan_IdahoDuncan_Idaho
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
aadit_13aadit_13

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

 

Thanks once again

Duncan_IdahoDuncan_Idaho
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.