I also found that the var binding doesn't seem to work in a zone being
updated via ajax?
Caused by: org.apache.tapestry.ioc.internal.util.TapestryException:
Failure writing parameter 'value' of component BasicAjax:loop:
Component BasicAjax is not rendering, so render variable 'string' may
not be updated. [at classpath:joshcan/test/myapp/pages/BasicAjax.tml,
line 10, column 49]
at
org.apache.tapestry.internal.structure.InternalComponentResourcesImpl.writeParameter(InternalComponentResourcesImpl.java:273)
at
org.apache.tapestry.corelib.components.Loop._$update_parameter_value(Loop.java)
Josh
On Wed, Apr 9, 2008 at 10:19 AM, Josh Canfield <[EMAIL PROTECTED]> wrote:
> You didn't mention if your list was updated using ajax? I have a
> similar problem where a list that is updated in an updated zone is not
> updated when I refresh the page. In my case it's ajax based search
> results. Refreshing the page causes the old results to be left in the
> page.
>
> It appears that cached properties are cleaned up during
> postRenderCleanup. If you update the value during an ajax call then it
> appears that the cleanup doesn't happen and the method is still cached
> for until after next full page render (all future ajax calls return
> the same value)
>
> I haven't looked to see if there is a jira issue filed already, but it
> definitely seems like a defect.
>
> I hijacked Andy Blower's BasicAjax to demonstrate. Clicking the ajax
> enabled links causes the date in the list to update the first time,
> but subsequent clicks get no update. Reloading the page gives you the
> last value, now clicking the links will update.
>
> <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
> <body>
>
> <h1>Basic AJAX Tester (${count} - only updates on full page refresh)</h1>
>
> <a t:type="actionlink" t:id="outsideZone" href="#"
> t:zone="aZone">Refresh - this is an AJAX-enabled
> ActionLink</a><br/><br/>
>
>
> <div t:type="zone" t:id="aZone">
> <t:loop source="strings" value="string">
> ${string}<br/>
> </t:loop>
> <p>I am a AJAX updated ZONE! count=${count}</p>
> <a t:type="actionlink" t:id="insideZone" href="#"
> t:zone="aZone">Refresh - this is an AJAX-enabled ActionLink inside the
> zone</a><br/><br/>
> </div>
>
> </body>
> </html>
>
>
> package joshcan.test.myapp.pages;
>
> import java.util.Date;
>
> import org.apache.tapestry.annotations.Cached;
> import org.apache.tapestry.annotations.Component;
> import org.apache.tapestry.annotations.Persist;
> import org.apache.tapestry.annotations.Property;
> import org.apache.tapestry.corelib.components.Zone;
>
> public class BasicAjax {
> @Property
> @Persist
> private int count = 0;
>
> @Property
> private String string;
>
> @Component
> private Zone aZone;
>
> Object onActionFromOutsideZone() {
> count++;
> return aZone;
> }
>
> Object onActionFromInsideZone() {
> count++;
> return aZone;
> }
>
> @Cached
> public String[] getStrings() {
> return new String[] {
> "Hello", new Date().toString()
> };
>
> }
> }
>
>
>
>
>
>
> On Wed, Apr 9, 2008 at 8:45 AM, Peter Beshai <[EMAIL PROTECTED]> wrote:
> > I have a problem where I am using a grid component to display the contents
> > of a list retrieved from a database: sometimes after modifying the list, the
> > page loads without refreshing the data.
> >
> > In my page:
> >
> > @Cached
> > public List<MyEntity> getMyEntities()
> > {
> > return _myEntityDAO.findAll();
> > }
> >
> >
> > For instance, if I delete an item from the list using a control on that
> > page, and the page refreshes, the list will still show the item. If I click
> > refresh it will reload with the updated list. This only happens
> > occasionally, but it does happen more often than not.
> >
> > Has anybody else encountered/fixed this?
> >
> >
> > Thanks,
> >
> > Peter Beshai
> >
>
>
>
> --
> --
> 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]