Hmm. Generally, the accepted behaviour with layouts is to set them in the
template being rendered. It makes a degree of sense to re-initialise the
layout when rendering a "new" template, otherwise layout changes could
continue across all pages (whether you want it or not).
If you really insist on setting the layout template in code (the MVC police
might get you), try re-arranging the order:
data.setScreenTemplate("blah.vm");
data.setLayoutTemplate("layout.vm");
It obvious that setLayoutTemplate() reassigns the layout. A much better
policy is something like:
------blah.vm----
$data.setLayoutTemplate("/layout.vm")
<p>Rest of template</p>
-----------------
It never hurts to be explicit about the way a page should be rendered. If it
has a number of different ways of being rendered, control it with a
parameter or a key in the context.
Hope this helps.
Regards,
Greg Kerdemelidis
> -----Original Message-----
> From: Naree Song [mailto:[EMAIL PROTECTED]
> Sent: Friday, 21 November 2003 7:21 p.m.
> To: Turbine Users List
> Subject: Layout Template Change
>
> Hello,
>
> I found a strange behaviour with Layout Template.
> It seems that when the Screen template gets changed
> in screen class using setScreenTemplate,
> the Layout template reverts back to the default Layout template.
>
> **** code *******
> else
> {
> log.info(data.getLayoutTemplate());
>
> data.setScreenTemplate("PayMe.vm");
>
> log.info(data.getLayoutTemplate());
> }
>
>
> ***** log ***
> 2003-11-21 17:09:59,942 [Thread-5] INFO
> com.me.mepay.modules.screens.PayMeResult - AdminDefault.vm
> 2003-11-21 17:09:59,947 [Thread-5] INFO
> com.me.mepay.modules.screens.PayMeResult - Default.vm
>
> Is this an expected behaviour?
>
> Regards,
> Naree
> --
> Media Equation
> 71 - 73 Thistlethwaite Street
> South Melbourne 3205
> Australia
> Tel: + 613 9673 8111
> Fax: + 613 9690 4244
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]