You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Henrik Vendelbo <hv...@bluprints.com> on 2005/01/30 14:51:42 UTC

Re: Tapestry Features / Skinning, alternatives

Personally I dont like the way Border is typically used, instead I have my
own version of the Shell component.

My version of the Shell is able to pick a stylesheet depending on browser
type and actual user logged in. As for
adding such things as navigation bar, menu and footer I have other
components responsible for that, and using them
( <span jwcid="@MyFooter"/>) in each page is not much of an issue, and
definately makes static page testing much more valuable.

If I had to pick a template on the fly I would make a new service that did
it.

----- Original Message ----- 
From: "Christopher M. DeBracy" <ch...@debracy.net>
To: "'Tapestry users'" <ta...@jakarta.apache.org>
Sent: Thursday, June 24, 2004 12:15 PM
Subject: RE: Tapestry Features / Skinning


Don't be sorry. The alternative would be for me to use <context-asset
name="$template" path="/path/TemplateToUse.html"/>, though I suspect even if
I changed the template name and did the reset I'd still be in the same
situation.

At this point, if I place this link on a page that I don't care about
staying cached, such as an admin page, then the skinning will work
beautifully. I had posted to see if someone had a thought as to what I might
be doing wrong. It's a minor limitation that I can work around, though I'll
happily try something different if there's a suggestion.

Being able to swap layouts and stylesheets on the fly can be rather useful
in some situations.

Thanks!

Chris

> -----Original Message-----
> From: Karel Miarka [mailto:kajism@issa.cz]
> Sent: Thursday, June 24, 2004 2:25 AM
> To: Tapestry users
> Subject: Re: Tapestry Features / Skinning
>
>
> I was playing with this only for a while when I was wondering
> if it is better to have two separate templates for readOnly
> item detail and writable item detail. Finaly I have decided
> to use just one template with conditional statements
> according to user's rights. So I have even not realized that
> the "skinning" approach I have suggested is problematic due
> to the template caching. Sorry for the confusion.
>
> Karel
>
> ----- Original Message ----- 
> From: "Christopher M. DeBracy" <ch...@debracy.net>
> To: "'Tapestry users'" <ta...@jakarta.apache.org>
> Sent: Thursday, June 24, 2004 1:06 AM
> Subject: RE: Tapestry Features / Skinning
>
>
> I've tried Karel's suggestion for selecting templates on the
> fly and it works well - the first time, anyway. Once cached
> the template remains in memory. I can flush it by calling the
> service=reset and configuring the JVM to enable the reset
> service, but that opens up the app to much heartache as
> indicated in the code comments.
>
> To clear the cache I added the following code to one of my pages:
>
> ((IEngineServiceView) getPage().getEngine()).clearCachedData();
>
> This works but with the small side effect that the page I'm
> currently on when I click the link does not get flushed. I
> even tried calling the reset service afterwards to cycle to a
> different (home) page and start the session over again.
>
> I can live with this limitation, but I'm wondering what I'm
> missing to make this work cleanly.
>
> Thanks,
>
> Chris
>
> > -----Original Message-----
> > From: Norbert Sándor [mailto:programozas@hotmail.com]
> > Sent: Wednesday, June 16, 2004 1:01 PM
> > To: Tapestry users
> > Subject: Re: Tapestry Features / Skinning
> >
> >
> > Is this a "legal" way of skinning?
> > I mean: will this probably work in future releases?
> >
> > Thanks,
> > Norbi
> >
> > ----- Original Message -----
> > From: "Karel Miarka" <ka...@issa.cz>
> > To: "Tapestry users" <ta...@jakarta.apache.org>
> > Sent: Thursday, May 27, 2004 10:54 AM
> > Subject: Re: Tapestry Features / Skinning
> >
> >
> > > Hi,
> > >
> > > there is another quite simple possibility of switching page
> > templates
> > > at
> > > runtime:
> > >
> > > 1) define all template files you want to use in your page
> > > specification as context-assets, for example:
> > >
> > > <context-asset name="templateRO"
> path="/WEB-INF/DivisionRO.html"/>
> > > <context-asset name="templateRW" path="/WEB-INF/DivisionRW.html"/>
> > >
> > > 2) overwrite the getAsset() method in your page class,
> for example:
> > >
> > > public IAsset getAsset(String name) {
> > >   if (ITemplateSource.TEMPLATE_ASSET_NAME.equals(name)) {
> > >     String templateAssetName = "templateRO";
> > >     if (... canWrite ... ) {
> > >       templateAssetName = "templateRW";
> > >     }
> > >     return super.getAsset(templateAssetName);
> > >   }
> > >   return super.getAsset(name);
> > > }
> > >
> > > The only disadvantage of this approach, I see at the
> > moment, is that
> > > with this configuration Spindle stops working with such templates
> > > saying "Tapestry can not see "DivisionRO.html" at runtime... I'm
> > > wondering if
> > this
> > > must be a reason for Spindle to stop offering XML hints (list of
> > components
> > > or attributes for them)?
> > >
> > > Best regards,
> > > Karel
> > >
> > >
> > >
> > >
> >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> tapestry-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail:
> > tapestry-user-help@jakarta.apache.org
> > >
> > >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> tapestry-user-help@jakarta.apache.org
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org






---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org