ICEfaces
  1. ICEfaces
  2. ICE-9261

ace:tree - error on update following back button return

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.3
    • Fix Version/s: EE-3.3.0.GA, 4.0.BETA, 4.0
    • Component/s: ACE-Components
    • Labels:
      None
    • Environment:
      ICEfaces 3, ace:tree, single select mode
    • Assignee Priority:
      P1
    • Workaround Description:
      Hide
      @ManagedBean(eager = true)
      @ApplicationScoped
      public class HeaderPhaseListener implements Serializable {
          @PostConstruct
          private void initialize() {
              LifecycleFactory factory = (LifecycleFactory) FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY);
              Lifecycle lifecycle = factory.getLifecycle(LifecycleFactory.DEFAULT_LIFECYCLE);
              lifecycle.addPhaseListener(new PhaseListener() {
                  public void afterPhase(PhaseEvent phaseEvent) {
                      //To change body of implemented methods use File | Settings | File Templates.
                  }

                  public void beforePhase(PhaseEvent phaseEvent) {
                      ExternalContext ec = phaseEvent.getFacesContext().getExternalContext();
                      ec.addResponseHeader("Cache-Control", "no-cache, no-store, must-revalidate");
                      ec.addResponseHeader("Pragma", "no-cache");
                      ec.addResponseHeader("Expires", "0");
                  }

                  public PhaseId getPhaseId() {
                      return PhaseId.RENDER_RESPONSE;
                  }
              });
          }
      }
      Show
      @ManagedBean(eager = true) @ApplicationScoped public class HeaderPhaseListener implements Serializable {     @PostConstruct     private void initialize() {         LifecycleFactory factory = (LifecycleFactory) FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY);         Lifecycle lifecycle = factory.getLifecycle(LifecycleFactory.DEFAULT_LIFECYCLE);         lifecycle.addPhaseListener(new PhaseListener() {             public void afterPhase(PhaseEvent phaseEvent) {                 //To change body of implemented methods use File | Settings | File Templates.             }             public void beforePhase(PhaseEvent phaseEvent) {                 ExternalContext ec = phaseEvent.getFacesContext().getExternalContext();                 ec.addResponseHeader("Cache-Control", "no-cache, no-store, must-revalidate");                 ec.addResponseHeader("Pragma", "no-cache");                 ec.addResponseHeader("Expires", "0");             }             public PhaseId getPhaseId() {                 return PhaseId.RENDER_RESPONSE;             }         });     } }

      Description

      QA reports the following issue with showcase demo:

      Breadcrumbs:

      > Overview: JS error occurs in the following scenario:
      click on the '+' sign to access cities for a province.
      in 'Crumbs with URL's' click on the province name -> user is redirected to the wiki page for that province.
      click the Back button in the browser to navigate back to showcase ace:breadcrumbs - Overview page.
      select a different province from the breadcrumb menu items -> a JS error is visible in the console:
      [window] Error [status: malformedXML code: 200]: During update: crumb-form:crumb-tree::0:2:0: not found
      http://localhost:8080/showcase/javax.faces.resource/coalesced.js.jsf?ln=ice.core&dgst=4twnyr
      Line 436

      Yip's analysis:

      Nothing to do with breadcrumbs component. The tree demo has the same problem. See video. Seems like some states or some node ids (the digits in the id is the key to the tree node) are lost once you navigate elsewhere and come back. And it seems to occur only in single select mode. (Tree Overview demo uses multiple select mode, change source to use single select mode to reproduce problem.)

        Activity

        Ken Fyten created issue -
        Ken Fyten made changes -
        Field Original Value New Value
        Assignee Nils Lundquist [ nils.lundquist ]
        Assignee Priority P1 [ 10010 ]
        Nils Lundquist made changes -
        Workaround Description @ManagedBean(eager = true)
        @ApplicationScoped
        public class HeaderPhaseListener implements Serializable {
            @PostConstruct
            private void initialize() {
                LifecycleFactory factory = (LifecycleFactory) FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY);
                Lifecycle lifecycle = factory.getLifecycle(LifecycleFactory.DEFAULT_LIFECYCLE);
                lifecycle.addPhaseListener(new PhaseListener() {
                    public void afterPhase(PhaseEvent phaseEvent) {
                        //To change body of implemented methods use File | Settings | File Templates.
                    }

                    public void beforePhase(PhaseEvent phaseEvent) {
                        ExternalContext ec = phaseEvent.getFacesContext().getExternalContext();
                        ec.addResponseHeader("Cache-Control", "no-cache, no-store, must-revalidate");
                        ec.addResponseHeader("Pragma", "no-cache");
                        ec.addResponseHeader("Expires", "0");
                    }

                    public PhaseId getPhaseId() {
                        return PhaseId.RENDER_RESPONSE;
                    }
                });
            }
        }
        Nils Lundquist made changes -
        Summary ace:tree - single select mode JS error ace:tree - error on update following back button return
        Ken Fyten made changes -
        Assignee Nils Lundquist [ nils.lundquist ] Mircea Toma [ mircea.toma ]
        Nils Lundquist made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Ken Fyten made changes -
        Fix Version/s 4.0 [ 11382 ]
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Mircea Toma
            Reporter:
            Ken Fyten
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: