You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Wilhelmsen Tor Iver <To...@arrive.no> on 2010/11/20 14:57:11 UTC

Wicket 1.4.x: Repainting Page via Ajax

In the portlet context it is advantageous to just repaint one particular portlet instead of the whole page when interacting with it. However, Pages do not have Ajax-able DOM ids to use, since a Page generally handles the whole HTML page in the non-portlet case. Calling target.addComponent(getPage()) leads to a "normal" repaint of the whole portal page.

Is there a way to tell it to repaint just the body of the Page? Is it possible to use a WebMarkupContainer for the body element and possibly override add()/get() etc. to delegate to that container?

Otherwise we can rewrite to use one "portlet page" and use (Ajax-able) panels for what we use pages for today... some portlets already use Panels for state switching already (e.g. portlets using a BreadCrumbBar) so specifying a "regime" for portlet writing here where we have a standard replacable panel container.

Med vennlig hilsen

TOR IVER WILHELMSEN
Senior systemutvikler
Arrive AS
T (+47) 48 16 06 18
E-post: toriverw@arrive.no
http://www.arrive.no
http://servicedesk.arrive.no




SV: Wicket 1.4.x: Repainting Page via Ajax

Posted by Wilhelmsen Tor Iver <To...@arrive.no>.
 
> Attach a web markup container to the body tag. Override
> isTransparentResolver and return true. This gets you a component that you
> can add to the ajax request target to repaint the entire body.

Thanks, I added a wrapping <div> for it (since WicketPortlet strips out the body tag) and it seemingly did the trick regarding having something to repaint (except I started to get maybe unrelated errors that I could not modify the component tree after rendering had started, as if it wasn't in the action phase).

However, we still need to do the refactoring into Panels instead because of the use of setResponsePage(). Or can I reliably do something like create the Page, set it in the Pagemap and then tell the AjaxRequestTarget to render that page's wrapping component instead?

- Tor Iver

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


Re: Wicket 1.4.x: Repainting Page via Ajax

Posted by Jeremy Thomerson <je...@wickettraining.com>.
Attach a web markup container to the body tag. Override
isTransparentResolver and return true. This gets you a component that you
can add to the ajax request target to repaint the entire body.

Jeremy Thomerson
http://wickettraining.com
-- sent from my "smart" phone, so please excuse spelling, formatting, or
compiler errors

On Nov 20, 2010 8:57 AM, "Wilhelmsen Tor Iver" <To...@arrive.no> wrote:

In the portlet context it is advantageous to just repaint one particular
portlet instead of the whole page when interacting with it. However, Pages
do not have Ajax-able DOM ids to use, since a Page generally handles the
whole HTML page in the non-portlet case. Calling
target.addComponent(getPage()) leads to a "normal" repaint of the whole
portal page.

Is there a way to tell it to repaint just the body of the Page? Is it
possible to use a WebMarkupContainer for the body element and possibly
override add()/get() etc. to delegate to that container?

Otherwise we can rewrite to use one "portlet page" and use (Ajax-able)
panels for what we use pages for today... some portlets already use Panels
for state switching already (e.g. portlets using a BreadCrumbBar) so
specifying a "regime" for portlet writing here where we have a standard
replacable panel container.

Med vennlig hilsen

TOR IVER WILHELMSEN
Senior systemutvikler
Arrive AS
T (+47) 48 16 06 18
E-post: toriverw@arrive.no
http://www.arrive.no
http://servicedesk.arrive.no