You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by zack1403 <za...@gmail.com> on 2008/05/23 00:33:42 UTC

Layout Attributes Shared

Hello all,

I have a layout component with a List full of my own message objects as an
attribute.  First off, it seems that these values are shared across
sessions/computers. Second, they persist until i either restart my server or
end the session.  Any ideas why an attribute of the layout class would be
acting like this?  Ideally I just want them to flash and then go away but
cant seem to get this to work.

Thanks in advance,
Zack
-- 
View this message in context: http://www.nabble.com/Layout-Attributes-Shared-tp17414894p17414894.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: Layout Attributes Shared

Posted by Josh Canfield <jo...@thedailytube.com>.
Oh, and since you are setting the messages in the action phase and
using them in your render phase you'll need to pass them through
probably using @Persist("flash") on your arraylist...

http://pastebin.com/m65d79b54
(nice tool...)

Josh

On Thu, May 22, 2008 at 4:38 PM, Josh Canfield <jo...@thedailytube.com> wrote:
> Ok, here is your problem:
>
> private List<Message> messages = new ArrayList<Message>();
>
> This is how you set up a default value for this page instance. When
> the page goes in or out of the page cache the values are reset to
> their initial state.
>
> You need to create the list of messages during the request. One method
> would be to create the List<Message> on demand. Modify the
> addMessage/addAllMessages methods to create the list if it's null, and
> expect null when you are rendering it.
>
> On a side note, the List interface has an addAll method, so you don't
> have to reimplement it...
>
>
> Josh
>
>
>
> On Thu, May 22, 2008 at 4:17 PM, zack1403 <za...@gmail.com> wrote:
>>
>> Hi Josh,
>>
>> Always cautious not to include code that would just confuse things :P
>>
>> My Layout component is here: http://pastebin.com/m4fd5d6a
>>
>> In my tml I am using the same line in all places (sans actual literal): <div
>> t:type="layout" t:title="literal:A title">
>>
>> A page of mine might look like this: http://pastebin.com/m415466a
>> Each of my pages extends a base page which has layout as a component.
>>
>> Thanks for your help.
>>
>> Zack
>>
>> I dont have this List<Message>
>>
>> joshcanfield wrote:
>>>
>>> Hey Zack,
>>>
>>> It's generally a good idea to post some code for us to look at when
>>> asking a question.
>>>
>>> You might be doing something like this:
>>>
>>> <html t:type="layout" t:yourProperty="${myprop}">
>>> </html>
>>>
>>> What you want is
>>>
>>> <html t:type="layout" t:yourProperty="myprop">
>>> </html>
>>>
>>> If that's not the case then show us some code from your template and java.
>>>
>>> Josh
>>>
>>>
>>
>> --
>> View this message in context: http://www.nabble.com/Layout-Attributes-Shared-tp17414894p17415541.html
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
>
>
> --
> --
> TheDailyTube.com. Sign up and get the best new videos on the internet
> delivered fresh to your inbox.
>



-- 
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.

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


Re: Layout Attributes Shared

Posted by Josh Canfield <jo...@thedailytube.com>.
Ok, here is your problem:

private List<Message> messages = new ArrayList<Message>();

This is how you set up a default value for this page instance. When
the page goes in or out of the page cache the values are reset to
their initial state.

You need to create the list of messages during the request. One method
would be to create the List<Message> on demand. Modify the
addMessage/addAllMessages methods to create the list if it's null, and
expect null when you are rendering it.

On a side note, the List interface has an addAll method, so you don't
have to reimplement it...


Josh



On Thu, May 22, 2008 at 4:17 PM, zack1403 <za...@gmail.com> wrote:
>
> Hi Josh,
>
> Always cautious not to include code that would just confuse things :P
>
> My Layout component is here: http://pastebin.com/m4fd5d6a
>
> In my tml I am using the same line in all places (sans actual literal): <div
> t:type="layout" t:title="literal:A title">
>
> A page of mine might look like this: http://pastebin.com/m415466a
> Each of my pages extends a base page which has layout as a component.
>
> Thanks for your help.
>
> Zack
>
> I dont have this List<Message>
>
> joshcanfield wrote:
>>
>> Hey Zack,
>>
>> It's generally a good idea to post some code for us to look at when
>> asking a question.
>>
>> You might be doing something like this:
>>
>> <html t:type="layout" t:yourProperty="${myprop}">
>> </html>
>>
>> What you want is
>>
>> <html t:type="layout" t:yourProperty="myprop">
>> </html>
>>
>> If that's not the case then show us some code from your template and java.
>>
>> Josh
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Layout-Attributes-Shared-tp17414894p17415541.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.

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


Re: Layout Attributes Shared

Posted by zack1403 <za...@gmail.com>.
Hi Josh,

Always cautious not to include code that would just confuse things :P

My Layout component is here: http://pastebin.com/m4fd5d6a

In my tml I am using the same line in all places (sans actual literal): <div
t:type="layout" t:title="literal:A title">

A page of mine might look like this: http://pastebin.com/m415466a
Each of my pages extends a base page which has layout as a component.

Thanks for your help.

Zack

I dont have this List<Message>

joshcanfield wrote:
> 
> Hey Zack,
> 
> It's generally a good idea to post some code for us to look at when
> asking a question.
> 
> You might be doing something like this:
> 
> <html t:type="layout" t:yourProperty="${myprop}">
> </html>
> 
> What you want is
> 
> <html t:type="layout" t:yourProperty="myprop">
> </html>
> 
> If that's not the case then show us some code from your template and java.
> 
> Josh
> 
> 

-- 
View this message in context: http://www.nabble.com/Layout-Attributes-Shared-tp17414894p17415541.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: Layout Attributes Shared

Posted by Josh Canfield <jo...@thedailytube.com>.
Hey Zack,

It's generally a good idea to post some code for us to look at when
asking a question.

You might be doing something like this:

<html t:type="layout" t:yourProperty="${myprop}">
</html>

What you want is

<html t:type="layout" t:yourProperty="myprop">
</html>

If that's not the case then show us some code from your template and java.

Josh

On Thu, May 22, 2008 at 3:33 PM, zack1403 <za...@gmail.com> wrote:
>
> Hello all,
>
> I have a layout component with a List full of my own message objects as an
> attribute.  First off, it seems that these values are shared across
> sessions/computers. Second, they persist until i either restart my server or
> end the session.  Any ideas why an attribute of the layout class would be
> acting like this?  Ideally I just want them to flash and then go away but
> cant seem to get this to work.
>
> Thanks in advance,
> Zack
> --
> View this message in context: http://www.nabble.com/Layout-Attributes-Shared-tp17414894p17414894.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.

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


Re: Layout Attributes Shared

Posted by zack1403 <za...@gmail.com>.
I posed the previous message before you posted yours.  I'll give this another
try before moving to an ASO! Thank you Josh.


