5 Replies Latest reply on Aug 7, 2008 4:34 AM by ilya_shaikovsky

    Big Problem with Datascroller in IE

    mrnice

      Big Problem with Datascroller in IE


      Hi everybody,


      i have a very strange and difficult problem with IE 6 + 7(this totally works in Firefox)

      Ok, here is my setup:
      Richfaces 3.1.6 + JSF 1.1 (Myfaces) + Java 1.4.2

      The problem is the following:
      I have a Table that has a datascroller, located inside a TabPanel (included with <a4j:include>).

      The problem occurs when:
      1) Open the page for the first time
      2) change to another page in with the datascroller (e.g. 5)
      3) navigate to another page from clicking a table row with t:commandLink
      4) "Browser Back" to table (instead of navigating via breadbcrumb)

      The datascroller resets back to page 1. Also if i click any page in the datascroller, i get navigated to the page i was before.
      This happens until i navigate once with my breadcrumb buttons, from then one everything works fine.


      Now i also got some code for you!!


      Here is the tabPanel:

       <rich:tabPanel tabClass="sksTab" inactiveTabClass="sksInactiveTab"
       styleClass="tabPanelTable" activeTabClass="sksActiveTab"
       selectedTab="#{mySksManagerBean.selectedTab}" headerSpacing="3px" switchType="server">
       <rich:tab id="tabSuchauftraege" label="#{bundle.mysks_tabSuchen}"
       rendered="#{moduleManager.moduleSearchStorageEnabled or moduleManager.moduleFavoritesEnabled}">
       <a4j:include viewId="mysks-searches_fragment.xhtml" />
       </rich:tab>
      


      Here is the table Page
      <rich:datascroller id="scrollerEstatesTop" align="left"
       for="tradesObjectsTable" styleClass="immoResultScroller"
       tableStyleClass="immoResultScrollerTable" ajaxSingle="true"
       reRender="scrollerEstatesBottom" binding="#{mySksEstatesBean.estatesDatascroller}">
       </rich:datascroller>
       <rich:dataTable id="tradesObjectsTable"
       value="#{mySksEstatesBean.tradesObjectsList}" var="tradesObject"
       binding="#{mySksEstatesBean.tradesObjectsTable}"
       styleClass="immotabelle" headerClass="immoheader"
       footerClass="immoheader" columnClasses="immocell" rows="15">
      
       <rich:column colspan="2" styleClass="immoheadline">
      
       <h2><t:commandLink
       value="#{tradesObject.innerElement.objectDescription}"
       action="#{mySksEstatesBean.openTradesObject}" /></h2>
       <a4j:commandLink
       value="test"
       action="#{mySksEstatesBean.openTradesObject}" />
       </rich:column>
      



      Thanks a lot !!!


        • 1. Re: Big Problem with Datascroller in IE
          mrnice

          btw. if i (after step 4), hit the refresh Button (F5) i am navigated to the proper page in the table ...

          IE really makes me sooo mad :(

          • 2. Re: Big Problem with Datascroller in IE
            mrnice

            any ideas?

            • 3. Re: Big Problem with Datascroller in IE
              rbellia

              I've found exactly the same problem with datascroller.
              IE 7 resets to first page after browsing back to datatable page.
              I'm using richface 3.2.0 GA and JBoss Seam 1.2.
              - IE 7.0.5730.13
              - FireFox 2.0.0.16 works fine

              • 4. Re: Big Problem with Datascroller in IE
                mrnice

                good news for you ... i solved the problem.

                The Problem in this case is bad cahce handling in internet explorer, my solution for this was disabling the cache for the whole website, therfeor i created a phaselistener which does the job

                ublic class CacheControlPhaseListener implements PhaseListener
                {
                 private static final long serialVersionUID = 1L;
                
                 public PhaseId getPhaseId()
                 {
                 return PhaseId.RENDER_RESPONSE;
                 }
                
                 public void afterPhase(PhaseEvent event)
                 {
                 }
                
                 public void beforePhase(PhaseEvent event)
                 {
                 FacesContext facesContext = event.getFacesContext();
                 HttpServletResponse response = (HttpServletResponse) facesContext.getExternalContext().getResponse();
                
                 response.addHeader("Pragma", "no-cache");
                 response.addHeader("Cache-Control", "no-cache");
                 response.setHeader("Cache-Control", "no-store");
                 response.addHeader("Cache-Control", "must-revalidate");
                 }
                }
                



                This should help

                • 5. Re: Big Problem with Datascroller in IE
                  ilya_shaikovsky

                  it's also should works as is under 3.2.x branch