wicket-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Patrick Davids <patrick.dav...@nubologic.com>
Subject Re: alternative solution for addOrReplace()?
Date Tue, 07 Oct 2014 16:43:58 GMT
Hi Paul,
thanx for replying.

Oh, I use Ajax very heavily in this case. Thats why I said: "the panel 
works quite good for ajax rendering and refreshing use-cases"

Hmm... ok... I think I missed some details. I try to explain.

My page contains two sections seperated from each other.
A kind of data-entry and a kind of displaying the results.

The section which displays the results is a quite complicated panel, 
having an RefreshingView for about 30 (I will name them) sub-panels.

These sub-panels addOrReplace() an inner container while rendering itself.
And the replacement depends on my model object type.

So, my sub-panel class has a hugh knowledge about how to render the results.

On entering some data on the data-entry section I refresh the whole 
panel in the display section with all its sub-panels using Ajax. And 
this works great.
Some of the sub-panels also rerender/refresh own there own, by listening 
to events etc pepe. All this behaviours are working very well.

The only disadvantage is, using addOrReplace(), I have a heavy 
detaching/attaching situation and a performance problem.

So, the best solution for now would be, keeping my panel implementation 
as it is, but just having my models detached only once, not for iteration.

And here I dont have any idea how to solve that... :-/

thanx and kind regards

Am 07.10.2014 17:52, schrieb Paul Bors:
> 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.davids@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-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
View raw message