joshcanfield wrote:
> 
>> Hey guys thanks a lot for you help so far.  Josh, I have tried adding
>> @Persist("flash") to many different parts with no apparent luck.
> 
> Your original problem was that you are initializing the list when you
> declare it. Did you fix that? I provided a link to updated code before
> which had a compile error, I've stuck this into a test project and it
> works fine, here are the files (the packages are different, and I
> changed Layout2 to Layout before I decided to upload the other
> files...)
> 
> Layout.java: http://pastebin.com/m3ae085a2
> Index.java: http://pastebin.com/m116c1dd1
> Index.tml: http://pastebin.com/m4e494928
> News.java: http://pastebin.com/m265a4f
> News.tml: http://pastebin.com/mc71972f
> 
> Josh
> 
> On Fri, May 23, 2008 at 8:20 AM, zack1403 <za...@gmail.com> wrote:
>>
>> Hey guys thanks a lot for you help so far.  Josh, I have tried adding
>> @Persist("flash") to many different parts with no apparent luck.  Filip,
>> is
>> there a way I can utilize my list of messages from my template component
>> when the list is an attribute of the page?  I obviously get the Could not
>> convert 'messages' into a component parameter binding because the message
>> display is part of the component tml.  I could see moving my messages
>> into
>> my generic page but I get that error. How do you see that working without
>> having a list attribute in my component?
>>
>> Thanks again,
>> Zack
>>
>> Filip S. Adamsen-2 wrote:
>>>
>>> No luck? That sucks. =/
>>>
>>> I thought occured to me just before I fell asleep last night, though.
>>> Perhaps you should store the messages directly in your pages instead and
>>> pass them on to your layout? That's how I would do it, anyhow.
>>>
>>> You could wrap the add functions in a MessageHolder class that you can
>>> easily pass to your layout. Maybe that will work...
>>>
>>> -Filip
>>>
>>> zack1403 skrev:
>>>> Yea I've tried multiple different combinations of @Persist to get
>>>> something
>>>> to work on my pages and  component with no luck.  Thanks anyways for
>>>> your
>>>> help Filip.
>>>>
>>>> Zack
>>>>
>>>> Filip S. Adamsen-2 wrote:
>>>>> You say you added @Persist("flash") to your pages, but the information
>>>>> you're storing doesn't go into the page, but into the component. I
>>>>> think
>>>>> you'll have to put @Persist("flash") on your list of messages in your
>>>>> Layout component.
>>>>>
>>>>> If that doesn't solve it, I'm afraid I don't know what the problem is.
>>>>> Hopefully someone else will be able to help you, then.
>>>>>
>>>>> -Filip
>>>>>
>>>>> On 2008-05-23 01:20, zack1403 wrote:
>>>>>> Filip,
>>>>>>
>>>>>> One of the first things I added was @Persist("flash") to my pages
>>>>>> with
>>>>>> no
>>>>>> luck.  Still the same behavior.  Even with the pages pooled should
>>>>>> they
>>>>>> share attribute values across sessions?
>>>>>>
>>>>>>
>>>>>> Filip S. Adamsen-2 wrote:
>>>>>>> Working as intended. Tapestry uses a page pool which means that you
>>>>>>> have
>>>>>>> to use some sort of persistence to make this work:
>>>>>>> http://tapestry.apache.org/tapestry5/tapestry-core/guide/persist.html
>>>>>>>
>>>>>>> -Filip
>>>>>>>
>>>>>>> On 2008-05-23 00:45, zack1403 wrote:
>>>>>>>> No.  Not using any persist.  I really dont have anything else
>>>>>>>> besides
>>>>>>>> a
>>>>>>>> title
>>>>>>>> and this list of messages.  When I move from page to page I might
>>>>>>>> inject
>>>>>>>> my
>>>>>>>> layout and add a message to this list for display.  They get
>>>>>>>> persisted
>>>>>>>> without any sort of persist.
>>>>>>>>
>>>>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Layout-Attributes-Shared-tp17414894p17427911.html
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
> 
> 
> 
> -- 
> --
> TheDailyTube.com. Sign up and get the best new videos on the internet
> delivered fresh to your inbox.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Layout-Attributes-Shared-tp17414894p17441477.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: Layout Attributes Shared

Posted by zack1403 <za...@gmail.com>.
Yea I meant I would set it onActivate of every page (which was a mess). 
Thanks again for your help.

Zack 


joshcanfield wrote:
> 
> 
> Yeah, onActivate doesn't get called for your components, it's a
> page-level event.
> 
> 

-- 
View this message in context: http://www.nabble.com/Layout-Attributes-Shared-tp17414894p17442484.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: Layout Attributes Shared

Posted by Josh Canfield <jo...@thedailytube.com>.
> but I just stuck initialization in the onActivate method instead of handling
> it per method like your example (instantiating the list in onActivate doesnt
> work).

Yeah, onActivate doesn't get called for your components, it's a
page-level event.

> This issue
> might be something worth mentioning somewhere in the documentation because
> its definitely a security issue.

Hmm... I thought I read about it somewhere, but I looked around and
couldn't find any documentation about the initialization behavior...

Josh

