You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Pedro Santos <pe...@gmail.com> on 2011/02/09 17:59:32 UTC

Re: StatelessForm growing url when there is errorvalidation

There is one: https://issues.apache.org/jira/browse/WICKET-3438

It was fixed, but I don't know if it was the right fix, why Wicket 1.4 is
cloning the request parameters to bookmarkable targets in
RequestCycle#urlFor(Component,RequestListenerInterface,ValueMap)
If it just use those on params ValueMap this problem would not happen.

On Wed, Feb 9, 2011 at 2:27 PM, Igor Vaynberg <ig...@gmail.com>wrote:

> hrm. i thought this was fixed a long time ago. please file a bug with
> a quickstart.
>
> -igor
>
> On Wed, Feb 9, 2011 at 2:09 AM, Olivier Dutrieux
> <ol...@pasteur.fr> wrote:
> >
> > Hello,
> >
> > I have a strange problem with statelessForm :
> >
> > I would like a stateless application with 2 statelessForm and with somes
> > required validators on form :
> >
> > public class HomePage extends WebPage {
> >
> >        private static final long serialVersionUID = 1L;
> >
> >    public HomePage(final PageParameters parameters) {
> >        super(parameters);
> >        setVersioned(false);
> >        Form form1 = new StatelessForm("form1") {
> >            @Override
> >            protected void onSubmit() {
> >                setResponsePage(ResultPage.class);
> >            }
> >        };
> >        form1.add(new TextField<String>("input1").setRequired(true));
> >        add(form1);
> >
> >        Form form2 = new StatelessForm("form2") {
> >            @Override
> >            protected void onSubmit() {
> >                setResponsePage(ResultPage.class);
> >            }
> >        };
> >        form2.add(new TextField<String>("input1").setRequired(true));
> >        add(form2);
> >    }
> > }
> >
> > The problem is when I submit alternatively each form (I don't fill the
> > Textfield required intentionally), the url growing like this :
> >
> > 1st submit :
> >
> http://localhost:8080/Wicket-Test/HomePage.html?wicket:interface=:0:form2::IFormSubmitListener
> ::
> > 2nd submit :
> >
> http://localhost:8080/Wicket-Test/HomePage.html?form22_hf_0=&wicket:interface=:0:form1::IFormSubmitListener
> ::
> > 3th submit :
> >
> http://localhost:8080/Wicket-Test/HomePage.html?form22_hf_0=&form12_hf_0=&wicket:interface=:0:form2::IFormSubmitListener
> ::
> > 4th submit :
> >
> http://localhost:8080/Wicket-Test/HomePage.html?form22_hf_0=&form22_hf_0=&form12_hf_0=&wicket:interface=:0:form1::IFormSubmitListener
> ::
> > ...
> >
> > Is there a solution to solve this problem ?
> >
> > Best regards
> >
> > I use wicket 1.4.15
> >
> > http://apache-wicket.1842946.n4.nabble.com/file/n3296950/Wicket-test.rar
> > Wicket-test.rar
> >
> > -----
> > Duto
> > --
> > View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/StatelessForm-growing-url-when-there-is-errorvalidation-tp3296950p3296950.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
>
>


-- 
Pedro Henrique Oliveira dos Santos

Re: StatelessForm growing url when there is errorvalidation

Posted by Pedro Santos <pe...@gmail.com>.
My mistake, RequestCycle is cloning the page parameters, not in every case
it will be those in request.

On Wed, Feb 9, 2011 at 2:59 PM, Pedro Santos <pe...@gmail.com> wrote:

> There is one: https://issues.apache.org/jira/browse/WICKET-3438
>
> It was fixed, but I don't know if it was the right fix, why Wicket 1.4 is
> cloning the request parameters to bookmarkable targets in
> RequestCycle#urlFor(Component,RequestListenerInterface,ValueMap)
> If it just use those on params ValueMap this problem would not happen.
>
>
> On Wed, Feb 9, 2011 at 2:27 PM, Igor Vaynberg <ig...@gmail.com>wrote:
>
>> hrm. i thought this was fixed a long time ago. please file a bug with
>> a quickstart.
>>
>> -igor
>>
>> On Wed, Feb 9, 2011 at 2:09 AM, Olivier Dutrieux
>> <ol...@pasteur.fr> wrote:
>> >
>> > Hello,
>> >
>> > I have a strange problem with statelessForm :
>> >
>> > I would like a stateless application with 2 statelessForm and with somes
>> > required validators on form :
>> >
>> > public class HomePage extends WebPage {
>> >
>> >        private static final long serialVersionUID = 1L;
>> >
>> >    public HomePage(final PageParameters parameters) {
>> >        super(parameters);
>> >        setVersioned(false);
>> >        Form form1 = new StatelessForm("form1") {
>> >            @Override
>> >            protected void onSubmit() {
>> >                setResponsePage(ResultPage.class);
>> >            }
>> >        };
>> >        form1.add(new TextField<String>("input1").setRequired(true));
>> >        add(form1);
>> >
>> >        Form form2 = new StatelessForm("form2") {
>> >            @Override
>> >            protected void onSubmit() {
>> >                setResponsePage(ResultPage.class);
>> >            }
>> >        };
>> >        form2.add(new TextField<String>("input1").setRequired(true));
>> >        add(form2);
>> >    }
>> > }
>> >
>> > The problem is when I submit alternatively each form (I don't fill the
>> > Textfield required intentionally), the url growing like this :
>> >
>> > 1st submit :
>> >
>> http://localhost:8080/Wicket-Test/HomePage.html?wicket:interface=:0:form2::IFormSubmitListener
>> ::
>> > 2nd submit :
>> >
>> http://localhost:8080/Wicket-Test/HomePage.html?form22_hf_0=&wicket:interface=:0:form1::IFormSubmitListener
>> ::
>> > 3th submit :
>> >
>> http://localhost:8080/Wicket-Test/HomePage.html?form22_hf_0=&form12_hf_0=&wicket:interface=:0:form2::IFormSubmitListener
>> ::
>> > 4th submit :
>> >
>> http://localhost:8080/Wicket-Test/HomePage.html?form22_hf_0=&form22_hf_0=&form12_hf_0=&wicket:interface=:0:form1::IFormSubmitListener
>> ::
>> > ...
>> >
>> > Is there a solution to solve this problem ?
>> >
>> > Best regards
>> >
>> > I use wicket 1.4.15
>> >
>> >
>> http://apache-wicket.1842946.n4.nabble.com/file/n3296950/Wicket-test.rar
>> > Wicket-test.rar
>> >
>> > -----
>> > Duto
>> > --
>> > View this message in context:
>> http://apache-wicket.1842946.n4.nabble.com/StatelessForm-growing-url-when-there-is-errorvalidation-tp3296950p3296950.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
>>
>>
>
>
> --
> Pedro Henrique Oliveira dos Santos
>



-- 
Pedro Henrique Oliveira dos Santos