So then you don't need it to wrap around a page.
On 11/6/05, Janne Hietamäki <[EMAIL PROTECTED]> wrote:
Hi,
I'm doing some AJAX-stuff, and because there is not yet real support of
rendering single components (and having a URL for a Component) I'm doing
all this stuff with a AjaxWrapperPage like
public class AjaxWrapperPage extends WebPage {
public AjaxFieldResult(Component component) {
add(component);
}
}
and markup which only results the component..
<span wicket:id="result"></span>
My implementation is a little more complex, so I don't have to care
about the component naming and other stuff, anyway..
I have a interface like IAjaxListener which extends IRequestListener:
public interface IAjaxRequestListener extends IRequestListener {
void onAjaxRequest();
}
And I use all this stuff with:
protected void onAjaxRequest(){
RequestCycle.get().setResponsePage(new
AjaxWrapperPage(component));
}
Everything works fine, but I have a problem with PageMaps.. Since I
can't set the PageMap when creating a Page, these AjaxWrapperPages go to
default PageMap, and cause expired pages. And I wouldn't really want to
add these pages to any pagemap at all, since I know they will be
rendered only once, ever.
This whole thing is not really too slick and clean, but it allows me to
do nice AJAX-stuff with wicket.
Something like this would solve my problems on Page.java
private final void init()
{
// All Pages are born dirty so they get clustered right away
setDirty(true);
// set the pagemap
setPageMap(getDefaultPageMap());
setId(getPageMap().getNextId());
// Set versioning of page based on default
setVersioned(Application.get().getSettings().getVersionPagesByDefault());
}
protected String getDefaultPageMap(){
return getRequestCycle() != null ?
getRequestCycle().getRequest().getParameter("pagemap") : null;
}
This would allow me to force my WrapperPages to go to another PageMap..
Any ideas?
--
Janne Hietamäki
Cemron Ltd
http://www.cemron.com/
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user