> onActivate (this.entity is not null) > @OnEvent(component = "parameterEditor") void doDeleteParameter(long id); > the list element removed but the entity not persisted. > onActivate (this.entity is null and re-readed from database) > > are there any suggestions to prevent the re-reading of the entity after > clicking an action/eventlink?
You're using @Persist("flash") so you only get to read it from the session once, then it gets null'd out. Since you want it to live longer than one read you could use "session" instead of "flash". Another option is to re-set the value by implementing the entity setter method and calling it in the doDeleteParameter handler. That would ensure that the entity was available in the next onActivate read of the property. Josh On Wed, May 14, 2008 at 3:43 PM, Sven Homburg <[EMAIL PROTECTED]> wrote: > hi there, > > situation: > 1. i have an edit page for an entity "Report" > 2. if the page activated, the method onActivate > > public void onActivate(long primaryKey) > { > this.primaryKey = primaryKey; > if (this.entity == null) > { > if (this.primaryKey == 0) > this.entity = instantiateEntity(); > else > this.entity = (Report) getDAO().doRetrieve(primaryKey, > false); > } > } > > this.entity is a private field declared by > @Persist("flash") > @Property > private Report entity; > > after i clicked on the action link "del" (look the attached image) > an element from the list (attached to the entiy) should removed. > > problem: > after i click the actionlink "del", tapestry reacts in following manner > > onActivate (this.entity is not null) > @OnEvent(component = "parameterEditor") void doDeleteParameter(long id); > the list element removed but the entity not persisted. > onActivate (this.entity is null and re-readed from database) > > are there any suggestions to prevent the re-reading of the entity after > clicking an action/eventlink? > > -- > with regards > Sven Homburg > http://tapestry5-components.googlecode.com > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > -- -- 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]