On Fri, May 23, 2008 at 3:04 PM, zack1403 <za...@gmail.com> wrote:
>
> Josh you rock man.  We talked about the initialization problem on #tapestry
> but I just stuck initialization in the onActivate method instead of handling
> it per method like your example (instantiating the list in onActivate doesnt
> work).  I would have never suspected that to be the problem. This issue
> might be something worth mentioning somewhere in the documentation because
> its definitely a security issue.  Every time I post a question to this list
> I no only  get my question answered but I learn heaps more about tapestry.
> I'm sure ASO would have worked just fine but fixing this saved me some time.
> Thanks everyone!
>
> Zack
>
> joshcanfield wrote:
>>
>>> Hey guys thanks a lot for you help so far.  Josh, I have tried adding
>>> @Persist("flash") to many different parts with no apparent luck.
>>
>> Your original problem was that you are initializing the list when you
>> declare it. Did you fix that? I provided a link to updated code before
>> which had a compile error, I've stuck this into a test project and it
>> works fine, here are the files (the packages are different, and I
>> changed Layout2 to Layout before I decided to upload the other
>> files...)
>>
>> Layout.java: http://pastebin.com/m3ae085a2
>> Index.java: http://pastebin.com/m116c1dd1
>> Index.tml: http://pastebin.com/m4e494928
>> News.java: http://pastebin.com/m265a4f
>> News.tml: http://pastebin.com/mc71972f
>>
>> Josh
>>
>> On Fri, May 23, 2008 at 8:20 AM, zack1403 <za...@gmail.com> wrote:
>>>
>>> Hey guys thanks a lot for you help so far.  Josh, I have tried adding
>>> @Persist("flash") to many different parts with no apparent luck.  Filip,
>>> is
>>> there a way I can utilize my list of messages from my template component
>>> when the list is an attribute of the page?  I obviously get the Could not
>>> convert 'messages' into a component parameter binding because the message
>>> display is part of the component tml.  I could see moving my messages
>>> into
>>> my generic page but I get that error. How do you see that working without
>>> having a list attribute in my component?
>>>
>>> Thanks again,
>>> Zack
>>>
>>> Filip S. Adamsen-2 wrote:
>>>>
>>>> No luck? That sucks. =/
>>>>
>>>> I thought occured to me just before I fell asleep last night, though.
>>>> Perhaps you should store the messages directly in your pages instead and
>>>> pass them on to your layout? That's how I would do it, anyhow.
>>>>
>>>> You could wrap the add functions in a MessageHolder class that you can
>>>> easily pass to your layout. Maybe that will work...
>>>>
>>>> -Filip
>>>>
>>>> zack1403 skrev:
>>>>> Yea I've tried multiple different combinations of @Persist to get
>>>>> something
>>>>> to work on my pages and  component with no luck.  Thanks anyways for
>>>>> your
>>>>> help Filip.
>>>>>
>>>>> Zack
>>>>>
>>>>> Filip S. Adamsen-2 wrote:
>>>>>> You say you added @Persist("flash") to your pages, but the information
>>>>>> you're storing doesn't go into the page, but into the component. I
>>>>>> think
>>>>>> you'll have to put @Persist("flash") on your list of messages in your
>>>>>> Layout component.
>>>>>>
>>>>>> If that doesn't solve it, I'm afraid I don't know what the problem is.
>>>>>> Hopefully someone else will be able to help you, then.
>>>>>>
>>>>>> -Filip
>>>>>>
>>>>>> On 2008-05-23 01:20, zack1403 wrote:
>>>>>>> Filip,
>>>>>>>
>>>>>>> One of the first things I added was @Persist("flash") to my pages
>>>>>>> with
>>>>>>> no
>>>>>>> luck.  Still the same behavior.  Even with the pages pooled should
>>>>>>> they
>>>>>>> share attribute values across sessions?
>>>>>>>
>>>>>>>
>>>>>>> Filip S. Adamsen-2 wrote:
>>>>>>>> Working as intended. Tapestry uses a page pool which means that you
>>>>>>>> have
>>>>>>>> to use some sort of persistence to make this work:
>>>>>>>> http://tapestry.apache.org/tapestry5/tapestry-core/guide/persist.html
>>>>>>>>
>>>>>>>> -Filip
>>>>>>>>
>>>>>>>> On 2008-05-23 00:45, zack1403 wrote:
>>>>>>>>> No.  Not using any persist.  I really dont have anything else
>>>>>>>>> besides
>>>>>>>>> a
>>>>>>>>> title
>>>>>>>>> and this list of messages.  When I move from page to page I might
>>>>>>>>> inject
>>>>>>>>> my
>>>>>>>>> layout and add a message to this list for display.  They get
>>>>>>>>> persisted
>>>>>>>>> without any sort of persist.
>>>>>>>>>
>>>>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>>
>>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Layout-Attributes-Shared-tp17414894p17427911.html
>>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>
>>
>>
>> --
>> --
>> TheDailyTube.com. Sign up and get the best new videos on the internet
>> delivered fresh to your inbox.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Layout-Attributes-Shared-tp17414894p17441773.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.

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


Re: Layout Attributes Shared

Posted by zack1403 <za...@gmail.com>.
Josh you rock man.  We talked about the initialization problem on #tapestry
but I just stuck initialization in the onActivate method instead of handling
it per method like your example (instantiating the list in onActivate doesnt
work).  I would have never suspected that to be the problem. This issue
might be something worth mentioning somewhere in the documentation because
its definitely a security issue.  Every time I post a question to this list
I no only  get my question answered but I learn heaps more about tapestry. 
I'm sure ASO would have worked just fine but fixing this saved me some time.
Thanks everyone! 

Zack

joshcanfield wrote:
> 
>> Hey guys thanks a lot for you help so far.  Josh, I have tried adding
>> @Persist("flash") to many different parts with no apparent luck.
> 
> Your original problem was that you are initializing the list when you
> declare it. Did you fix that? I provided a link to updated code before
> which had a compile error, I've stuck this into a test project and it
> works fine, here are the files (the packages are different, and I
> changed Layout2 to Layout before I decided to upload the other
> files...)
> 
> Layout.java: http://pastebin.com/m3ae085a2
> Index.java: http://pastebin.com/m116c1dd1
> Index.tml: http://pastebin.com/m4e494928
> News.java: http://pastebin.com/m265a4f
> News.tml: http://pastebin.com/mc71972f
> 
> Josh
> 
> On Fri, May 23, 2008 at 8:20 AM, zack1403 <za...@gmail.com> wrote:
>>
>> Hey guys thanks a lot for you help so far.  Josh, I have tried adding
>> @Persist("flash") to many different parts with no apparent luck.  Filip,
>> is
>> there a way I can utilize my list of messages from my template component
>> when the list is an attribute of the page?  I obviously get the Could not
>> convert 'messages' into a component parameter binding because the message
>> display is part of the component tml.  I could see moving my messages
>> into
>> my generic page but I get that error. How do you see that working without
>> having a list attribute in my component?
>>
>> Thanks again,
>> Zack
>>
>> Filip S. Adamsen-2 wrote:
>>>
>>> No luck? That sucks. =/
>>>
>>> I thought occured to me just before I fell asleep last night, though.
>>> Perhaps you should store the messages directly in your pages instead and
>>> pass them on to your layout? That's how I would do it, anyhow.
>>>
>>> You could wrap the add functions in a MessageHolder class that you can
>>> easily pass to your layout. Maybe that will work...
>>>
>>> -Filip
>>>
>>> zack1403 skrev:
>>>> Yea I've tried multiple different combinations of @Persist to get
>>>> something
>>>> to work on my pages and  component with no luck.  Thanks anyways for
>>>> your
>>>> help Filip.
>>>>
>>>> Zack
>>>>
>>>> Filip S. Adamsen-2 wrote:
>>>>> You say you added @Persist("flash") to your pages, but the information
>>>>> you're storing doesn't go into the page, but into the component. I
>>>>> think
>>>>> you'll have to put @Persist("flash") on your list of messages in your
>>>>> Layout component.
>>>>>
>>>>> If that doesn't solve it, I'm afraid I don't know what the problem is.
>>>>> Hopefully someone else will be able to help you, then.
>>>>>
>>>>> -Filip
>>>>>
>>>>> On 2008-05-23 01:20, zack1403 wrote:
>>>>>> Filip,
>>>>>>
>>>>>> One of the first things I added was @Persist("flash") to my pages
>>>>>> with
>>>>>> no
>>>>>> luck.  Still the same behavior.  Even with the pages pooled should
>>>>>> they
>>>>>> share attribute values across sessions?
>>>>>>
>>>>>>
>>>>>> Filip S. Adamsen-2 wrote:
>>>>>>> Working as intended. Tapestry uses a page pool which means that you
>>>>>>> have
>>>>>>> to use some sort of persistence to make this work:
>>>>>>> http://tapestry.apache.org/tapestry5/tapestry-core/guide/persist.html
>>>>>>>
>>>>>>> -Filip
>>>>>>>
>>>>>>> On 2008-05-23 00:45, zack1403 wrote:
>>>>>>>> No.  Not using any persist.  I really dont have anything else
>>>>>>>> besides
>>>>>>>> a
>>>>>>>> title
>>>>>>>> and this list of messages.  When I move from page to page I might
>>>>>>>> inject
>>>>>>>> my
>>>>>>>> layout and add a message to this list for display.  They get
>>>>>>>> persisted
>>>>>>>> without any sort of persist.
>>>>>>>>
>>>>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Layout-Attributes-Shared-tp17414894p17427911.html
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
> 
> 
> 
> -- 
> --
> TheDailyTube.com. Sign up and get the best new videos on the internet
> delivered fresh to your inbox.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Layout-Attributes-Shared-tp17414894p17441773.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: Layout Attributes Shared

