You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Milind <m....@maxxton.com> on 2014/12/23 08:17:51 UTC

setResponsePage with AjaxButton not working correctly

Hello all,

Currently i am using wicket 6.18 with liferay-portal-6.2-ce-ga2, 

Below is code written in TestPage.java

 AjaxButton testButton = new AjaxButton("testButton", form)
    {
      private static final long serialVersionUID = 1L;

      @Override
      protected void onSubmit(AjaxRequestTarget target,  Form<?> form)
      {
         setResponsePage(SecondPage.class, pageParams)
      }
    }

When testButton is added inside <form> then only it calls the onSubmit()
method else not.

and after adding it to <form> tag, its not working for setResponsePage()
call, and shows below error inside Ajax-debug-window.

ERROR: Wicket.Ajax.Call.failure: Error while parsing response: Error:
Invalid XML: <!DOCTYPE html> <html class="aui ltr" dir="ltr" lang="en-US">
<head> <title>Home - Test</title> <meta content="initial-scale=1.0,
width=device-width" name="viewport" /> <meta content="text/html;
charset=UTF-8" http-equiv="content-type" /> <link
href="http://localhost:8150/test-theme/images/favicon.ico" rel="Shortcut
Icon" />... 




Please revert if anyone knows this issue.

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/setResponsePage-with-AjaxButton-not-working-correctly-tp4668881.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: setResponsePage with AjaxButton not working correctly

Posted by Milind <m....@maxxton.com>.
Its its workaround , not correct fix.

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/setResponsePage-with-AjaxButton-not-working-correctly-tp4668881p4668886.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: setResponsePage with AjaxButton not working correctly

Posted by Martin Grigorov <mg...@apache.org>.
On Tue, Dec 23, 2014 at 12:32 PM, Milind <m....@maxxton.com> wrote:

> when
>
> target.appendJavaScript("window.location='"+urlFor(CreateNewIssueMainPage.class,
> params)+"'");
> is used with AjaxButton its working, but not sure if its correct way.
>

This definitely looks like a workaround!
But I cannot give you more proper solution in this case.


>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/setResponsePage-with-AjaxButton-not-working-correctly-tp4668881p4668884.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: setResponsePage with AjaxButton not working correctly

Posted by Milind <m....@maxxton.com>.
when
target.appendJavaScript("window.location='"+urlFor(CreateNewIssueMainPage.class,
params)+"'");
is used with AjaxButton its working, but not sure if its correct way.



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/setResponsePage-with-AjaxButton-not-working-correctly-tp4668881p4668884.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: setResponsePage with AjaxButton not working correctly

Posted by Tobias Soloschenko <to...@googlemail.com>.
Hi,

I also had troubles to set the response page within an ajax callback in the portlet apps. The workaround for me was not to switch the whole page, but to wrap the content into one panel and switch this. I think it might has something to do with the markup of the portlet container, because it is not valid xml, but I don't know this for sure.

kind regards

Tobias

> Am 23.12.2014 um 08:32 schrieb Martin Grigorov <mg...@apache.org>:
> 
> Hi,
> 
> I guess it is a problem with wicketstuff-portlet library.
> Hopefully someone more experienced with Portlets will help you!
> 
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
> 
>> On Tue, Dec 23, 2014 at 9:17 AM, Milind <m....@maxxton.com> wrote:
>> 
>> Hello all,
>> 
>> Currently i am using wicket 6.18 with liferay-portal-6.2-ce-ga2,
>> 
>> Below is code written in TestPage.java
>> 
>> AjaxButton testButton = new AjaxButton("testButton", form)
>>    {
>>      private static final long serialVersionUID = 1L;
>> 
>>      @Override
>>      protected void onSubmit(AjaxRequestTarget target,  Form<?> form)
>>      {
>>         setResponsePage(SecondPage.class, pageParams)
>>      }
>>    }
>> 
>> When testButton is added inside <form> then only it calls the onSubmit()
>> method else not.
>> 
>> and after adding it to <form> tag, its not working for setResponsePage()
>> call, and shows below error inside Ajax-debug-window.
>> 
>> ERROR: Wicket.Ajax.Call.failure: Error while parsing response: Error:
>> Invalid XML: <!DOCTYPE html> <html class="aui ltr" dir="ltr" lang="en-US">
>> <head> <title>Home - Test</title> <meta content="initial-scale=1.0,
>> width=device-width" name="viewport" /> <meta content="text/html;
>> charset=UTF-8" http-equiv="content-type" /> <link
>> href="http://localhost:8150/test-theme/images/favicon.ico" rel="Shortcut
>> Icon" />...
>> 
>> 
>> 
>> 
>> Please revert if anyone knows this issue.
>> 
>> --
>> View this message in context:
>> http://apache-wicket.1842946.n4.nabble.com/setResponsePage-with-AjaxButton-not-working-correctly-tp4668881.html
>> Sent from the Users forum mailing list archive at Nabble.com.
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>> 
>> 

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


Re: setResponsePage with AjaxButton not working correctly

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

I guess it is a problem with wicketstuff-portlet library.
Hopefully someone more experienced with Portlets will help you!

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Tue, Dec 23, 2014 at 9:17 AM, Milind <m....@maxxton.com> wrote:

> Hello all,
>
> Currently i am using wicket 6.18 with liferay-portal-6.2-ce-ga2,
>
> Below is code written in TestPage.java
>
>  AjaxButton testButton = new AjaxButton("testButton", form)
>     {
>       private static final long serialVersionUID = 1L;
>
>       @Override
>       protected void onSubmit(AjaxRequestTarget target,  Form<?> form)
>       {
>          setResponsePage(SecondPage.class, pageParams)
>       }
>     }
>
> When testButton is added inside <form> then only it calls the onSubmit()
> method else not.
>
> and after adding it to <form> tag, its not working for setResponsePage()
> call, and shows below error inside Ajax-debug-window.
>
> ERROR: Wicket.Ajax.Call.failure: Error while parsing response: Error:
> Invalid XML: <!DOCTYPE html> <html class="aui ltr" dir="ltr" lang="en-US">
> <head> <title>Home - Test</title> <meta content="initial-scale=1.0,
> width=device-width" name="viewport" /> <meta content="text/html;
> charset=UTF-8" http-equiv="content-type" /> <link
> href="http://localhost:8150/test-theme/images/favicon.ico" rel="Shortcut
> Icon" />...
>
>
>
>
> Please revert if anyone knows this issue.
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/setResponsePage-with-AjaxButton-not-working-correctly-tp4668881.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>