Hello all,

I'm trying to determine the best way to generate slightly different output
for a component, based upon the parameters passed into it. For example,
suppose I've created a component called MessagePane that displays a title
and message inside of some CSS formatting:

<span jwcid="@MessagePane" title="Unread Messages" message="You have 6
unread messages.">Unread Messages</span>

Depending upon the type of message being displayed, I'd like to change the
CSS class of the object... Say, a generic alert might appear in a pane with
a light blue border, but a critical error should be highlighted in red. The
way I've implemented this for now is that I've subclassed MessagePane as
ErrorPane, and I placed the modified CSS directly into the ErrorPane.html
template.

Is there an easier way to accomplish this goal, preferably using a single
component? I'm now going to need several more "message types" - I'd rather
be able to pass in the type as a parameter, instead of creating a new
subclassed component for each type.

Thanks!
-- 
View this message in context: 
http://www.nabble.com/One-component%2C-multiple-templates--tf2541643.html#a7081573
Sent from the Tapestry - User mailing list archive at Nabble.com.


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

Reply via email to