Posted by Josh Canfield <jo...@thedailytube.com>.
> Hey guys thanks a lot for you help so far.  Josh, I have tried adding
> @Persist("flash") to many different parts with no apparent luck.

Your original problem was that you are initializing the list when you
declare it. Did you fix that? I provided a link to updated code before
which had a compile error, I've stuck this into a test project and it
works fine, here are the files (the packages are different, and I
changed Layout2 to Layout before I decided to upload the other
files...)

Layout.java: http://pastebin.com/m3ae085a2
Index.java: http://pastebin.com/m116c1dd1
Index.tml: http://pastebin.com/m4e494928
News.java: http://pastebin.com/m265a4f
News.tml: http://pastebin.com/mc71972f

Josh

On Fri, May 23, 2008 at 8:20 AM, zack1403 <za...@gmail.com> wrote:
>
> Hey guys thanks a lot for you help so far.  Josh, I have tried adding
> @Persist("flash") to many different parts with no apparent luck.  Filip, is
> there a way I can utilize my list of messages from my template component
> when the list is an attribute of the page?  I obviously get the Could not
> convert 'messages' into a component parameter binding because the message
> display is part of the component tml.  I could see moving my messages into
> my generic page but I get that error. How do you see that working without
> having a list attribute in my component?
>
> Thanks again,
> Zack
>
> Filip S. Adamsen-2 wrote:
>>
>> No luck? That sucks. =/
>>
>> I thought occured to me just before I fell asleep last night, though.
>> Perhaps you should store the messages directly in your pages instead and
>> pass them on to your layout? That's how I would do it, anyhow.
>>
>> You could wrap the add functions in a MessageHolder class that you can
>> easily pass to your layout. Maybe that will work...
>>
>> -Filip
>>
>> zack1403 skrev:
>>> Yea I've tried multiple different combinations of @Persist to get
>>> something
>>> to work on my pages and  component with no luck.  Thanks anyways for your
>>> help Filip.
>>>
>>> Zack
>>>
>>> Filip S. Adamsen-2 wrote:
>>>> You say you added @Persist("flash") to your pages, but the information
>>>> you're storing doesn't go into the page, but into the component. I think
>>>> you'll have to put @Persist("flash") on your list of messages in your
>>>> Layout component.
>>>>
>>>> If that doesn't solve it, I'm afraid I don't know what the problem is.
>>>> Hopefully someone else will be able to help you, then.
>>>>
>>>> -Filip
>>>>
>>>> On 2008-05-23 01:20, zack1403 wrote:
>>>>> Filip,
>>>>>
>>>>> One of the first things I added was @Persist("flash") to my pages with
>>>>> no
>>>>> luck.  Still the same behavior.  Even with the pages pooled should they
>>>>> share attribute values across sessions?
>>>>>
>>>>>
>>>>> Filip S. Adamsen-2 wrote:
>>>>>> Working as intended. Tapestry uses a page pool which means that you
>>>>>> have
>>>>>> to use some sort of persistence to make this work:
>>>>>> http://tapestry.apache.org/tapestry5/tapestry-core/guide/persist.html
>>>>>>
>>>>>> -Filip
>>>>>>
>>>>>> On 2008-05-23 00:45, zack1403 wrote:
>>>>>>> No.  Not using any persist.  I really dont have anything else besides
>>>>>>> a
>>>>>>> title
>>>>>>> and this list of messages.  When I move from page to page I might
>>>>>>> inject
>>>>>>> my
>>>>>>> layout and add a message to this list for display.  They get
>>>>>>> persisted
>>>>>>> without any sort of persist.
>>>>>>>
>>>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>>
>>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Layout-Attributes-Shared-tp17414894p17427911.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.

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


Re: Layout Attributes Shared

Posted by zack1403 <za...@gmail.com>.
Josh, Filip, Thiago thanks again for your help.  An ASO is probably the best
option, good suggestion Thiago.  Josh I think at one point I had tried
removing the initialization of the list which seemed to have the same effect
but I think I'm putting more work into this than I need to. I am coming from
Stripes in which you have a built in message list you use so I just
defaulted to that. ASO works great now!.  Thanks again for everyones help!

Zack

