Hi,

Sorry, I have to explain detailed, but the situation is not complicated. I
run into a NPE and I'm not sure if it's a wicket or inmethod-grid issue (or
even my fault ;-), so I need your assistance where to fill a issue. 

Situation:
I have a page with a inmethod grid. From there I can navigate to a page
containing a edit form. The PageParameters contains a PageReference, so
onSubmit I'm able to response back to the page I came from, like:

    setResponsePage(reference.getPage());

This works great when I'm using org.apache.wicket.markup.html.form.Button.
When I'm using AjaxButton instead of Button I'm getting a NPE in
com.inmethod.grid.common.AbstractGrid (line 130, constructor ->
Behavior#afterRender)...

   if (getWebRequest().isAjax()) {
      
AjaxRequestTarget.get().appendJavaScript(getInitializationJavascript());
   }

...this, because isAjax() is true, but AjaxRequestTarget.get() is null.

Something I figure out: When I use setResponsePage to a new version (instead
of using Page from PageManager) like:

    Page page = reference.getPage(); 
    setResponsePage(page.getClass(), page.getPageParameter()) ;

...isAjax() returns false, so NPE happens only when I use Page from
PageManager (and I have to).

So the question is:
It's wrong that isAjax() returns true in case of Page from PageManager
...or...
is the if-statement of inmethod AbstractGrid wrong?

Any help would be appreciated.

regards
minas.

If you want I can upload a minimal project to reproduce.
wicket 1.5.7, wicketstuff 1.5.5


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/NPE-with-setResponsePage-using-Page-from-PageManager-tp4650186.html
Sent from the Forum for Wicket Core developers mailing list archive at 
Nabble.com.

Reply via email to