You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by eyalbenamram <ey...@gmail.com> on 2008/10/05 15:56:19 UTC

form GET calling onSubmit

Hi
There is a bug in wicket of a form that uses the GET method 
never calls the onSubmit method. 
I am now using wicket 1.4 m3, and the bug (already reported long time ago)
is still not fixed, though it is said it was fixed. here is my code:

    	Button backBtn = new Button("back_button", new
Model(getString("back")));
    	
    	Form form = new Form("form") {
    		public void onSubmit() {
    			setResponsePage(prevPage);
    		}

    		protected String getMethod() {
                               return "get";
    		}
    	};
    	form.add(backBtn);
    
    	add(form);

What am I doing wrong???

thanks, Eyal.
-- 
View this message in context: http://www.nabble.com/form-GET-calling-onSubmit-tp19824816p19824816.html
Sent from the Wicket - User 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: form GET calling onSubmit

Posted by Jeremy Thomerson <je...@wickettraining.com>.
Eyal,
  The code you supplied seems to work for me, and Igor said in the other
thread that it worked for him as well.  Here is the code for another example
I did to test it.  If you can produce some code that doesn't work, everyone
will be able to help more.  In the meantime, if you try the code you posted
again, or use this code, maybe it will work for you.

  By the way - is it possible that you had setRequired(true) or some
validator on one of your inputs that was producing a validation error?  This
would stop the form from ever getting to the onSubmit, and you might not
know it if you didn't have a feedback panel to show the validation error.

-- 
Jeremy Thomerson
http://www.wickettraining.com


Some code that definitely works:

public class Mockup extends WebPage {

    private String message = "TEST";

    public Mockup(){
        Form<Void> form = new Form<Void>("form") {
            private static final long serialVersionUID = 1L;

            @Override
            protected void onSubmit() {
                super.onSubmit();
                System.out.println("Message: " + message);
                setResponsePage(HomePage.class);
            }

            @Override
            protected String getMethod() {
                return Form.METHOD_GET;
            }

        };
        form.add(new TextField<String>("textfield", new
PropertyModel<String>(this, "message")));
        add(form);
        add(new Label("label", new PropertyModel<String>(this, "message")));
    }
}

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>Wicket Training - classes for learning wicket</title>
    </head>
    <body>
        <form wicket:id="form">
            <input type="text" wicket:id="textfield" />
            <input type="submit" value="submit" />
        </form>
        <b wicket:id="label"></b>
    </body>
</html>



On Sun, Oct 5, 2008 at 11:32 AM, eyalbenamram <ey...@gmail.com>wrote:

>
> No, I am using a regular form. the example I brought was to show the JIRA
> report.
> There was a report regarding the regular form but I couldn't find it.
>
> igor.vaynberg wrote:
> >
> > are you using a StatelessForm? because in your example you showed a
> > regular form
> >
> > -igor
> >
> > On Sun, Oct 5, 2008 at 9:04 AM, eyalbenamram <ey...@gmail.com>
> > wrote:
> >>
> >> JIRA:
> >> https://issues.apache.org/jira/browse/WICKET-1580
> >>
> >>
> >> igor.vaynberg wrote:
> >>>
> >>> where is the bug report?
> >>>
> >>> -igor
> >>>
> >>> On Sun, Oct 5, 2008 at 6:56 AM, eyalbenamram <ey...@gmail.com>
> >>> wrote:
> >>>>
> >>>> Hi
> >>>> There is a bug in wicket of a form that uses the GET method
> >>>> never calls the onSubmit method.
> >>>> I am now using wicket 1.4 m3, and the bug (already reported long time
> >>>> ago)
> >>>> is still not fixed, though it is said it was fixed. here is my code:
> >>>>
> >>>>        Button backBtn = new Button("back_button", new
> >>>> Model(getString("back")));
> >>>>
> >>>>        Form form = new Form("form") {
> >>>>                public void onSubmit() {
> >>>>                        setResponsePage(prevPage);
> >>>>                }
> >>>>
> >>>>                protected String getMethod() {
> >>>>                               return "get";
> >>>>                }
> >>>>        };
> >>>>        form.add(backBtn);
> >>>>
> >>>>        add(form);
> >>>>
> >>>> What am I doing wrong???
> >>>>
> >>>> thanks, Eyal.
> >>>> --
> >>>> View this message in context:
> >>>>
> http://www.nabble.com/form-GET-calling-onSubmit-tp19824816p19824816.html
> >>>> Sent from the Wicket - User 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
> >>>
> >>>
> >>>
> >>
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/form-GET-calling-onSubmit-tp19824816p19826029.html
> >> Sent from the Wicket - User 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
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/form-GET-calling-onSubmit-tp19824816p19826373.html
> Sent from the Wicket - User 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: form GET calling onSubmit

Posted by eyalbenamram <ey...@gmail.com>.
No, I am using a regular form. the example I brought was to show the JIRA
report.
There was a report regarding the regular form but I couldn't find it.