Filip S. Adamsen-2 wrote:
> 
> I think I just misunderstood your question.
> 
> By now I really think you should consider doing as Thiago suggested and 
> move the whole thing into an Application State Object. It'll take a bit 
> of work - you'll have to keep track of which messages to display on 
> which pages etc. - but it will probably be a cleaner, better solution in 
> the end.
> 
> -Filip
> 
> On 2008-05-23 23:13, zack1403 wrote:
>> Isnt that basically the same as having the attribute as part of the
>> Layout
>> class?  It just seems unnecessary to have to pass my message list to the
>> layout when it belongs in the layout component anyways.  Is this a
>> workaround to some issue?
>> 
>> Thanks,
>> Zack
>> 
>> Filip S. Adamsen-2 wrote:
>>> Hi again,
>>>
>>> You just need to pass it from your page to your layout.
>>>
>>> Page class:
>>>    @Property
>>>    private MessageHolder messages;
>>>
>>> Page template:
>>>    <t:layout t:messages="messages">...</t:layout>
>>>
>>> Layout class:
>>>    @Property
>>>    @Parameter
>>>    private MessageHolder messages;
>>>
>>> Layout template:
>>>    <t:loop t:source="messages" t:value="message">...</t:loop>
>>>
>>> Etc. etc.
>>>
>>> -Filip
>>>
>>> On 2008-05-23 17:20, zack1403 wrote:
>>>> Hey guys thanks a lot for you help so far.  Josh, I have tried adding
>>>> @Persist("flash") to many different parts with no apparent luck. 
>>>> Filip,
>>>> is
>>>> there a way I can utilize my list of messages from my template
>>>> component
>>>> when the list is an attribute of the page?  I obviously get the Could
>>>> not
>>>> convert 'messages' into a component parameter binding because the
>>>> message
>>>> display is part of the component tml.  I could see moving my messages
>>>> into
>>>> my generic page but I get that error. How do you see that working
>>>> without
>>>> having a list attribute in my component?
>>>>
>>>> Thanks again,
>>>> Zack
>>>>
>>>> Filip S. Adamsen-2 wrote:
>>>>> No luck? That sucks. =/
>>>>>
>>>>> I thought occured to me just before I fell asleep last night, though. 
>>>>> Perhaps you should store the messages directly in your pages instead
>>>>> and 
>>>>> pass them on to your layout? That's how I would do it, anyhow.
>>>>>
>>>>> You could wrap the add functions in a MessageHolder class that you can 
>>>>> easily pass to your layout. Maybe that will work...
>>>>>
>>>>> -Filip
>>>>>
>>>>> zack1403 skrev:
>>>>>> Yea I've tried multiple different combinations of @Persist to get
>>>>>> something
>>>>>> to work on my pages and  component with no luck.  Thanks anyways for
>>>>>> your
>>>>>> help Filip.
>>>>>>
>>>>>> Zack
>>>>>>
>>>>>> Filip S. Adamsen-2 wrote:
>>>>>>> You say you added @Persist("flash") to your pages, but the
>>>>>>> information 
>>>>>>> you're storing doesn't go into the page, but into the component. I
>>>>>>> think 
>>>>>>> you'll have to put @Persist("flash") on your list of messages in
>>>>>>> your 
>>>>>>> Layout component.
>>>>>>>
>>>>>>> If that doesn't solve it, I'm afraid I don't know what the problem
>>>>>>> is. 
>>>>>>> Hopefully someone else will be able to help you, then.
>>>>>>>
>>>>>>> -Filip
>>>>>>>
>>>>>>> On 2008-05-23 01:20, zack1403 wrote:
>>>>>>>> Filip,
>>>>>>>>
>>>>>>>> One of the first things I added was @Persist("flash") to my pages
>>>>>>>> with
>>>>>>>> no
>>>>>>>> luck.  Still the same behavior.  Even with the pages pooled should
>>>>>>>> they
>>>>>>>> share attribute values across sessions?
>>>>>>>>
>>>>>>>>
>>>>>>>> Filip S. Adamsen-2 wrote:
>>>>>>>>> Working as intended. Tapestry uses a page pool which means that
>>>>>>>>> you
>>>>>>>>> have 
>>>>>>>>> to use some sort of persistence to make this work:
>>>>>>>>> http://tapestry.apache.org/tapestry5/tapestry-core/guide/persist.html
>>>>>>>>>
>>>>>>>>> -Filip
>>>>>>>>>
>>>>>>>>> On 2008-05-23 00:45, zack1403 wrote:
>>>>>>>>>> No.  Not using any persist.  I really dont have anything else
>>>>>>>>>> besides
>>>>>>>>>> a
>>>>>>>>>> title
>>>>>>>>>> and this list of messages.  When I move from page to page I might
>>>>>>>>>> inject
>>>>>>>>>> my
>>>>>>>>>> layout and add a message to this list for display.  They get
>>>>>>>>>> persisted
>>>>>>>>>> without any sort of persist.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>
>>>>>>>
>>>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>
>>>>>
>>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>>
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Layout-Attributes-Shared-tp17414894p17441345.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: Layout Attributes Shared

Posted by "Filip S. Adamsen" <fs...@fsadev.com>.
I think I just misunderstood your question.

By now I really think you should consider doing as Thiago suggested and 
move the whole thing into an Application State Object. It'll take a bit 
of work - you'll have to keep track of which messages to display on 
which pages etc. - but it will probably be a cleaner, better solution in 
the end.

-Filip

On 2008-05-23 23:13, zack1403 wrote:
> Isnt that basically the same as having the attribute as part of the Layout
> class?  It just seems unnecessary to have to pass my message list to the
> layout when it belongs in the layout component anyways.  Is this a
> workaround to some issue?
> 
> Thanks,
> Zack
> 
> Filip S. Adamsen-2 wrote:
>> Hi again,
>>
>> You just need to pass it from your page to your layout.
>>
>> Page class:
>>    @Property
>>    private MessageHolder messages;
>>
>> Page template:
>>    <t:layout t:messages="messages">...</t:layout>
>>
>> Layout class:
>>    @Property
>>    @Parameter
>>    private MessageHolder messages;
>>
>> Layout template:
>>    <t:loop t:source="messages" t:value="message">...</t:loop>
>>
>> Etc. etc.
>>
>> -Filip
>>
>> On 2008-05-23 17:20, zack1403 wrote:
>>> Hey guys thanks a lot for you help so far.  Josh, I have tried adding
>>> @Persist("flash") to many different parts with no apparent luck.  Filip,
>>> is
>>> there a way I can utilize my list of messages from my template component
>>> when the list is an attribute of the page?  I obviously get the Could not
>>> convert 'messages' into a component parameter binding because the message
>>> display is part of the component tml.  I could see moving my messages
>>> into
>>> my generic page but I get that error. How do you see that working without
>>> having a list attribute in my component?
>>>
>>> Thanks again,
>>> Zack
>>>
>>> Filip S. Adamsen-2 wrote:
>>>> No luck? That sucks. =/
>>>>
>>>> I thought occured to me just before I fell asleep last night, though. 
>>>> Perhaps you should store the messages directly in your pages instead and 
>>>> pass them on to your layout? That's how I would do it, anyhow.
>>>>
>>>> You could wrap the add functions in a MessageHolder class that you can 
>>>> easily pass to your layout. Maybe that will work...
>>>>
>>>> -Filip
>>>>
>>>> zack1403 skrev:
>>>>> Yea I've tried multiple different combinations of @Persist to get
>>>>> something
>>>>> to work on my pages and  component with no luck.  Thanks anyways for
>>>>> your
>>>>> help Filip.
>>>>>
>>>>> Zack
>>>>>
>>>>> Filip S. Adamsen-2 wrote:
>>>>>> You say you added @Persist("flash") to your pages, but the information 
>>>>>> you're storing doesn't go into the page, but into the component. I
>>>>>> think 
>>>>>> you'll have to put @Persist("flash") on your list of messages in your 
>>>>>> Layout component.
>>>>>>
>>>>>> If that doesn't solve it, I'm afraid I don't know what the problem is. 
>>>>>> Hopefully someone else will be able to help you, then.
>>>>>>
>>>>>> -Filip
>>>>>>
>>>>>> On 2008-05-23 01:20, zack1403 wrote:
>>>>>>> Filip,
>>>>>>>
>>>>>>> One of the first things I added was @Persist("flash") to my pages
>>>>>>> with
>>>>>>> no
>>>>>>> luck.  Still the same behavior.  Even with the pages pooled should
>>>>>>> they
>>>>>>> share attribute values across sessions?
>>>>>>>
>>>>>>>
>>>>>>> Filip S. Adamsen-2 wrote:
>>>>>>>> Working as intended. Tapestry uses a page pool which means that you
>>>>>>>> have 
>>>>>>>> to use some sort of persistence to make this work:
>>>>>>>> http://tapestry.apache.org/tapestry5/tapestry-core/guide/persist.html
>>>>>>>>
>>>>>>>> -Filip
>>>>>>>>
>>>>>>>> On 2008-05-23 00:45, zack1403 wrote:
>>>>>>>>> No.  Not using any persist.  I really dont have anything else
>>>>>>>>> besides
>>>>>>>>> a
>>>>>>>>> title
>>>>>>>>> and this list of messages.  When I move from page to page I might
>>>>>>>>> inject
>>>>>>>>> my
>>>>>>>>> layout and add a message to this list for display.  They get
>>>>>>>>> persisted
>>>>>>>>> without any sort of persist.
>>>>>>>>>
>>>>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>>
>>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>
> 

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


