Hi John,
Instead of $data.setScreen("Condition1.vm") try
#parse("screens/Condition1.vm"). (Note that this won't execute the class
associated with Condition1.vm). If you want, you can call your template
NewPage1.vm and it will automatically use this (without needing your
$data.setLayoutTemplate line).
I'm not sure what the difference between the two is. In the turbine source,
setScreenTemplate calls setLayoutTemplate so it seems like you should be
using setScreenTemplate. But I'm just guessing here...
Good luck,
David
-----Original Message-----
From: John Harris [mailto:[EMAIL PROTECTED]
Sent: Saturday October 23, 2004 10:00 PM
To: [EMAIL PROTECTED]
Subject: RE: Question about $data.setScreenTemplate
Hi David,
Thanks for your reply - I'm still struggling with some of the
turbine/templating concepts.
My turbine app is using frames as described in the velocity-site howto.
I've got a screen where I want to use a different layout than the
Default.vm layout, and then show a different screen based on certain
conditions. I'm trying to learn these concepts so I'm not sure how to
implement them.
So if the screen localhost:8080/webapp/app/template/NewPage1.vm is
called I want it to do something like:
$data.setLayoutTemplate("NewLayout.vm") //Trying to use a different
layout instead of layouts/Defaultvm
#if (condition1)
$data.setScreen("Condition1.vm") //Instead of showing the rest
of NewPage1.vm, show screens/Condition1.vm
#end
How is setScreenTemplate different from setLayoutTemplate?
thanks, John
>>> [EMAIL PROTECTED] 10/23/2004 9:42:48 PM >>>
Hi John,
What are you trying to do? setScreenTemplate sets the layout of the
screen
(layout like frames, css, page title, etc) and puts your screen where
it
reads $screen_placeholder. setScreen sets the actual screen that is
put in
place of $screen_placeholder - this is probably what you are looking
for.
HTH,
David
-----Original Message-----
From: John Harris [mailto:[EMAIL PROTECTED]
Sent: Saturday October 23, 2004 1:29 PM
To: [EMAIL PROTECTED]
Subject: Question about $data.setScreenTemplate
I'm calling $data.setScreenTemplate("NewPage.vm") - the logs show that
it looks under layouts/NewPage.vm, when it doesn't find it, it looks
and
finds layouts/Default.vm and returns.
I'm trying to understand why it would look for it under
layouts/NewPage.vm - shouldn't it be looking for it under screens?
What
am I missing here? I've been reading all the services/how-to to get an
indication of how this would work but I don't see it.
I have tested doing $data.setLayoutTemplate("NewLayout.vm") followed
by
$data.setScreenTemplate("NewPage.vm") - it does load the
layouts/NewLayout.vm - but it still looks for NewPage.vm under
layouts.
Any help or explanation would be greatly appreciated. I'm using
turbine
2.3.
-John
---------------------------------------------------------------------
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]
---------------------------------------------------------------------
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]