But is it expected for the things that are @Persist-ed to be shared in each iteration?
I will try to pass the client zone id to the context and to use it back to refresh the proper zone (I did come up with same idea but I was thinking that it is wrong path to follow) On Sat, Apr 26, 2014 at 6:29 PM, Thiago H de Paula Figueiredo < thiag...@gmail.com> wrote: > On Sat, 26 Apr 2014 12:36:26 -0300, Boris Horvat <horvat.z.bo...@gmail.com> > wrote: > > Hi, >> > > Hi! > > > >> I believe that I am doing something wrong but just wanted to confirm if >> that is the case. >> >> I have a component that I pass in the loop. >> >> <t:Edit t:id="image" t:value="projectImage" t:context="currentProject" >> edittype="imageupload" /> >> > > So, very important, you have a single component instance which is rendered > many times. > > > Now the idea is that once someone uploads an image we refresh the zone, >> however I cant seem to trigger the refresh for the correct zone due to the >> loop iteration. I have tried to create a property >> >> @Persist >> @Property(read = false) >> private String zoneImageUploadId; >> >> public String getZoneImageUploadId() { >> if (zoneImageUploadId == null) >> zoneImageUploadId = >> javascriptSupport.allocateClientId(resources); >> return zoneImageUploadId; >> } >> > > I see no point in persisting the zoneImageUploadId. Instead, you should > pass it context of the event that uploads the zone. > > In addition, what you're calling component id isn't the component id, > t:id, but the HTML, client-side id, and they're different things that may > or may not have the same value. > > -- > Thiago H. de Paula Figueiredo > Tapestry, Java and Hibernate consultant and developer > http://machina.com.br > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > -- Sincerely *Boris Horvat*