Hi Didier

> I would like to know if someone has already used some frames with turbine?
> Are there any tips/tricks?

> I guess the sub frames would call an other page, the trig another Action/Screen.

I presume you need the actual frameset generated by Turbine - since if its fixed, you 
can use static html to generate the frameset and then refer to Turbine pages inside it.

What I did was to define a specific layout for frames, or one that doesn't define a 
<body> tag - as this invalidates the frameset.

    public void doBuild( RunData data ) throws Exception
    {
        // Now execute the Screen portion of the page
        ConcreteElement screen = ScreenLoader.getInstance().eval ( data, 
data.getScreen() );
        if (screen != null)
            data.getPage().getHtml().addElement( screen );
                  
        // The screen should have attempted to set a Title
        // for itself, otherwise, a default title is set
        data.getPage().getTitle()
            .addElement( data.getTitle() );
                                  
        // need to remove the body part to get the frame registered
        data.getPage().getHtml()
                     .removeElementFromRegistry( 
                             "body" );

    }


Then in the screen, I define the frameset, like this

   public ConcreteElement doBuild(RunData data) throws Exception
   {
      FrameSet frameSet = new FrameSet();
      frameSet.setRows("20%,*");
      frameSet.addAttribute("border","0");
      data.setTitle(Lookup.getString("SITENAME"));

      String frameMain = data.getParameters().getString("frame");
      DynamicURI userMainUri = new DynamicURI( data, USER_LIST_ADS );
      if ( frameMain == null)
         userMainUri = new DynamicURI( data, USER_LIST_ADS );
      else
      {
         userMainUri = new DynamicURI( data, frameMain );
         String frameAction = data.getParameters().getString("frameAction");
         if ( frameAction != null) userMainUri.setAction( frameAction );
         // should be able to just re-append the existing path - but can't work out how
         // so just add the ones we need
         
userMainUri.addPathInfo("ValidationKey",data.getParameters().getString("ValidationKey"));
         
userMainUri.addPathInfo("UserName",data.getParameters().getString("UserName"));
      }
         
                  
      // Now setup the frames
      frameSet.addElement( 
                     new Frame()
                        .setSrc("/Top.html").setName("top")
                        .addAttribute("scrolling","no")
                          );
      frameSet.addElement( 
                     new Frame()
                        .setSrc(userMainUri.toString() ).setName("bottom")
                        .addAttribute("scrolling","auto")
                          );
                          
      return frameSet;
   }
        
    public String getLayout(RunData data)
    {
        return "FramesLayout";
    }


I was wondering whether the FramesLayout/a generic/template version of the screen 
should in the core Turbine?

Hope this helps,
Chris
---
"surely it is madness to accept life as it is and not as it could be"
______________________________________________
FREE Personalized Email at Mail.com
Sign up at http://www.mail.com/?sr=signup



------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to