2 Replies Latest reply on Jul 4, 2008 4:49 AM by Oliver Pütter

    rich:panel sometimes not get skinned

    Oliver Pütter Newbie

      Hello,

      I am using RF 3.2.1 GA, Tomcat 6 and JSF 1.2

      I experience that sometimes panels not get skinned corectly. This behaviour is described in RF-2316.

      It seems that this might be caused by a phase listener that I implemented to observe session timeouts.

      Without this listener the panels are always skinned correctly. I cannot find any strange code in my listener.

      public class LoggedInChecker implements PhaseListener
      {
      
       public PhaseId getPhaseId()
       {
       return PhaseId.RESTORE_VIEW;
       }
      
       public void beforePhase(PhaseEvent event)
       {
       System.out.println("LoggedInChecker: beforePhase");
       }
      
       public void afterPhase(PhaseEvent event)
       {
       System.out.println("LoggedInChecker: afterPhase");
       FacesContext fc = FacesContext.getCurrentInstance();
      
       if (fc.getExternalContext().getSession(false) != null)
       {
       SessionBean sb = (SessionBean)fc.getExternalContext().getSessionMap().get("sessionBean");
       boolean loggedIn = (sb != null && sb.getLoggedIn());
      
       boolean loginPage = false;
      
       try
       {
       String viewId = fc.getViewRoot().getViewId();
       loginPage = viewId.lastIndexOf("login") > -1 ? true : false;
       }
       catch(ViewExpiredException vee)
       {
       loginPage = false;
       }
      
       System.out.println("Logged In: " + loggedIn);
       System.out.println("LogIn Page: " + loginPage);
      
       if (!loginPage && !loggedIn)
       {
       NavigationHandler nh = fc.getApplication().getNavigationHandler();
       nh.handleNavigation(fc, null, Constants.NAV_LOGIN);
       }
       }
       else
       {
       NavigationHandler nh = fc.getApplication().getNavigationHandler();
       nh.handleNavigation(fc, null, Constants.NAV_LOGIN);
       }
       }
      }
      


      Any ideas?