mutex <[EMAIL PROTECTED]> writes:

>If I change the layout within my screen class everything works as expected ie. new 
>layout is used.  

>But if I try this in my action class it refuses to use the new layout and the default 
>layout is used.

>I haven't researched the source code in depth, but is this a known problem and are 
>there are work 
>arounds apart from creating layouts for every screen.

The layout is set by the screen. You get the following pipeline:


HTTP Request

   |
   v
  Do we have an action?  Yes ---->  Perform the Action
   |                                         |
   v                                         |
   No                                        v
   |                                         |
   +-----------------------------------------+
   |
 Generate new Context for the Page
   |
   v
 Which Page is requested?
   | 
   v
 Render the screen class for the page
   |
   v
 Find the Layout for the screen (could be changed)
   |
   v
 Render the optional navigation screens
   |
   v
 Assemble all parts into a Page
   |
   v
 HTTP Response


If you change the Layout in the Action, it is changed back to the
"Default Layout" of the Screen, once the Page is hit. "Default Layout"
is the one found by the search sequence described in the VelocitySite
xdocs page.

If you want to change the Layout from an action, my best bet would be
to have a tool which queries the requested layout from the session and
then changes it on the screen. Change the content of the session in
the Action.

        Regards
                Henning

-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen       -- Geschaeftsfuehrer
INTERMETA - Gesellschaft fuer Mehrwertdienste mbH     [EMAIL PROTECTED]

Am Schwabachgrund 22  Fon.: 09131 / 50654-0   [EMAIL PROTECTED]
D-91054 Buckenhof     Fax.: 09131 / 50654-20   

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to