yes i agree. really it depends on how robust you want the external CSS
sheet. if you are looking just to modify one or two properties, i definatly
would use dynamic JS or inline RAW css to be injected when the page is
rendered. ive found that using external css is great for defualt styles and
colors, then use inline css or inline JS to customize certain aspects of the
UI. This is great cuz you can set up some JS objects to represent your HTML
objects on the page, then easily set many styles, colors or images very
quickly and with a lil amount of code.
evan
----- Original Message -----
From: "Daniel Jue" <[EMAIL PROTECTED]>
To: "Tapestry users" <users@tapestry.apache.org>
Sent: Tuesday, June 26, 2007 10:53 AM
Subject: Re: is ognl usable inside *.css files ?
If the css styles you want to override can be stored in a string in
the ASO, you can just output that into the page as you would for
rendering the user's name on the screen. You don't _have_ to
regenerate the css code each time, and you only need to override the
parts that are user specific. I think people are doing this in T5 to
write custom javascript for AJAX functionality in their pages.
On 6/26/07, Kalle Korhonen <[EMAIL PROTECTED]> wrote:
Sounds too expensive to me to generate the whole CSS dynamically. If you
just want to change the style for different applications, you can
override
the style in later style sheet; or, if you really want it dynamic, keep
the
link static but process it in servlet/service and serve up the image of
your
choice dynamically.
Kalle
On 6/26/07, Evan Rawson - Work <[EMAIL PROTECTED]> wrote:
>
> i do not believe so, cuz tapestry is only generating a link tag to load
> and
> cache your external asset (the external css sheet)
>
> a way to get around this would be to create a java method to generate
> your
> external asset (your css code + whatever variable data you wanna inject
> into
> it). then have your page class load this generated external asset onto
> the
> page when it renders. another possible way is to create a component
> which
> injects some javascript (this js could change specific css class
> properties). this component could be loaded onto your desired page
> class.
> if
> you need the properties to be dynamic to the page, meaning to change
> during
> event handling, you could even incorporate AJAX into this js component.
> i
> would actually have my Javascript modify at the DOM level and not at
> the
> css
> level.
>
> javascript to be inserted into page via component
>
> <script>
> window.onload = changeBackground {ognl:app.intrinsics.background.url ,
> ognl:app.intrinsics.getObject.getContainerId}
>
> function changeBackground (var background, var objectId){
> document.getElementById(objectId).style.backgroundImage =
> background;
> }
> ......
> </script>
>
>
> you could easily make this component a generic core component which any
> other component could us. usually when i code UI i will segregate id
> and
> classes. I only use classes to hanxdle direct external css, and i only
> use
> IDs to handle JS DOM level styling and control. Also if you wrap all
> components with <div class="myObjectContainer">component code....
> </div>
> you
> can easily control UI styling directly though java methods handled on
> the
> server side.
>
> ----- Original Message -----
> From: "Ken nashua" <[EMAIL PROTECTED]>
> To: <users@tapestry.apache.org>
> Cc: <[EMAIL PROTECTED]>
> Sent: Tuesday, June 26, 2007 10:19 AM
> Subject: is ognl usable inside *.css files ?
>
>
> > Folks,
> >
> > Want to impact my css-framework by entity based intrinsic's.
> >
> > Ex. I have an app wide pojo that is stored inside MySQL that
> characterizes
> > a background.gif (yes it is a blob but thats irrelevent)
> >
> > In any event, my blob gets put into an ASO and is sitting there at
> > bootstrap accessible via ognl object graph.
> >
> > I want my css file to layout using that blob.
> >
> > Can I use OGNL inside my css file?
> >
> > Normally one would use
> > background: #fff url( images/background.jpg ) top left no-repeat;
> >
> > I would like to use
> > background: #fff url( ognl:app.intrinsics.background.url ) top left
> > no-repeat;
> >
> > Is this possible?
> >
> > Any ideas on the appropriate way one should implement this? Thanks in
> > advance.
> >
> > Best regards
> > Ken in nashua
> >
> > _________________________________________________________________
> > Who's that on the Red Carpet? Play & win glamorous prizes.
> >
> http://club.live.com/red_carpet_reveal.aspx?icid=REDCARPET_hotmailtextlink3
> >
> >
> > ---------------------------------------------------------------------
> > 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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]