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
public void doBuildTemplate( RunData data, Context context )
{
context.put("entries", getEntries());
if ( data.getACL ().hasRole ("accounting") )
{
data.setLayout("GreenIndex");
data.setScreen ("GreenIndex");
}
else if ( data.getACL ().hasRole ("development") )
{
data.setScreen ("/BlueIndex");
}
System.out.println ("Screen is set to " + data.getScreen());
System.out.println ("Using Layout " + data.getLayout());
}
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]