Reference asset from css

classic Classic list List threaded Threaded
19 messages Options
Reply | Threaded
Open this post in threaded view
|

Reference asset from css

Hugo Palma
Is there anyway i can reference an asset from a css ?
I would like the css not to reference the images directly but to use
tapestry assets instead, but i have no idea on how to do this. Is it
possible ?


Cheers

Hugo

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

dynamic forms that are stateless

Eric Schneider
Hi,

I have a requirement that I'm stumbling on.   I have an editor page  
that needs to be completely stateless containing no persistent  
properties.   Users must be able to open this page in multiple  
browsers windows, switching back and forth and performing updates.

This is no problem if there are a fixed amount of form elements.    
When the user clicks save, I instantiate the bean in pageBeginRender
() so it can successfully take the values from the form.

Where it gets awkward is when you have a dynamic number form  
elements.  (i.e. - a customer has 0-many shipping addresses).   I  
have to re-inflate that list of shipping addresses before values are  
set to the beans within the lists.  Unfortunately, there really isn't  
a good way to tell how many shipping address there are, aside from  
putting this count in a hidden form input (which is too late  
anyway).  Has anyone geared up something like this?

I hope I'm explaining this well enough.  Any suggestions would be  
greatly appreciated.

Thanks,
e.
   

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: dynamic forms that are stateless

richard.hensley
Eric,

Do you mean completely stateless relative to the HTTP session? If this is
true, you are going to have to squirrel you data away on hidden fields in
your form.

I would do the following:

Make a serializable class that represents the data the user is editing.
Create a property of the type the user is editing.
Set the initial value of the property to a new instance.
Make a hidden field that has a value of the property.
Attach all the form components to field of the object being edited.

What tapestry will do is "squeeze" your object out to the html form when
your form is rendered to the browser. When the form is sumbitted, tapestry
will unsqueeze your object from the hidden field back into your property.
This should
allow you to track the users actions and render an appropriate form as
needed, and each form displayed in a browser has it's own "state".

Also, remember to set all the @Form and @xxxLink components to
stateful="false".

Richard

-----Original Message-----
From: Eric Schneider [mailto:[hidden email]]
Sent: Wednesday, May 18, 2005 12:16 PM
To: Tapestry users
Subject: dynamic forms that are stateless

Hi,

I have a requirement that I'm stumbling on.   I have an editor page  
that needs to be completely stateless containing no persistent  
properties.   Users must be able to open this page in multiple  
browsers windows, switching back and forth and performing updates.

This is no problem if there are a fixed amount of form elements.    
When the user clicks save, I instantiate the bean in pageBeginRender
() so it can successfully take the values from the form.

Where it gets awkward is when you have a dynamic number form  
elements.  (i.e. - a customer has 0-many shipping addresses).   I  
have to re-inflate that list of shipping addresses before values are  
set to the beans within the lists.  Unfortunately, there really isn't  
a good way to tell how many shipping address there are, aside from  
putting this count in a hidden form input (which is too late  
anyway).  Has anyone geared up something like this?

I hope I'm explaining this well enough.  Any suggestions would be  
greatly appreciated.

Thanks,
e.
   

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: dynamic forms that are stateless

Robert Zeigler
In reply to this post by Eric Schneider
Eric Schneider wrote:

> Hi,
>
> I have a requirement that I'm stumbling on.   I have an editor page
> that needs to be completely stateless containing no persistent
> properties.   Users must be able to open this page in multiple  browsers
> windows, switching back and forth and performing updates.
>
> This is no problem if there are a fixed amount of form elements.    When
> the user clicks save, I instantiate the bean in pageBeginRender () so it
> can successfully take the values from the form.
>
> Where it gets awkward is when you have a dynamic number form  elements.
> (i.e. - a customer has 0-many shipping addresses).   I  have to
> re-inflate that list of shipping addresses before values are  set to the
> beans within the lists.  Unfortunately, there really isn't  a good way
> to tell how many shipping address there are, aside from  putting this
> count in a hidden form input (which is too late  anyway).  Has anyone
> geared up something like this?

I'm curious as to how putting the count in a hidden is too late? When
the page is first rendered, do you have access to the size of the list
before the loop? If so, couldn't you just put in the size of the list in
a @Hidden (before the loop) and use a listener with the @Hidden to
re-instantiate the list? I've used this strategy several times with
success. But... maybe I'm missing something? :)

Robert
>
> I hope I'm explaining this well enough.  Any suggestions would be
> greatly appreciated.
>
> Thanks,
> e.  
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: dynamic forms that are stateless

Shing Hing Man
In reply to this post by Eric Schneider
The following is only a suggestion. It might
be useless to you.
If your shiping addresses are generated
 by a Foreach component, you could replace it by a
ListEdit component and "collect all the shipping
addresses"  during rewind in an ArrayList, without
knowing how many are there in advance.

An example of the above is the "Sum" example on
http://gauss.demon.co.uk/tapestryDemo/welcome


