On 6/26/01 6:37 PM, "Xun Liu" <[EMAIL PROTECTED]> wrote:

> At 18:01 2001-6-26 -0400, you wrote:
>> On 6/26/01 5:07 PM, "Xun Liu" <[EMAIL PROTECTED]> wrote:
>> 
>>> Not exactly. Different users will share the same templates, but different
>>> layout and
>>> look/feel.
>> 
>> If the requirement is only to change the layout then why are you
>> making calls to setScreenTemplate?
> 
> 
> Here is an example:
> 
> An screen class has the following code in the doBuildTemplate() method:

So before this block of code you have already set the layout template?
If so then a work around would be to do the following:

// Save the layout template before setScreenTemplate
// clobbers it.
String layout = data.getLayoutTemplate();
 
> If (the user is under 21) {
>        data.setScreenTemplate("NoDrinking.vm")
> }
> else {
>        data.setScreenTemplate("Drinking.vm")
> }

// Restore the layout template
data.setLayoutTemplate(layout);
 
> As you pointed out, after setScreenTemplate is executed the layout template
> is also changed.
> 
> However the users want the screen templates ("NoDrinking.vm",
> "Drinking.vm", etc) to be
> displayed in their preferred layout templates.

Maybe we could change the behavior of setScreenTemplate() so
that it optionally looked for a matching layout template or
maybe we could make another method, say, setScreenTemplateXXX()
that looked up the layout and the original method wouldn't.
I'll think about it for a bit. But the work around should do
the trick if it's your layout template that's getting
clobbered by setScreenTemplate().
 
> 
> Thanks for your advices.
> 
> Xun
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

-- 

jvz.

Jason van Zyl

http://tambora.zenplex.org
http://jakarta.apache.org/turbine
http://jakarta.apache.org/velocity
http://jakarta.apache.org/alexandria
http://jakarta.apache.org/commons



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

Reply via email to