igor.vaynberg wrote:
> 
> are you using a StatelessForm? because in your example you showed a
> regular form
> 
> -igor
> 
> On Sun, Oct 5, 2008 at 9:04 AM, eyalbenamram <ey...@gmail.com>
> wrote:
>>
>> JIRA:
>> https://issues.apache.org/jira/browse/WICKET-1580
>>
>>
>> igor.vaynberg wrote:
>>>
>>> where is the bug report?
>>>
>>> -igor
>>>
>>> On Sun, Oct 5, 2008 at 6:56 AM, eyalbenamram <ey...@gmail.com>
>>> wrote:
>>>>
>>>> Hi
>>>> There is a bug in wicket of a form that uses the GET method
>>>> never calls the onSubmit method.
>>>> I am now using wicket 1.4 m3, and the bug (already reported long time
>>>> ago)
>>>> is still not fixed, though it is said it was fixed. here is my code:
>>>>
>>>>        Button backBtn = new Button("back_button", new
>>>> Model(getString("back")));
>>>>
>>>>        Form form = new Form("form") {
>>>>                public void onSubmit() {
>>>>                        setResponsePage(prevPage);
>>>>                }
>>>>
>>>>                protected String getMethod() {
>>>>                               return "get";
>>>>                }
>>>>        };
>>>>        form.add(backBtn);
>>>>
>>>>        add(form);
>>>>
>>>> What am I doing wrong???
>>>>
>>>> thanks, Eyal.
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/form-GET-calling-onSubmit-tp19824816p19824816.html
>>>> Sent from the Wicket - User 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
>>>
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/form-GET-calling-onSubmit-tp19824816p19826029.html
>> Sent from the Wicket - User 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
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/form-GET-calling-onSubmit-tp19824816p19826373.html
Sent from the Wicket - User 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: form GET calling onSubmit

Posted by Igor Vaynberg <ig...@gmail.com>.
are you using a StatelessForm? because in your example you showed a regular form

-igor

On Sun, Oct 5, 2008 at 9:04 AM, eyalbenamram <ey...@gmail.com> wrote:
>
> JIRA:
> https://issues.apache.org/jira/browse/WICKET-1580
>
>
> igor.vaynberg wrote:
>>
>> where is the bug report?
>>
>> -igor
>>
>> On Sun, Oct 5, 2008 at 6:56 AM, eyalbenamram <ey...@gmail.com>
>> wrote:
>>>
>>> Hi
>>> There is a bug in wicket of a form that uses the GET method
>>> never calls the onSubmit method.
>>> I am now using wicket 1.4 m3, and the bug (already reported long time
>>> ago)
>>> is still not fixed, though it is said it was fixed. here is my code:
>>>
>>>        Button backBtn = new Button("back_button", new
>>> Model(getString("back")));
>>>
>>>        Form form = new Form("form") {
>>>                public void onSubmit() {
>>>                        setResponsePage(prevPage);
>>>                }
>>>
>>>                protected String getMethod() {
>>>                               return "get";
>>>                }
>>>        };
>>>        form.add(backBtn);
>>>
>>>        add(form);
>>>
>>> What am I doing wrong???
>>>
>>> thanks, Eyal.
>>> --
>>> View this message in context:
>>> http://www.nabble.com/form-GET-calling-onSubmit-tp19824816p19824816.html
>>> Sent from the Wicket - User 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
>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/form-GET-calling-onSubmit-tp19824816p19826029.html
> Sent from the Wicket - User 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: form GET calling onSubmit

Posted by eyalbenamram <ey...@gmail.com>.
JIRA:
https://issues.apache.org/jira/browse/WICKET-1580


igor.vaynberg wrote:
> 
> where is the bug report?
> 
> -igor
> 
> On Sun, Oct 5, 2008 at 6:56 AM, eyalbenamram <ey...@gmail.com>
> wrote:
>>
>> Hi
>> There is a bug in wicket of a form that uses the GET method
>> never calls the onSubmit method.
>> I am now using wicket 1.4 m3, and the bug (already reported long time
>> ago)
>> is still not fixed, though it is said it was fixed. here is my code:
>>
>>        Button backBtn = new Button("back_button", new
>> Model(getString("back")));
>>
>>        Form form = new Form("form") {
>>                public void onSubmit() {
>>                        setResponsePage(prevPage);
>>                }
>>
>>                protected String getMethod() {
>>                               return "get";
>>                }
>>        };
>>        form.add(backBtn);
>>
>>        add(form);
>>
>> What am I doing wrong???
>>
>> thanks, Eyal.
>> --
>> View this message in context:
>> http://www.nabble.com/form-GET-calling-onSubmit-tp19824816p19824816.html
>> Sent from the Wicket - User 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
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/form-GET-calling-onSubmit-tp19824816p19826029.html
Sent from the Wicket - User 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: form GET calling onSubmit

Posted by Igor Vaynberg <ig...@gmail.com>.
where is the bug report?

-igor

On Sun, Oct 5, 2008 at 6:56 AM, eyalbenamram <ey...@gmail.com> wrote:
>
> Hi
> There is a bug in wicket of a form that uses the GET method
> never calls the onSubmit method.
> I am now using wicket 1.4 m3, and the bug (already reported long time ago)
> is still not fixed, though it is said it was fixed. here is my code:
>
>        Button backBtn = new Button("back_button", new
> Model(getString("back")));
>
>        Form form = new Form("form") {
>                public void onSubmit() {
>                        setResponsePage(prevPage);
>                }
>
>                protected String getMethod() {
>                               return "get";
>                }
>        };
>        form.add(backBtn);
>
>        add(form);
>
> What am I doing wrong???
>
> thanks, Eyal.
> --
> View this message in context: http://www.nabble.com/form-GET-calling-onSubmit-tp19824816p19824816.html
> Sent from the Wicket - User 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