Shing

--- Eric Schneider <[hidden email]>
wrote:

> Hi,
>
> I have a requirement that I'm stumbling on.   I have
> an editor page  
> that needs to be completely stateless containing no
> persistent  
> properties.   Users must be able to open this page
> in multiple  
> browsers windows, switching back and forth and
> performing updates.
>
> This is no problem if there are a fixed amount of
> form elements.    
> When the user clicks save, I instantiate the bean in
> pageBeginRender
> () so it can successfully take the values from the
> form.
>
> Where it gets awkward is when you have a dynamic
> number form  
> elements.  (i.e. - a customer has 0-many shipping
> addresses).   I  
> have to re-inflate that list of shipping addresses
> before values are  
> set to the beans within the lists.  Unfortunately,
> there really isn't  
> a good way to tell how many shipping address there
> are, aside from  
> putting this count in a hidden form input (which is
> too late  
> anyway).  Has anyone geared up something like this?
>
> I hope I'm explaining this well enough.  Any
> suggestions would be  
> greatly appreciated.
>
> Thanks,
> e.
>    
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [hidden email]
> For additional commands, e-mail:
> [hidden email]
>
>

Home page :
  http://uk.geocities.com/matmsh/index.html


       
       
               
___________________________________________________________
Yahoo! Messenger - want a free and easy way to contact your friends online? http://uk.messenger.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: dynamic forms that are stateless

Mind Bridge
In reply to this post by Eric Schneider
Hi,

Just curious, why is placing the info in a Hidden too late?

Also, do ListEdit or For (on www.t-deli.com) do what you want?

-mb

----- Original Message -----
From: "Eric Schneider" <[hidden email]>
To: "Tapestry users" <[hidden email]>
Sent: Wednesday, May 18, 2005 10:16 PM
Subject: dynamic forms that are stateless


> Hi,
>
> I have a requirement that I'm stumbling on.   I have an editor page  
> that needs to be completely stateless containing no persistent  
> properties.   Users must be able to open this page in multiple  
> browsers windows, switching back and forth and performing updates.
>
> This is no problem if there are a fixed amount of form elements.    
> When the user clicks save, I instantiate the bean in pageBeginRender
> () so it can successfully take the values from the form.
>
> Where it gets awkward is when you have a dynamic number form  
> elements.  (i.e. - a customer has 0-many shipping addresses).   I  
> have to re-inflate that list of shipping addresses before values are  
> set to the beans within the lists.  Unfortunately, there really isn't  
> a good way to tell how many shipping address there are, aside from  
> putting this count in a hidden form input (which is too late  
> anyway).  Has anyone geared up something like this?
>
> I hope I'm explaining this well enough.  Any suggestions would be  
> greatly appreciated.
>
> Thanks,
> e.
>    
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: dynamic forms that are stateless

Eric Schneider
In reply to this post by richard.hensley
Richard,

> Do you mean completely stateless relative to the HTTP session?

Yeah, unfortunately that is the case.   I wish persistent properties  
was an option, but it isn't.   :-\

> Make a serializable class that represents the data the user is  
> editing.
> Create a property of the type the user is editing.
> Set the initial value of the property to a new instance.
> Make a hidden field that has a value of the property.
> Attach all the form components to field of the object being edited.

Ah, yes.  I'm doing something similar, tho I'm not binding the entire  
object to a hidden input field.  This is where I'm probably going wrong.

I'll give your suggestions a try.   Thanks!

e.

On May 18, 2005, at 4:38 PM, Hensley, Richard wrote:

> Eric,
>
> Do you mean completely stateless relative to the HTTP session? If  
> this is
> true, you are going to have to squirrel you data away on hidden  
> fields in
> your form.
>
> I would do the following:
>
> Make a serializable class that represents the data the user is  
> editing.
> Create a property of the type the user is editing.
> Set the initial value of the property to a new instance.
> Make a hidden field that has a value of the property.
> Attach all the form components to field of the object being edited.
>
> What tapestry will do is "squeeze" your object out to the html form  
> when
> your form is rendered to the browser. When the form is sumbitted,  
> tapestry
> will unsqueeze your object from the hidden field back into your  
> property.
> This should
> allow you to track the users actions and render an appropriate form as
> needed, and each form displayed in a browser has it's own "state".
>
> Also, remember to set all the @Form and @xxxLink components to
> stateful="false".
>
> Richard
>
> -----Original Message-----
> From: Eric Schneider [mailto:[hidden email]]
> Sent: Wednesday, May 18, 2005 12:16 PM
> To: Tapestry users
> Subject: dynamic forms that are stateless
>
> Hi,
>
> I have a requirement that I'm stumbling on.   I have an editor page
> that needs to be completely stateless containing no persistent
> properties.   Users must be able to open this page in multiple
> browsers windows, switching back and forth and performing updates.
>
> This is no problem if there are a fixed amount of form elements.
> When the user clicks save, I instantiate the bean in pageBeginRender
> () so it can successfully take the values from the form.
>
> Where it gets awkward is when you have a dynamic number form
> elements.  (i.e. - a customer has 0-many shipping addresses).   I
> have to re-inflate that list of shipping addresses before values are
> set to the beans within the lists.  Unfortunately, there really isn't
> a good way to tell how many shipping address there are, aside from
> putting this count in a hidden form input (which is too late
> anyway).  Has anyone geared up something like this?
>
> I hope I'm explaining this well enough.  Any suggestions would be
> greatly appreciated.
>
> Thanks,
> e.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: dynamic forms that are stateless