Re: Layout Attributes Shared

Posted by zack1403 <za...@gmail.com>.
Isnt that basically the same as having the attribute as part of the Layout
class?  It just seems unnecessary to have to pass my message list to the
layout when it belongs in the layout component anyways.  Is this a
workaround to some issue?

Thanks,
Zack

Filip S. Adamsen-2 wrote:
> 
> Hi again,
> 
> You just need to pass it from your page to your layout.
> 
> Page class:
>    @Property
>    private MessageHolder messages;
> 
> Page template:
>    <t:layout t:messages="messages">...</t:layout>
> 
> Layout class:
>    @Property
>    @Parameter
>    private MessageHolder messages;
> 
> Layout template:
>    <t:loop t:source="messages" t:value="message">...</t:loop>
> 
> Etc. etc.
> 
> -Filip
> 
> On 2008-05-23 17:20, zack1403 wrote:
>> Hey guys thanks a lot for you help so far.  Josh, I have tried adding
>> @Persist("flash") to many different parts with no apparent luck.  Filip,
>> is
>> there a way I can utilize my list of messages from my template component
>> when the list is an attribute of the page?  I obviously get the Could not
>> convert 'messages' into a component parameter binding because the message
>> display is part of the component tml.  I could see moving my messages
>> into
>> my generic page but I get that error. How do you see that working without
>> having a list attribute in my component?
>> 
>> Thanks again,
>> Zack
>> 
>> Filip S. Adamsen-2 wrote:
>>> No luck? That sucks. =/
>>>
>>> I thought occured to me just before I fell asleep last night, though. 
>>> Perhaps you should store the messages directly in your pages instead and 
>>> pass them on to your layout? That's how I would do it, anyhow.
>>>
>>> You could wrap the add functions in a MessageHolder class that you can 
>>> easily pass to your layout. Maybe that will work...
>>>
>>> -Filip
>>>
>>> zack1403 skrev:
>>>> Yea I've tried multiple different combinations of @Persist to get
>>>> something
>>>> to work on my pages and  component with no luck.  Thanks anyways for
>>>> your
>>>> help Filip.
>>>>
>>>> Zack
>>>>
>>>> Filip S. Adamsen-2 wrote:
>>>>> You say you added @Persist("flash") to your pages, but the information 
>>>>> you're storing doesn't go into the page, but into the component. I
>>>>> think 
>>>>> you'll have to put @Persist("flash") on your list of messages in your 
>>>>> Layout component.
>>>>>
>>>>> If that doesn't solve it, I'm afraid I don't know what the problem is. 
>>>>> Hopefully someone else will be able to help you, then.
>>>>>
>>>>> -Filip
>>>>>
>>>>> On 2008-05-23 01:20, zack1403 wrote:
>>>>>> Filip,
>>>>>>
>>>>>> One of the first things I added was @Persist("flash") to my pages
>>>>>> with
>>>>>> no
>>>>>> luck.  Still the same behavior.  Even with the pages pooled should
>>>>>> they
>>>>>> share attribute values across sessions?
>>>>>>
>>>>>>
>>>>>> Filip S. Adamsen-2 wrote:
>>>>>>> Working as intended. Tapestry uses a page pool which means that you
>>>>>>> have 
>>>>>>> to use some sort of persistence to make this work:
>>>>>>> http://tapestry.apache.org/tapestry5/tapestry-core/guide/persist.html
>>>>>>>
>>>>>>> -Filip
>>>>>>>
>>>>>>> On 2008-05-23 00:45, zack1403 wrote:
>>>>>>>> No.  Not using any persist.  I really dont have anything else
>>>>>>>> besides
>>>>>>>> a
>>>>>>>> title
>>>>>>>> and this list of messages.  When I move from page to page I might
>>>>>>>> inject
>>>>>>>> my
>>>>>>>> layout and add a message to this list for display.  They get
>>>>>>>> persisted
>>>>>>>> without any sort of persist.
>>>>>>>>
>>>>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>
>>>>>
>>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>>
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Layout-Attributes-Shared-tp17414894p17441131.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: Layout Attributes Shared

Posted by "Filip S. Adamsen" <fs...@fsadev.com>.
Hi again,

You just need to pass it from your page to your layout.

Page class:
   @Property
   private MessageHolder messages;

Page template:
   <t:layout t:messages="messages">...</t:layout>

Layout class:
   @Property
   @Parameter
   private MessageHolder messages;

Layout template:
   <t:loop t:source="messages" t:value="message">...</t:loop>

Etc. etc.

-Filip

