> evaluated only one time per render can be done with
> LoadableDetachedModel ..

I do not mean LOADED once per render. I mean EVALUATED once per
render. In my understanding LoadableDetachableModel does not guarantee
"reset" in any particular stage.

> can you explain it a littly bit (a link to your original message?)

I mean for rexample I have many models like this:

new AbstractReadOnlyModel<String>() {
   public String getObject() {
      // evaluate message with some logic
      return message;
   }
}

Furthermore, I have several components that, say, depend on this
value. This getObject() will be called many times durung render and
the logic will be evaluated many times.

If I make it detachable it will yes be detached but I am not sure that
the detaching is guaranteed at some specific point in request cycle?

To make my "use case" more clear I will give an example: say I have a
wicket page with a panel that contains a table with columns rows and y
rows. Furthermore, let's assume it is a spreadsheet emulator: you can
write formulas into the cells that depend on the other cells which
means that the value of each cell is recursively evaluated dependent
on the other cell's values.

Requirements:
1. During render time each cell's model value should be cached once it
has been evaluated (we do not want to recurse many times to fetch the
same value).
2. If the value of any cell changes, all the dependent cells should be
(for example) ajax refreshed and re-evaluated. For simplicity, we
could re-set the cache of all models when change occurs. And
redraw-all.
3. We want to reset cache ONLY if change occurs.

In my understanding requirement 3 cannot be directly reached with
detachable models.

**
Martin

>
> mm:)
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to