Eric Schneider
In reply to this post by Robert Zeigler
Robert,

> I'm curious as to how putting the count in a hidden is too late?

Maybe you can tell me?   As far as I can tell, the composite object  
(which holds all the form elements) is null when pageBeginRender() is  
invoked.   In other words, it has not taken any values from the form  
yet.  If I don't instantiate the object in pageBeginRender(), the  
page throws because it's attempting to set a value on a null object.

I'm going to try Richard's suggestion.   See if that gets me somewhere.

Thanks,
e.

On May 18, 2005, at 5:00 PM, Robert Zeigler wrote:

> Eric Schneider wrote:
>
>> Hi,
>>
>> I have a requirement that I'm stumbling on.   I have an editor page
>> that needs to be completely stateless containing no persistent
>> properties.   Users must be able to open this page in multiple  
>> browsers
>> windows, switching back and forth and performing updates.
>>
>> This is no problem if there are a fixed amount of form  
>> elements.    When
>> the user clicks save, I instantiate the bean in pageBeginRender ()  
>> so it
>> can successfully take the values from the form.
>>
>> Where it gets awkward is when you have a dynamic number form  
>> elements.
>> (i.e. - a customer has 0-many shipping addresses).   I  have to
>> re-inflate that list of shipping addresses before values are  set  
>> to the
>> beans within the lists.  Unfortunately, there really isn't  a good  
>> way
>> to tell how many shipping address there are, aside from  putting this
>> count in a hidden form input (which is too late  anyway).  Has anyone
>> geared up something like this?
>>
>
> I'm curious as to how putting the count in a hidden is too late? When
> the page is first rendered, do you have access to the size of the list
> before the loop? If so, couldn't you just put in the size of the  
> list in
> a @Hidden (before the loop) and use a listener with the @Hidden to
> re-instantiate the list? I've used this strategy several times with
> success. But... maybe I'm missing something? :)
>
> Robert
>
>>
>> I hope I'm explaining this well enough.  Any suggestions would be
>> greatly appreciated.
>>
>> Thanks,
>> e.
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: tapestry-user-
>> [hidden email]
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: dynamic forms that are stateless

Robert Zeigler
I think I'm understanding the issue better now. :)
Tell me, if all initialization is done in pageBeginRender, then
how are the dynamic elements (lists, etc.) initialized in the first
place? You gave example of shipping addresses... how do you know how
to initialize the shippingAddresses list to begin with? Is the composite
object set in a listener method elsewhere? Or...?
Richard's suggestion sounded fine. I suspect that you're also using
cayenne...? If you are, watch out for null data contexts on
re-serialization.

Robert

Eric Schneider wrote:

> Robert,
>
>> I'm curious as to how putting the count in a hidden is too late?
>
>
> Maybe you can tell me?   As far as I can tell, the composite object
> (which holds all the form elements) is null when pageBeginRender() is
> invoked.   In other words, it has not taken any values from the form
> yet.  If I don't instantiate the object in pageBeginRender(), the  page
> throws because it's attempting to set a value on a null object.
>
> I'm going to try Richard's suggestion.   See if that gets me somewhere.
>
> Thanks,
> e.
>
> On May 18, 2005, at 5:00 PM, Robert Zeigler wrote:
>
>> Eric Schneider wrote:
>>
>>> Hi,
>>>
>>> I have a requirement that I'm stumbling on.   I have an editor page
>>> that needs to be completely stateless containing no persistent
>>> properties.   Users must be able to open this page in multiple  
>>> browsers
>>> windows, switching back and forth and performing updates.
>>>
>>> This is no problem if there are a fixed amount of form  elements.  
>>> When
>>> the user clicks save, I instantiate the bean in pageBeginRender ()
>>> so it
>>> can successfully take the values from the form.
>>>
>>> Where it gets awkward is when you have a dynamic number form   elements.
>>> (i.e. - a customer has 0-many shipping addresses).   I  have to
>>> re-inflate that list of shipping addresses before values are  set  to
>>> the
>>> beans within the lists.  Unfortunately, there really isn't  a good  way
>>> to tell how many shipping address there are, aside from  putting this
>>> count in a hidden form input (which is too late  anyway).  Has anyone
>>> geared up something like this?
>>>
>>
>> I'm curious as to how putting the count in a hidden is too late? When
>> the page is first rendered, do you have access to the size of the list
>> before the loop? If so, couldn't you just put in the size of the  list in
>> a @Hidden (before the loop) and use a listener with the @Hidden to
>> re-instantiate the list? I've used this strategy several times with
>> success. But... maybe I'm missing something? :)
>>
>> Robert
>>
>>>
>>> I hope I'm explaining this well enough.  Any suggestions would be
>>> greatly appreciated.
>>>
>>> Thanks,
>>> e.
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: tapestry-user- [hidden email]
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Reference asset from css [auf Viren geprueft]