On 2008-05-23 17:20, zack1403 wrote:
> Hey guys thanks a lot for you help so far.  Josh, I have tried adding
> @Persist("flash") to many different parts with no apparent luck.  Filip, is
> there a way I can utilize my list of messages from my template component
> when the list is an attribute of the page?  I obviously get the Could not
> convert 'messages' into a component parameter binding because the message
> display is part of the component tml.  I could see moving my messages into
> my generic page but I get that error. How do you see that working without
> having a list attribute in my component?
> 
> Thanks again,
> Zack
> 
> Filip S. Adamsen-2 wrote:
>> No luck? That sucks. =/
>>
>> I thought occured to me just before I fell asleep last night, though. 
>> Perhaps you should store the messages directly in your pages instead and 
>> pass them on to your layout? That's how I would do it, anyhow.
>>
>> You could wrap the add functions in a MessageHolder class that you can 
>> easily pass to your layout. Maybe that will work...
>>
>> -Filip
>>
>> zack1403 skrev:
>>> Yea I've tried multiple different combinations of @Persist to get
>>> something
>>> to work on my pages and  component with no luck.  Thanks anyways for your
>>> help Filip.
>>>
>>> Zack
>>>
>>> Filip S. Adamsen-2 wrote:
>>>> You say you added @Persist("flash") to your pages, but the information 
>>>> you're storing doesn't go into the page, but into the component. I think 
>>>> you'll have to put @Persist("flash") on your list of messages in your 
>>>> Layout component.
>>>>
>>>> If that doesn't solve it, I'm afraid I don't know what the problem is. 
>>>> Hopefully someone else will be able to help you, then.
>>>>
>>>> -Filip
>>>>
>>>> On 2008-05-23 01:20, zack1403 wrote:
>>>>> Filip,
>>>>>
>>>>> One of the first things I added was @Persist("flash") to my pages with
>>>>> no
>>>>> luck.  Still the same behavior.  Even with the pages pooled should they
>>>>> share attribute values across sessions?
>>>>>
>>>>>
>>>>> Filip S. Adamsen-2 wrote:
>>>>>> Working as intended. Tapestry uses a page pool which means that you
>>>>>> have 
>>>>>> to use some sort of persistence to make this work:
>>>>>> http://tapestry.apache.org/tapestry5/tapestry-core/guide/persist.html
>>>>>>
>>>>>> -Filip
>>>>>>
>>>>>> On 2008-05-23 00:45, zack1403 wrote:
>>>>>>> No.  Not using any persist.  I really dont have anything else besides
>>>>>>> a
>>>>>>> title
>>>>>>> and this list of messages.  When I move from page to page I might
>>>>>>> inject
>>>>>>> my
>>>>>>> layout and add a message to this list for display.  They get
>>>>>>> persisted
>>>>>>> without any sort of persist.
>>>>>>>
>>>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>>
>>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>
> 

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


Re: Layout Attributes Shared

Posted by zack1403 <za...@gmail.com>.
Hey guys thanks a lot for you help so far.  Josh, I have tried adding
@Persist("flash") to many different parts with no apparent luck.  Filip, is
there a way I can utilize my list of messages from my template component
when the list is an attribute of the page?  I obviously get the Could not
convert 'messages' into a component parameter binding because the message
display is part of the component tml.  I could see moving my messages into
my generic page but I get that error. How do you see that working without
having a list attribute in my component?

Thanks again,
Zack

Filip S. Adamsen-2 wrote:
> 
> No luck? That sucks. =/
> 
> I thought occured to me just before I fell asleep last night, though. 
> Perhaps you should store the messages directly in your pages instead and 
> pass them on to your layout? That's how I would do it, anyhow.
> 
> You could wrap the add functions in a MessageHolder class that you can 
> easily pass to your layout. Maybe that will work...
> 
> -Filip
> 
> zack1403 skrev:
>> Yea I've tried multiple different combinations of @Persist to get
>> something
>> to work on my pages and  component with no luck.  Thanks anyways for your
>> help Filip.
>> 
>> Zack
>> 
>> Filip S. Adamsen-2 wrote:
>>> You say you added @Persist("flash") to your pages, but the information 
>>> you're storing doesn't go into the page, but into the component. I think 
>>> you'll have to put @Persist("flash") on your list of messages in your 
>>> Layout component.
>>>
>>> If that doesn't solve it, I'm afraid I don't know what the problem is. 
>>> Hopefully someone else will be able to help you, then.
>>>
>>> -Filip
>>>
>>> On 2008-05-23 01:20, zack1403 wrote:
>>>> Filip,
>>>>
>>>> One of the first things I added was @Persist("flash") to my pages with
>>>> no
>>>> luck.  Still the same behavior.  Even with the pages pooled should they
>>>> share attribute values across sessions?
>>>>
>>>>
>>>> Filip S. Adamsen-2 wrote:
>>>>> Working as intended. Tapestry uses a page pool which means that you
>>>>> have 
>>>>> to use some sort of persistence to make this work:
>>>>> http://tapestry.apache.org/tapestry5/tapestry-core/guide/persist.html
>>>>>
>>>>> -Filip
>>>>>
>>>>> On 2008-05-23 00:45, zack1403 wrote:
>>>>>> No.  Not using any persist.  I really dont have anything else besides
>>>>>> a
>>>>>> title
>>>>>> and this list of messages.  When I move from page to page I might
>>>>>> inject
>>>>>> my
>>>>>> layout and add a message to this list for display.  They get
>>>>>> persisted
>>>>>> without any sort of persist.
>>>>>>
>>>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>>
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Layout-Attributes-Shared-tp17414894p17427911.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: Layout Attributes Shared

Posted by "Filip S. Adamsen" <fs...@fsadev.com>.
No luck? That sucks. =/

I thought occured to me just before I fell asleep last night, though. 
Perhaps you should store the messages directly in your pages instead and 
pass them on to your layout? That's how I would do it, anyhow.

You could wrap the add functions in a MessageHolder class that you can 
easily pass to your layout. Maybe that will work...

-Filip

zack1403 skrev:
> Yea I've tried multiple different combinations of @Persist to get something
> to work on my pages and  component with no luck.  Thanks anyways for your
> help Filip.
> 
> Zack
> 
> Filip S. Adamsen-2 wrote:
>> You say you added @Persist("flash") to your pages, but the information 
>> you're storing doesn't go into the page, but into the component. I think 
>> you'll have to put @Persist("flash") on your list of messages in your 
>> Layout component.
>>
>> If that doesn't solve it, I'm afraid I don't know what the problem is. 
>> Hopefully someone else will be able to help you, then.
>>
>> -Filip
>>
>> On 2008-05-23 01:20, zack1403 wrote:
>>> Filip,
>>>
>>> One of the first things I added was @Persist("flash") to my pages with no
>>> luck.  Still the same behavior.  Even with the pages pooled should they
>>> share attribute values across sessions?
>>>
>>>
>>> Filip S. Adamsen-2 wrote:
>>>> Working as intended. Tapestry uses a page pool which means that you have 
>>>> to use some sort of persistence to make this work:
>>>> http://tapestry.apache.org/tapestry5/tapestry-core/guide/persist.html
>>>>
>>>> -Filip
>>>>
>>>> On 2008-05-23 00:45, zack1403 wrote:
>>>>> No.  Not using any persist.  I really dont have anything else besides a
>>>>> title
>>>>> and this list of messages.  When I move from page to page I might
>>>>> inject
>>>>> my
>>>>> layout and add a message to this list for display.  They get persisted
>>>>> without any sort of persist.
>>>>>
>>>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>
> 

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


Re: Layout Attributes Shared

Posted by Thiago HP <th...@gmail.com>.
On 5/22/08, zack1403 <za...@gmail.com> wrote:

>  Yea I've tried multiple different combinations of @Persist to get something
>  to work on my pages and  component with no luck.  Thanks anyways for your
>  help Filip.

Why not @ApplicationState, as the information does not belong to a
single page in your application?

-- 
Thiago

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


Re: Layout Attributes Shared

Posted by zack1403 <za...@gmail.com>.
Yea I've tried multiple different combinations of @Persist to get something
to work on my pages and  component with no luck.  Thanks anyways for your
help Filip.

Zack

