At 15:35 2001-6-26 -0400, you wrote:
 >Subject: Re: setScreenTemplate
 >To: <[EMAIL PROTECTED]>
 >
 >On 6/26/01 3:04 PM, "Xun Liu" <[EMAIL PROTECTED]> wrote:
 >
 >> Hi,
 >>
 >> I extend VelocityECSLayout to provide different layout template for the
 >> user admin1
 >>
 >> Here is my own Layout class:
 >>
 >> public class Admin extends VelocityECSLayout {
 >>
 >>  public Admin() {
 >>  }
 >>
 >>  public void doBuild( RunData data ) throws Exception {
 >>      try{
 >>      if (data.getUser().getUserName().compareTo("admin1") == 0) {
 >>          data.setLayoutTemplate("/admin.vm");  //use admin.vm as the
 >> layout template for user admin1
 >>       }
 >>      }
 >>      catch(Exception e){}
 >>      super.doBuild(data);
 >>  }
 >> }
 >>
 >> It works fine if I don't call setScreenTemplate in the my screen classes.
 >> However, if I call
 >> setScreenTemplate, the layout template is set back to the default one.  How
 >> could I tell
 >> Turbine/Velocity not to do that?
 >
 >A call setScreenTemplate() triggers the search for a matching
 >layout template. So if you call setScreenTemplate() you must
 >follow it with setLayoutTemplate in order to override what
 >setScreenTemplate() sets as the layout template.

So, it means I cannot have a central point to set the layout template and
have to call setLayoutTemplate() after setScreenTemplate() or overwrite
doPostBuildTemplate()? Right?


 >
 >>
 >> Thanks
 >>
 >> 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]
 >


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

Reply via email to