Jonathan O'Connor
In reply to this post by Hugo Palma

Hugo,
url references in a css file are always relative to the location of the css file. You may have to create your own asset service, and ../.. your way up to that.
Unless you are creating assets on the fly or selecting language specific assets, if you expose your images directory, it'll work fine without an asset.
Ciao,
Jonathan O'Connor
XCOM Dublin
Hugo Palma <[hidden email]>



To

[hidden email]

cc


Subject

Reference asset from css [auf Viren geprueft]

Is there anyway i can reference an asset from a css ?
I would like the css not to reference the images directly but to use
tapestry assets instead, but i have no idea on how to do this. Is it
possible ?


Cheers

Hugo

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]





IBM Workplace 2.5 Launch Events:
XCOM AG und IBM laden zum weltweiten Launch von IBM Workplace Collaboration Services 2.5 nach Duesseldorf, Frankfurt und Berlin: http://lotus.xcom.de/events

XCOM Express Programm:
Der schnelle Einstieg in neueste Technologien zum kleinen Preis - Portale, e-Mail Security und Mobility: http://lotus.xcom.de/express


*** XCOM AG Legal Disclaimer ***

Diese E-Mail einschliesslich ihrer Anhaenge ist vertraulich und ist allein für den Gebrauch durch den vorgesehenen Empfaenger bestimmt. Dritten ist das Lesen, Verteilen oder Weiterleiten dieser E-Mail untersagt. Wir bitten, eine fehlgeleitete E-Mail unverzueglich vollstaendig zu loeschen und uns eine Nachricht zukommen zu lassen.

This email may contain material that is confidential and for the sole use of the intended recipient. Any review, distribution by others or forwarding without express permission is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
Reply | Threaded
Open this post in threaded view
|

Re: dynamic forms that are stateless

Eric Schneider
In reply to this post by Robert Zeigler
Robert,

> Tell me, if all initialization is done in pageBeginRender, then
> how are the dynamic elements (lists, etc.) initialized in the first
> place?

The object is inflated and passed to the page via an action on  
another page.   For that first render, no initialization is required  
in pageBeginRender.

So, after the page is rendered, it's stripped of its state and  
returned to the page pool. It's the form submission part that's  
jacking me all up.

> I suspect that you're also using
> cayenne...? If you are, watch out for null data contexts on
> re-serialization.

Bingo!  Actually, I went with a struts style form bean thing.  The  
bean takes the values from the form and has convenience methods to  
copy it's values to a DataObject.

So, for existing objects (ones committed to the db)....

- I re-inflate my DataObject from a key passed in a hidden input
- copy form bean values to it,
- validate,
- then commit

Clear as mud, huh?  :-)

Eric

On May 18, 2005, at 10:31 PM, Robert Zeigler wrote:

> I think I'm understanding the issue better now. :)
> Tell me, if all initialization is done in pageBeginRender, then
> how are the dynamic elements (lists, etc.) initialized in the first
> place? You gave example of shipping addresses... how do you know how
> to initialize the shippingAddresses list to begin with? Is the  
> composite
> object set in a listener method elsewhere? Or...?
> Richard's suggestion sounded fine. I suspect that you're also using
> cayenne...? If you are, watch out for null data contexts on
> re-serialization.
>
> Robert
>
> Eric Schneider wrote:
>
>> Robert,
>>
>>
>>> I'm curious as to how putting the count in a hidden is too late?
>>>
>>
>>
>> Maybe you can tell me?   As far as I can tell, the composite object
>> (which holds all the form elements) is null when pageBeginRender() is
>> invoked.   In other words, it has not taken any values from the form
>> yet.  If I don't instantiate the object in pageBeginRender(), the  
>> page
>> throws because it's attempting to set a value on a null object.
>>
>> I'm going to try Richard's suggestion.   See if that gets me  
>> somewhere.
>>
>> Thanks,
>> e.
>>
>> On May 18, 2005, at 5:00 PM, Robert Zeigler wrote:
>>
>>
>>> Eric Schneider wrote:
>>>
>>>
>>>> Hi,
>>>>
>>>> I have a requirement that I'm stumbling on.   I have an editor page
>>>> that needs to be completely stateless containing no persistent
>>>> properties.   Users must be able to open this page in multiple
>>>> browsers
>>>> windows, switching back and forth and performing updates.
>>>>
>>>> This is no problem if there are a fixed amount of form  elements.
>>>> When
>>>> the user clicks save, I instantiate the bean in pageBeginRender ()
>>>> so it
>>>> can successfully take the values from the form.
>>>>
>>>> Where it gets awkward is when you have a dynamic number form    
>>>> elements.
>>>> (i.e. - a customer has 0-many shipping addresses).   I  have to
>>>> re-inflate that list of shipping addresses before values are  
>>>> set  to
>>>> the
>>>> beans within the lists.  Unfortunately, there really isn't  a  
>>>> good  way
>>>> to tell how many shipping address there are, aside from  putting  
>>>> this
>>>> count in a hidden form input (which is too late  anyway).  Has  
>>>> anyone
>>>> geared up something like this?
>>>>
>>>>
>>>
>>> I'm curious as to how putting the count in a hidden is too late?  
>>> When
>>> the page is first rendered, do you have access to the size of the  
>>> list
>>> before the loop? If so, couldn't you just put in the size of the  
>>> list in
>>> a @Hidden (before the loop) and use a listener with the @Hidden to
>>> re-instantiate the list? I've used this strategy several times with
>>> success. But... maybe I'm missing something? :)
>>>
>>> Robert
>>>
>>>
>>>>
>>>> I hope I'm explaining this well enough.  Any suggestions would be
>>>> greatly appreciated.
>>>>
>>>> Thanks,
>>>> e.
>>>> -------------------------------------------------------------------
>>>> --
>>>> To unsubscribe, e-mail: tapestry-user-
>>>> [hidden email]
>>>> For additional commands, e-mail: tapestry-user-  
>>>> [hidden email]
>>>>
>>>>
>>>
>>>
>>> --------------------------------------------------------------------
>>> -
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: tapestry-user-
>>> [hidden email]
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: tapestry-user-
>> [hidden email]
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: Reference asset from css [auf Viren geprueft]

David Leangen
In reply to this post by Jonathan O'Connor

Actually, I have a similar question... I haven't yet tried, but since this
thread is on the same topic, I just thought I'd ask.

It would be nice to be able to dynamically generate CSS. Is there a (simple)
way this could be done?

One complicated way is to have Tapestry generate an XML file and transform
the XML file to output CSS, but that seems a bit to heavy.


Any ideas?


:dml




-----Original Message-----
From: Jonathan O'Connor [mailto:[hidden email]]
Sent: 19 May 2005 17:33
To: Tapestry users
Subject: Re: Reference asset from css [auf Viren geprueft]


Hugo,
url references in a css file are always relative to the location of the css
file. You may have to create your own asset service, and ../.. your way up
to that.
Unless you are creating assets on the fly or selecting language specific
assets, if you expose your images directory, it'll work fine without an
asset.
Ciao,
Jonathan O'Connor
XCOM Dublin
Hugo Palma <[hidden email]>


Hugo Palma <[hidden email]>
18/05/2005 18:54 Please respond to
"Tapestry users" <[hidden email]>


To
[hidden email]


cc



Subject
Reference asset from css [auf Viren geprueft]



Is there anyway i can reference an asset from a css ?
I would like the css not to reference the images directly but to use
tapestry assets instead, but i have no idea on how to do this. Is it
possible ?


Cheers

Hugo

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]





IBM Workplace 2.5 Launch Events:
XCOM AG und IBM laden zum weltweiten Launch von IBM Workplace Collaboration
Services 2.5 nach Duesseldorf, Frankfurt und Berlin:
http://lotus.xcom.de/events

XCOM Express Programm:
Der schnelle Einstieg in neueste Technologien zum kleinen Preis - Portale,
e-Mail Security und Mobility: http://lotus.xcom.de/express


*** XCOM AG Legal Disclaimer ***

Diese E-Mail einschliesslich ihrer Anhaenge ist vertraulich und ist allein
f?r den Gebrauch durch den vorgesehenen Empfaenger bestimmt. Dritten ist das
Lesen, Verteilen oder Weiterleiten dieser E-Mail untersagt. Wir bitten, eine
fehlgeleitete E-Mail unverzueglich vollstaendig zu loeschen und uns eine
Nachricht zukommen zu lassen.

This email may contain material that is confidential and for the sole use of
the intended recipient. Any review, distribution by others or forwarding
without express permission is strictly prohibited. If you are not the
intended recipient, please contact the sender and delete all copies.


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Reference asset from css [auf Viren geprueft]

Random Tapestry User
Ideally, you probably have an "images" directory that is probably a peer
directory to your "css" directory.
You simply reference the images with  "../images/whateverImage.gif"

Here's an examply from my .css file :

.titleGradient
{
    text-align: top;
    background: url(../images/title-gradient.gif) 0px 0px repeat-y;
}

all works great

Regards,
tappapp


David Leangen wrote:

>Actually, I have a similar question... I haven't yet tried, but since this
>thread is on the same topic, I just thought I'd ask.
>
>It would be nice to be able to dynamically generate CSS. Is there a (simple)
>way this could be done?
>
>One complicated way is to have Tapestry generate an XML file and transform
>the XML file to output CSS, but that seems a bit to heavy.
>
>
>Any ideas?
>
>
>:dml
>
>
>
>
>-----Original Message-----
>From: Jonathan O'Connor [mailto:[hidden email]]
>Sent: 19 May 2005 17:33
>To: Tapestry users
>Subject: Re: Reference asset from css [auf Viren geprueft]
>
>
>Hugo,
>url references in a css file are always relative to the location of the css
>file. You may have to create your own asset service, and ../.. your way up
>to that.
>Unless you are creating assets on the fly or selecting language specific
>assets, if you expose your images directory, it'll work fine without an
>asset.
>Ciao,
>Jonathan O'Connor
>XCOM Dublin
>Hugo Palma <[hidden email]>
>
>
>Hugo Palma <[hidden email]>
>18/05/2005 18:54 Please respond to
>"Tapestry users" <[hidden email]>
>
>
>To
>[hidden email]
>
>
>cc
>
>
>
>Subject
>Reference asset from css [auf Viren geprueft]
>
>
>
>Is there anyway i can reference an asset from a css ?
>I would like the css not to reference the images directly but to use
>tapestry assets instead, but i have no idea on how to do this. Is it
>possible ?
>
>
>Cheers
>
>Hugo
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [hidden email]
>For additional commands, e-mail: [hidden email]
>
>
>
>
>
>IBM Workplace 2.5 Launch Events:
>XCOM AG und IBM laden zum weltweiten Launch von IBM Workplace Collaboration
>Services 2.5 nach Duesseldorf, Frankfurt und Berlin:
>http://lotus.xcom.de/events
>
>XCOM Express Programm:
>Der schnelle Einstieg in neueste Technologien zum kleinen Preis - Portale,
>e-Mail Security und Mobility: http://lotus.xcom.de/express
>
>
>*** XCOM AG Legal Disclaimer ***
>
>Diese E-Mail einschliesslich ihrer Anhaenge ist vertraulich und ist allein
>f?r den Gebrauch durch den vorgesehenen Empfaenger bestimmt. Dritten ist das
>Lesen, Verteilen oder Weiterleiten dieser E-Mail untersagt. Wir bitten, eine
>fehlgeleitete E-Mail unverzueglich vollstaendig zu loeschen und uns eine
>Nachricht zukommen zu lassen.
>
>This email may contain material that is confidential and for the sole use of
>the intended recipient. Any review, distribution by others or forwarding
>without express permission is strictly prohibited. If you are not the
>intended recipient, please contact the sender and delete all copies.
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [hidden email]
>For additional commands, e-mail: [hidden email]
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: Reference asset from css [auf Viren geprueft]

David Leangen

Hi, Random Tapestry User, or tappapp, whichever you prefer...

> > It would be nice to be able to dynamically generate CSS. Is
> > there a (simple) way this could be done?

> Ideally, you probably have an "images" directory that is probably a
> peer directory to your "css" directory.


Sorry that my question was not so clear.

You gave the example :

.titleGradient
{
    text-align: top;
    background: url(../images/title-gradient.gif) 0px 0px repeat-y;
}


But what if I want "text-align: top" in one case, but "text-align: bottom"
in another?

Now, I know very well I could have two classes, like "titleGradientTop" and
"titleGradientBottom", and set the class being used dynamically. The problem
with this is that it clutters up the CSS. If you think about all the
possible combinations of styles, it's just not practical. It just seems so
much elegant and useful to be able to generate the CSS dynamically.


It would be very useful to be able to do something like:

