Re: Form submit without redirection

2013-06-18 Thread martin.dilger
If you work with JQuery and Validation, why dont you use Ajax to Submit your
form? You could attach your errors to the AjaxRequestTarget as JavaScript /
JSON and process it on the client-side, which would be far better that using
PageParameters instead? 



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Form-submit-without-redirection-tp4659496p4659581.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: Form submit without redirection

2013-06-18 Thread divad91
Yeah it would be much easier that way. We have ajax for every actions in our
form but when we want to change page, we use the full submit. I could do
the same thing with an abstract behavior. I will give it a try.
Thanks.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Form-submit-without-redirection-tp4659496p4659598.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: Form submit without redirection

2013-06-17 Thread divad91
Hi thanks for your response.

The errors that I want to send back are my form business error.
I use jQuery validate to do my frontend validation and to display them. We
build a custom plugin to display the business errors the same way the
frontend errors are displayed.
So basically, I send back a list of business errors to a javascript template
that will merge these errors to the jQuery validation plugin. (each errors
are recorded to a specific field).

I know I should not pass page parameters but this is how the they manage to
do it in wicket 1.4.2 and there were not passed in the URL (get)...

So I will do a little refactoring.. Where should I keep my error list to
send to the same page  ?
Session or Metadata or else ?

thanks
David



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Form-submit-without-redirection-tp4659496p4659547.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: Form submit without redirection

2013-06-16 Thread Martin Grigorov
Hi,

What are these errors ?
And why do you put them in PageParameters ? PageParameters is used to pass
request GET parameters to some page.
POST parameters are sent only from the browser to the server. The server
cannot send POST parameters in the response to the browser. This is how
HTTP works, nothing Wicket specific.

Usually when you want to show feedback to the user (errors or success
messages) then you should use Component's or Session's #error() or
#success() methods. If there is a FeedbackPanel in the page these messages
will be shown automatically for you.


On Fri, Jun 14, 2013 at 9:59 PM, divad91 diva...@hotmail.com wrote:

 Or is there a way I can add extra post parameters to my request ?
 I don't want to put my errors in my session (too much management). I would
 like to add my errors to my request only for the current request (request
 scope)


 Is there a way I can achieve this ?

 Thanks





 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Form-submit-without-redirection-tp4659496p4659509.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




Form submit without redirection

2013-06-14 Thread divad91
Hi, I migrated my application from wicket 1.4.21 to 6.8.0.

In the onSubmit method of a SubmitLink, if errors are present in the
submitted values, I want to display the same page with the specified errors.

In wicket 1.4, I was doing this :

public void handleErrors() {
if (!this.errors.isEmpty()) {
// Pass the errors to the resulting page
final PageParameters params = new PageParameters();
params.put(errors, this.errors);

// Do not redirect!
getRequestCycle().setRedirect(false);

// Same page is shown with validation errors
setResponsePage(getClass(), params);
}
}

The errors were passed to the response in post parameters.

Now, with wicket 6.8.0 (think this appears since wicket 5...), the only
difference in my code is that the method
getRequestCycle().setRedirect(false)   disappear.

Now, all my errors are sent in the URL because of the redirect after the
post. 

Is there a way that I can turn off the redirection only if errors are
present ?
I don't want to see all my errors in the URL.

Thanks
David






--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Form-submit-without-redirection-tp4659496.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: Form submit without redirection

2013-06-14 Thread divad91
Or is there a way I can add extra post parameters to my request ?
I don't want to put my errors in my session (too much management). I would
like to add my errors to my request only for the current request (request
scope)


Is there a way I can achieve this ?

Thanks





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Form-submit-without-redirection-tp4659496p4659509.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