Brian, Thank you. That would be the correct OO way of doing it (Why didn't I think of that?). Slight drawback is that I've got three files now (although one with actual code), And I was rather trying to get to one file.
Thanks, Steve -----Original Message----- From: Brian Lawler [mailto:[EMAIL PROTECTED] Sent: 17 September 2003 13:54 To: Turbine Users List Subject: Re: Velocity newbie question Steve- You can make a base class for the 2 screens and have both of your actual screen classes extend it: BaseDetails - has all of your common code. ShowDetails extends BaseDetails EditDetails extends BaseDetails Just be sure to call super.doPerform() from you child classes. -Brian On Wednesday, September 17, 2003, at 04:43 AM, cctech wrote: > I'll fairly new to Turbine and Velocity, but nonetheless, I have gone > Headlong into building a complex application with a large data model. > > I have been constructing screens using Velocity for both displaying > Table data and for editing it. Trouble is, I seem to create Action > Classes for both display and for edit that are both exactly the same. > > E.g. ShowDetails.java for ShowDetails.vm > And EditDetails.java for EditDetails.vm (then goes to > UpdateDetails.java) > > In this case the code for the two java classes (Show, Edit) is exactly > the same except with different class names. > > Is there anyway of re-using the same class for different velocity > templates? Have I missed something simple? > > Thanks, > > Steve > > > --------------------------------------------------------------------- > 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]
