Jason,
  Thank you for your reply. Can you please give me more information. You 
will note that I did use RunData methods.
Apparently there are special RunData methods that deal with templates ( 
I am just beginning to understand the Turbine
concept of templates). How does one use RunData to change templates?

Thank you for your help.

Mark Glass

Jason van Zyl wrote:

> Mark Glass wrote:
> 
>> I have adapted the new app application to examine the users role and
>> select a different screen according to the users role. (Actually I want
>> to change the screen color depending on the users role).
>> I created two new screens called BlueIndex.vm and  GreenIndex.vm.  by
>> copying Index.vm in the Screens directory. I then added the following code
> 
> 
> 
> I changed a couple things, the sample app might be a bit out of date.
> If you are dealing with templates then you always use the RunData
> methods
> that deal with templates:
> 
>>    public void doBuildTemplate( RunData data, Context context )
>>    {
>>        context.put("entries", getEntries());
>>        if ( data.getACL ().hasRole ("accounting") )
>>        {
>>            // Set the template, the layout will automatically be matched up.
>>            data.setScreenTemplate("GreenIndex.vm");
>>        }
>>        else if ( data.getACL ().hasRole ("development") )
>>        {
>>            data.setScreenTemplate ("BlueIndex.vm");
>> 
>>        }
>>    }
>> 
>> to the Index class in the package org.mycompany.newapp.modules.screens.
>> 
>> For some reason the default screen is always chosen. Why? How can I make
>> this happen?
>> 
>> Thanks,
>> Mark Glass
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
> 

Reply via email to