how to send a request to an external url from wicket?

2015-07-21 Thread cosmindumy
Hello,
My form needs to make the post request to an external URL. Basically is
about sending a request to a payment server.
I know that my form needs to override the action value, but what I actually
want is to validate the form and handle the fields
and afterwards to send the request to the payment server.

something like
protected void onSubmit(final AjaxRequestTarget target, final Form? form)
{
  vvalidate fields
if (fields are valid) {
buildRequestParameter;
sendPostRequest 
redirect client to the payment server.
}
}

What is the recomended way to do this?
Thanks.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/how-to-send-a-request-to-an-external-url-from-wicket-tp4671642.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: how to send a request to an external url from wicket?

2015-07-21 Thread Sven Meier

Hi,

throw a RedirectToUrlException in your #onSubmit().

Have fun|
Sven

|
On 21.07.2015 17:09, cosmindumy wrote:

Hello,
My form needs to make the post request to an external URL. Basically is
about sending a request to a payment server.
I know that my form needs to override the action value, but what I actually
want is to validate the form and handle the fields
and afterwards to send the request to the payment server.

something like
protected void onSubmit(final AjaxRequestTarget target, final Form? form)
{
   vvalidate fields
 if (fields are valid) {
buildRequestParameter;
sendPostRequest
redirect client to the payment server.
}
 }

What is the recomended way to do this?
Thanks.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/how-to-send-a-request-to-an-external-url-from-wicket-tp4671642.html
Sent from the Users forum mailing list archive at Nabble.com.

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





Re: Howto have just currently viewed page in session...

2015-07-21 Thread tomask79
Really no one? Nobody solves problem of having refreshing timer in pages and
using PageNumberEvictionStrategy(1) because this obviously doesn't work when
you're redirecting to another page again with timerYou can end up in
situation that previous page is dropped, but timer sent ajax already, wicket
then recreates page again but without pageparams = crash...







--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Howto-have-just-currently-viewed-page-in-session-tp4671631p4671634.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Howto have just currently viewed page in session...

2015-07-21 Thread tomask79
Hi Christoph,

no, I have no serialization problemsIf you use ajax refresh timer *with
high frequency* in pages then PageNumberEvictionStrategy(1) makes your app
very unstable...Page is sometimes recreated by framework (*if you redirect
to another page*), but without page parameters. So if you're expecting
particular page params, you have an app crash...To understand what I'm
saying you need to look at PageProvider.resolvePageInstance method,
otherwise you can't understand.

Btw, we allow our users to use multiple tabs, but we don't want to remember
all pages...So we have 1 page per tab in session, which is ideal state. But
with ajax timer you have mentioned problem.

I will create ticket in Jira with demo...





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Howto-have-just-currently-viewed-page-in-session-tp4671631p4671639.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Wicket 6 - test ajax component.

2015-07-21 Thread andrea del bene

Hi,

I don't think it's possible to send a specific key as this requires 
JavaScript code to be executed. But you can test AJAX events:


//simulate an AJAX click event
tester.executeAjaxEvent(label, click);


See 'Testing AJAX events' in the userguide for more details.

Andrea.

On 20/07/2015 16:27, gump lee wrote:

Dear All,

Is it possible to write a unit test with WicketTester which I need to send
Enter key to an AJAX component?


Best regards,
Gump




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



Re: Howto have just currently viewed page in session...

2015-07-21 Thread Christoph Läubrich
I think you have to provide more information, because in general 
evicting the page from in -memory store just mean it must be reloaded 
from the PageStor/DataStore! If this fails, then your application most 
likeley has serialization issues.
So what is the crash you encounter? Why is it not feasable to have at 
least 2 pages stored if it solves your problem? and so on...


Am 21.07.2015 10:33, schrieb tomask79:

Really no one? Nobody solves problem of having refreshing timer in pages and
using PageNumberEvictionStrategy(1) because this obviously doesn't work when
you're redirecting to another page again with timerYou can end up in
situation that previous page is dropped, but timer sent ajax already, wicket
then recreates page again but without pageparams =  crash...


   



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