Filip S. Adamsen-2 wrote:
> 
> You say you added @Persist("flash") to your pages, but the information 
> you're storing doesn't go into the page, but into the component. I think 
> you'll have to put @Persist("flash") on your list of messages in your 
> Layout component.
> 
> If that doesn't solve it, I'm afraid I don't know what the problem is. 
> Hopefully someone else will be able to help you, then.
> 
> -Filip
> 
> On 2008-05-23 01:20, zack1403 wrote:
>> Filip,
>> 
>> One of the first things I added was @Persist("flash") to my pages with no
>> luck.  Still the same behavior.  Even with the pages pooled should they
>> share attribute values across sessions?
>> 
>> 
>> Filip S. Adamsen-2 wrote:
>>> Working as intended. Tapestry uses a page pool which means that you have 
>>> to use some sort of persistence to make this work:
>>> http://tapestry.apache.org/tapestry5/tapestry-core/guide/persist.html
>>>
>>> -Filip
>>>
>>> On 2008-05-23 00:45, zack1403 wrote:
>>>> No.  Not using any persist.  I really dont have anything else besides a
>>>> title
>>>> and this list of messages.  When I move from page to page I might
>>>> inject
>>>> my
>>>> layout and add a message to this list for display.  They get persisted
>>>> without any sort of persist.
>>>>
>>>>
>>>
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Layout-Attributes-Shared-tp17414894p17415956.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: Layout Attributes Shared

Posted by "Filip S. Adamsen" <fs...@fsadev.com>.
You say you added @Persist("flash") to your pages, but the information 
you're storing doesn't go into the page, but into the component. I think 
you'll have to put @Persist("flash") on your list of messages in your 
Layout component.

If that doesn't solve it, I'm afraid I don't know what the problem is. 
Hopefully someone else will be able to help you, then.

-Filip

On 2008-05-23 01:20, zack1403 wrote:
> Filip,
> 
> One of the first things I added was @Persist("flash") to my pages with no
> luck.  Still the same behavior.  Even with the pages pooled should they
> share attribute values across sessions?
> 
> 
> Filip S. Adamsen-2 wrote:
>> Working as intended. Tapestry uses a page pool which means that you have 
>> to use some sort of persistence to make this work:
>> http://tapestry.apache.org/tapestry5/tapestry-core/guide/persist.html
>>
>> -Filip
>>
>> On 2008-05-23 00:45, zack1403 wrote:
>>> No.  Not using any persist.  I really dont have anything else besides a
>>> title
>>> and this list of messages.  When I move from page to page I might inject
>>> my
>>> layout and add a message to this list for display.  They get persisted
>>> without any sort of persist.
>>>
>>>
>>
> 

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


Re: Layout Attributes Shared

Posted by zack1403 <za...@gmail.com>.
Filip,

One of the first things I added was @Persist("flash") to my pages with no
luck.  Still the same behavior.  Even with the pages pooled should they
share attribute values across sessions?


Filip S. Adamsen-2 wrote:
> 
> Working as intended. Tapestry uses a page pool which means that you have 
> to use some sort of persistence to make this work:
> http://tapestry.apache.org/tapestry5/tapestry-core/guide/persist.html
> 
> -Filip
> 
> On 2008-05-23 00:45, zack1403 wrote:
>> No.  Not using any persist.  I really dont have anything else besides a
>> title
>> and this list of messages.  When I move from page to page I might inject
>> my
>> layout and add a message to this list for display.  They get persisted
>> without any sort of persist.
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Layout-Attributes-Shared-tp17414894p17415597.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: Layout Attributes Shared

Posted by "Filip S. Adamsen" <fs...@fsadev.com>.
Working as intended. Tapestry uses a page pool which means that you have 
to use some sort of persistence to make this work:
http://tapestry.apache.org/tapestry5/tapestry-core/guide/persist.html

-Filip

On 2008-05-23 00:45, zack1403 wrote:
> No.  Not using any persist.  I really dont have anything else besides a title
> and this list of messages.  When I move from page to page I might inject my
> layout and add a message to this list for display.  They get persisted
> without any sort of persist.
> 
> 
> Daniel Jue wrote:
>> I take it you are not using @Persist("flash") ?
>>
>> http://tapestry.apache.org/tapestry5/tapestry-core/guide/persist.html
>>
>>
>> On Thu, May 22, 2008 at 6:33 PM, zack1403 <za...@gmail.com> wrote:
>>> Hello all,
>>>
>>> I have a layout component with a List full of my own message objects as
>>> an
>>> attribute.  First off, it seems that these values are shared across
>>> sessions/computers. Second, they persist until i either restart my server
>>> or
>>> end the session.  Any ideas why an attribute of the layout class would be
>>> acting like this?  Ideally I just want them to flash and then go away but
>>> cant seem to get this to work.
>>>
>>> Thanks in advance,
>>> Zack
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Layout-Attributes-Shared-tp17414894p17414894.html
>>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>
> 

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


Re: Layout Attributes Shared

Posted by zack1403 <za...@gmail.com>.
No.  Not using any persist.  I really dont have anything else besides a title
and this list of messages.  When I move from page to page I might inject my
layout and add a message to this list for display.  They get persisted
without any sort of persist.


Daniel Jue wrote:
> 
> I take it you are not using @Persist("flash") ?
> 
> http://tapestry.apache.org/tapestry5/tapestry-core/guide/persist.html
> 
> 
> On Thu, May 22, 2008 at 6:33 PM, zack1403 <za...@gmail.com> wrote:
>>
>> Hello all,
>>
>> I have a layout component with a List full of my own message objects as
>> an
>> attribute.  First off, it seems that these values are shared across
>> sessions/computers. Second, they persist until i either restart my server
>> or
>> end the session.  Any ideas why an attribute of the layout class would be
>> acting like this?  Ideally I just want them to flash and then go away but
>> cant seem to get this to work.
>>
>> Thanks in advance,
>> Zack
>> --
>> View this message in context:
>> http://www.nabble.com/Layout-Attributes-Shared-tp17414894p17414894.html
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Layout-Attributes-Shared-tp17414894p17415068.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: Layout Attributes Shared

Posted by Daniel Jue <te...@gmail.com>.
I take it you are not using @Persist("flash") ?

http://tapestry.apache.org/tapestry5/tapestry-core/guide/persist.html


On Thu, May 22, 2008 at 6:33 PM, zack1403 <za...@gmail.com> wrote:
>
> Hello all,
>
> I have a layout component with a List full of my own message objects as an
> attribute.  First off, it seems that these values are shared across
> sessions/computers. Second, they persist until i either restart my server or
> end the session.  Any ideas why an attribute of the layout class would be
> acting like this?  Ideally I just want them to flash and then go away but
> cant seem to get this to work.
>
> Thanks in advance,
> Zack
> --
> View this message in context: http://www.nabble.com/Layout-Attributes-Shared-tp17414894p17414894.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

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