public void setTitleGradientCssClass(final Object testParam)
{

    if ( testParam.isSomeTestTrue )
    {
        getCss().getText().setAlign(TOP);
    |
    else
    {
        getCss().getText().setAlign(BOTTOM);
    }

}


Cheers,
Dave



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Reference asset from css [auf Viren geprueft]

Random Tapestry User
Dave,

I see what you're saying. I thought you were specifically referring only
to the image issue.
What your considering is conditional CSS, which yes, is a bit different.
You might consider maybe the simplest approach by having one stylesheet
with all the common stuff that is not variable, and conditionally
include the other stylesheets based on your criteria.

In my case, I did that (briefly, until I worked out the issue) to
include one stylesheed for MSIE, and another for Firefox/Mozilla.

Regards,
tappapp

David Leangen wrote:

>Hi, Random Tapestry User, or tappapp, whichever you prefer...
>
>  
>
>>>It would be nice to be able to dynamically generate CSS. Is
>>>there a (simple) way this could be done?
>>>      
>>>
>
>  
>
>>Ideally, you probably have an "images" directory that is probably a
>>peer directory to your "css" directory.
>>    
>>
>
>
>Sorry that my question was not so clear.
>
>You gave the example :
>
>.titleGradient
>{
>    text-align: top;
>    background: url(../images/title-gradient.gif) 0px 0px repeat-y;
>}
>
>
>But what if I want "text-align: top" in one case, but "text-align: bottom"
>in another?
>
>Now, I know very well I could have two classes, like "titleGradientTop" and
>"titleGradientBottom", and set the class being used dynamically. The problem
>with this is that it clutters up the CSS. If you think about all the
>possible combinations of styles, it's just not practical. It just seems so
>much elegant and useful to be able to generate the CSS dynamically.
>
>
>It would be very useful to be able to do something like:
>
>public void setTitleGradientCssClass(final Object testParam)
>{
>
>    if ( testParam.isSomeTestTrue )
>    {
>        getCss().getText().setAlign(TOP);
>    |
>    else
>    {
>        getCss().getText().setAlign(BOTTOM);
>    }
>
>}
>
>
>Cheers,
>Dave
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [hidden email]
>For additional commands, e-mail: [hidden email]
>
>
>  
>

Reply | Threaded
Open this post in threaded view
|

Re: Reference asset from css [auf Viren geprueft]

Pablo Ruggia
In reply to this post by David Leangen
I can't get what you really want, or the way you want to do it. But
i'll try to guess.

If you wan't to change or override some css class property you can use
the html syle attribute.
Perhaps something like this in your template:

<div jwcid="@Any" class="baseClasss"
style="ognl:getStyleForMe('thisIsAParameter', 'andThisIsAnother') />

And in your page class or it's superclass you define the method:
public String getStyleForMe(String param1, String param2);

It's the simple approach, obviously.

Also, you can define a servlet or an engine service and include a
<link rel ......   to that servlet or service url, and in it's service
method you can do some logic to output a css with the classes you want
created dinamically. I don't like this approach. I like to keep things
simple.





On 5/20/05, David Leangen <[hidden email]> wrote:

>
> Hi, Random Tapestry User, or tappapp, whichever you prefer...
>
> > > It would be nice to be able to dynamically generate CSS. Is
> > > there a (simple) way this could be done?
>
> > Ideally, you probably have an "images" directory that is probably a
> > peer directory to your "css" directory.
>
>
> Sorry that my question was not so clear.
>
> You gave the example :
>
> .titleGradient
> {
>     text-align: top;
>     background: url(../images/title-gradient.gif) 0px 0px repeat-y;
> }
>
>
> But what if I want "text-align: top" in one case, but "text-align: bottom"
> in another?
>
> Now, I know very well I could have two classes, like "titleGradientTop" and
> "titleGradientBottom", and set the class being used dynamically. The problem
> with this is that it clutters up the CSS. If you think about all the
> possible combinations of styles, it's just not practical. It just seems so
> much elegant and useful to be able to generate the CSS dynamically.
>
>
> It would be very useful to be able to do something like:
>
> public void setTitleGradientCssClass(final Object testParam)
> {
>
>     if ( testParam.isSomeTestTrue )
>     {
>         getCss().getText().setAlign(TOP);
>     |
>     else
>     {
>         getCss().getText().setAlign(BOTTOM);
>     }
>
> }
>
>
> Cheers,
> Dave
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Reference asset from css [auf Viren geprueft]

Hugo Palma
In reply to this post by Jonathan O'Connor
That doesn't work if the css and the images are bundled as a component
in a library.
What i have is a Border component bundled in a library, this component
has a .css and some images. None of these are in the webcontext because
they are in the library archive. So my problem is: how do i reference
the component images from the component css ? I've tried relative path
but it doesn't work.


Cheers

Hugo

Jonathan O'Connor wrote:

> Hugo,
> url references in a css file are always relative to the location of
> the css file. You may have to create your own asset service, and ../..
> your way up to that.
> Unless you are creating assets on the fly or selecting language
> specific assets, if you expose your images directory, it'll work fine
> without an asset.
> Ciao,
> Jonathan O'Connor
> XCOM Dublin
> Inactive hide details for Hugo Palma <[hidden email]>Hugo Palma
> <[hidden email]>
>
>
>                         *Hugo Palma <[hidden email]>*
>
>                         18/05/2005 18:54
>                         Please respond to
>                         "Tapestry users"
>                         <[hidden email]>
>
>
>
> To
>
> [hidden email]
>
> cc
>
>
> Subject
>
> Reference asset from css [auf Viren geprueft]
>
>
>
>
> Is there anyway i can reference an asset from a css ?
> I would like the css not to reference the images directly but to use
> tapestry assets instead, but i have no idea on how to do this. Is it
> possible ?
>
>
> Cheers
>
> Hugo
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
>
>
>
> IBM Workplace 2.5 Launch Events:
> XCOM AG und IBM laden zum weltweiten Launch von IBM Workplace
> Collaboration Services 2.5 nach Duesseldorf, Frankfurt und Berlin:
> http://lotus.xcom.de/events
>
> XCOM Express Programm:
> Der schnelle Einstieg in neueste Technologien zum kleinen Preis -
> Portale, e-Mail Security und Mobility: http://lotus.xcom.de/express
>
>
> *** XCOM AG Legal Disclaimer ***
>
> Diese E-Mail einschliesslich ihrer Anhaenge ist vertraulich und ist
> allein für den Gebrauch durch den vorgesehenen Empfaenger bestimmt.
> Dritten ist das Lesen, Verteilen oder Weiterleiten dieser E-Mail
> untersagt. Wir bitten, eine fehlgeleitete E-Mail unverzueglich
> vollstaendig zu loeschen und uns eine Nachricht zukommen zu lassen.
>
> This email may contain material that is confidential and for the sole
> use of the intended recipient. Any review, distribution by others or
> forwarding without express permission is strictly prohibited. If you
> are not the intended recipient, please contact the sender and delete
> all copies.
>
Reply | Threaded
Open this post in threaded view
|

Re: Reference asset from css [auf Viren geprueft]

Andreas Andreou-4
Maybe, instead of a static css,
you need to create a Tapestry page that ouputs css data, and that gets
included as a css in other pages.
In that page, you can then define private-assets for the images, and
output their URLs where needed.
So,
1) You need to write some code to extract the URL from an asset (see
IAsset.buildURL(cycle) )
2) You need to be able to include a Tapestry page as stylesheet (the
Shell components only accepts IAsset for stylesheet)

Hugo Palma wrote:

> That doesn't work if the css and the images are bundled as a component
> in a library.
> What i have is a Border component bundled in a library, this component
> has a .css and some images. None of these are in the webcontext
> because they are in the library archive. So my problem is: how do i
> reference the component images from the component css ? I've tried
> relative path but it doesn't work.
>
>
> Cheers
>
> Hugo
>
> Jonathan O'Connor wrote:
>
>> Hugo,
>> url references in a css file are always relative to the location of
>> the css file. You may have to create your own asset service, and
>> ../.. your way up to that.
>> Unless you are creating assets on the fly or selecting language
>> specific assets, if you expose your images directory, it'll work fine
>> without an asset.
>> Ciao,
>> Jonathan O'Connor
>> XCOM Dublin
>> Inactive hide details for Hugo Palma <[hidden email]>Hugo Palma
>> <[hidden email]>
>>
>>
>>                         *Hugo Palma <[hidden email]>*
>>
>>                         18/05/2005 18:54
>>                         Please respond to
>>                         "Tapestry users"
>>                         <[hidden email]>
>>
>>    
>>
>> To
>>    
>> [hidden email]
>>
>> cc
>>    
>>
>> Subject
>>    
>> Reference asset from css [auf Viren geprueft]
>>
>>    
>>
>>
>> Is there anyway i can reference an asset from a css ?
>> I would like the css not to reference the images directly but to use
>> tapestry assets instead, but i have no idea on how to do this. Is it
>> possible ?
>>
>>
>> Cheers
>>
>> Hugo
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>>
>>
>>
>> IBM Workplace 2.5 Launch Events:
>> XCOM AG und IBM laden zum weltweiten Launch von IBM Workplace
>> Collaboration Services 2.5 nach Duesseldorf, Frankfurt und Berlin:
>> http://lotus.xcom.de/events
>>
>> XCOM Express Programm:
>> Der schnelle Einstieg in neueste Technologien zum kleinen Preis -
>> Portale, e-Mail Security und Mobility: http://lotus.xcom.de/express
>>
>>
>> *** XCOM AG Legal Disclaimer ***
>>
>> Diese E-Mail einschliesslich ihrer Anhaenge ist vertraulich und ist
>> allein f?r den Gebrauch durch den vorgesehenen Empfaenger bestimmt.
>> Dritten ist das Lesen, Verteilen oder Weiterleiten dieser E-Mail
>> untersagt. Wir bitten, eine fehlgeleitete E-Mail unverzueglich
>> vollstaendig zu loeschen und uns eine Nachricht zukommen zu lassen.
>>
>> This email may contain material that is confidential and for the sole
>> use of the intended recipient. Any review, distribution by others or
>> forwarding without express permission is strictly prohibited. If you
>> are not the intended recipient, please contact the sender and delete
>> all copies.
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Reference asset from css

Alberto Lepe
In reply to this post by Hugo Palma
One way I think it is possible, is to serve the CSS file from
tapestry, for example,
your CSS file will be: mycss.html. At mycss.page, you can now include assets.

To include that css file, you will have to write:
<link href="/app?service=page/mycss" ... />

It's the only way I can think of it...

Maybe you can do it different: write down a normal servlet and keep on
a .property your path to your images...

Please visit: www.tapestryforums.com and join us!

Lepe.

2005/5/18, Hugo Palma <[hidden email]>:

> Is there anyway i can reference an asset from a css ?
> I would like the css not to reference the images directly but to use
> tapestry assets instead, but i have no idea on how to do this. Is it
> possible ?
>
> Cheers
>
> Hugo
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]