Why not use Ajax?

addOrReplace() is really for when you need the full request cycle and have
the page rendered on the server side. With Ajax you get your target for
which you can add all the components you want to refresh on the page.

Given the day and age we live in, I don't think there is a need to even
worry about browsers that do not support Ajax. Than again, that depends on
your product's requirements.

Otherwise, you can keep on using addOrReplace() but stop using instaceof
and start using Generics.
If you need an example code-snippet of that let me know and I'll dig some
out for you.

On Tue, Oct 7, 2014 at 9:51 AM, Patrick Davids <patrick.dav...@nubologic.com
> wrote:

> Hi all,
> I have a panel, which renders a inner markupcontainer (different panels
> for different ways of displaying my model object) depending on its model
> objects type.
>
> I do this by addOrReplace() the inner panel in an onConfigure() having
> an "if instanceof"; and it also iterates over a list...
>
> I'm not sure, if it is a good solution (I dont like the instanceof
> approach), but the panel works quite good for ajax rendering and
> refreshing use-cases.
>
> But, the addOrReplace() has one big disadvantage.
> It forces to detach the model on each iteration, so on each iteration I
> get a database access to retrieve it again.
>
> Is there anyway to keep the model attached until the entire request
> cycle is finished?
>
>
> Or should I try to find complete other solution for this kind of "high
> dynamic iterating panel"?
> Is it better to use e.g. Fragments to display a model object in
> different ways depending on its state?
>
> Please give some inspirations... I ran out of ideas. Help!
>
> kind regards :-)
> Patrick
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

Reply via email to