0 Replies Latest reply on Jun 10, 2010 1:58 PM by Armand Rock

    Limit skin to single page

    Armand Rock Newbie

      I'm trying to implement a Preview feature without changing the session skin.  i'm usinga bean in session scope to return the skin.

       

      When the user changes the skin i Pop-up a new window with the preview in the desired skin.

       

      However the problem is the new skin applies to all subsequent page requests so all pages are using this skin whether they want it or not.

       

      I was thinking about making' it so that the skin reverts back if the modal is closed however that wont work because the site is using frames and not all of it is done in Richfaces (only the portions i have converted so far and unfortunately the conversion job will take a long time because of the size of the application)....which means i cant guarantee they wont try and view another page before the skin has reverted back.

       

      The way the application is setup a user can decide to start doing something else and thats where the problem occurs...they would end up seeing it in the previewed skin instead of their own session skin.

       

      To add complications to it a user could have 2 sessions open and based on which one we are displaying a different skin should be displayed.

       

      I would be ok to check a request parameter to do a preview and display the page accordingly...if it worked.

       

      I'm using this in my getSkin() method within my bean:

       

      FacesContext context = FacesContext.getCurrentInstance();

      HttpServletRequest request = (HttpServletRequest)context.getExternalContext().getRequest();

      String skinPreview = request.getParameter("skinPreview");

       

      if skinPreview is not null i return it otherwise i return the session skin...

      that doesnt seem to work because i'm assuming the jspx file's request i call doesnt drive the skin used after all...it seems to be one of 3 other files that seem to get called right after it...and i its not consisent as to when they get called....2 are */renderkit/* and the other has */page.xcss/*

       

      if i could force the call of these 3 other files after every page request i could 'stop' my preview after one is called in theory


      Thanks