Ciao,
Happy New Year to all.
Thank Yanni for your answer ( sorry for my delay ).
On 24/12/12 4:48 AM, dtrussardi(a)tiscali.it
wrote:
> I have a pier site with a menu to manage
some pages.
> Some of this pages are configured to manage components.
>
> For test i add some Counter seaside application instances.
>
> Now when display a specific page with some counter it work fine:
>
> i can change any specific counter instance in the page.
>
> My problem is when i change the menu for display another page.
>
> In this case when redisplay a page with the counters all instance are reset to 0.
>
> Now my question is:
>
> what do i do for redisplay the counter at the last update ?
>
> I need to configure something ?
IIUC, a Seaside component is created and initialized for each Seaside session. I believe
there is a way to set some initial values using link parameters, but the details are not
at my fingertips.
I found one example relative to this question creating a blog based on
PRBlogKernelDistribution.
Can you say a bit more about how you are using
the pier page to manage components. Ideally, an example of the wiki markup, and maybe a
code snippet that configures the Pier component to create the WACounter (or, the steps
done in Pier, if you're not doing this part in code).
It in the blog page, it rendering some counter example based on the following code:
-------------------------------------------------------------------------------------------------------------------
blogPostEmbeddingComponents
^ (PBPost named: 'embedding-components')
title: 'Embedding components';
tags: #('components' 'embedding' 'Seaside');
publication: TimeStamp now;
contents:
'Embedding Seaside components is straightforward. Simply add a component to a node
within the site''s tree structure, then add a reference to that component within a
blog post. For example if you add a component as a child of this post, you can then then
embed the component using the syntax. \+mychild\+. Here is an embedded ajaxified counter:
+ajaxcounter+
...and the standard counter:
+counter+
Test Seaside''s state management by clicking on the \+\+ and \-\- links. Pier
blogs are ideal for demoing and describing your Seaside components. In fact you can use
Pier as the basis for application development by embedding components in pages, especially
if you are building a content-rich site.';
addChild: ((PRComponent named: 'ajaxcounter')
componentClass: JQCounterFunctionalTest;
yourself);
addChild: ((PRComponent named: 'counter')
componentClass: WACounter;
yourself);
yourself.
-----------------------------------------------------------------------------------------------------------------------------------
You can display the blog page and do some operations + - on one counter,
After if you click on any menu item ( Home or Blog itself )
you lose the state of the counter instances.
But i need to remember the state of the counters instance ( or any other my root
components ) so that when redisplay the page i display the
right last update value.
My problem is to remember the state of the counter when change the menu in the same
session.
If the session is new ( or has just expired ) it's right generate a new instance of
the counter.
But within the same session when change the menu, i expect that the system does not lose
the references and don't create new instance.
No one has a concrete example of how to solve the problem?
As for example the handle of WACounter of example above.
Thanks,
Dario