[
http://issues.apache.org/jira/browse/TAPESTRY-524?page=comments#action_12317475
]
Adam Greene commented on TAPESTRY-524:
--------------------------------------
I just realized I never really explained the original problem that led me to
making these fixes. The problem is this:
Given a Home.html with this in it:
<span jwcid="@Insert" value="clientValue"/><BR>
<span jwcid="@PageLink" page="Homek">HOME</span>
<span jwcid="@DirectLink" listener="doAdd">Add</span>
and the Home.java as:
@Persist(value="client")
public abstract int getClientValue();
public abstract void setClientValue(int what);
clicking on the Add link once, causes clientValue to become 1, click it again,
it becomes 2. Click it three times and it remains 2. The reason was that the
AppClientPropertyPersistStrategy was picking up the original value and the
ClientPropertyPersistStrategy was also picking it up, but was being modified by
the doAdd Direct (which simply did setClientValue(getClientValue() + 1)) and
when it went to write the persistent value back out, the original value from
the AppClientPropertyPersistStrategy was being used.
> Problems with Client Side Persistence
> -------------------------------------
>
> Key: TAPESTRY-524
> URL: http://issues.apache.org/jira/browse/TAPESTRY-524
> Project: Tapestry
> Type: Bug
> Components: Framework
> Versions: 4.0
> Environment: Tapestry 3.0 Beta 3
> Reporter: Adam Greene
> Attachments: recordfix.zip
>
> public void initializeService()
> {
> List names = _request.getParameterNames();
> Iterator i = names.iterator();
> while (i.hasNext())
> {
> String name = (String) i.next();
> if (!name.startsWith(PREFIX))
> continue;
> // At this point we need to validate the parameter against what
> type of persistent strategy this is, we are blindly grabbing page
> persistence,even
> // when the strategy is application.
> String pageName = name.substring(PREFIX.length());
> String encoded = _request.getParameterValue(name);
> PersistentPropertyData data = new
> PersistentPropertyData(_encoder);
> data.storeEncoded(encoded);
> _data.put(pageName, data);
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]