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]