onSubmit() not called in StatlessForm on pages mounted using 
WebPage#mountBookmarkablePage(String, final Class<T>)
------------------------------------------------------------------------------------------------------------------

                 Key: WICKET-2774
                 URL: https://issues.apache.org/jira/browse/WICKET-2774
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.4.7, 1.4.6
         Environment: j...@preding:~/workspace/wicket-stateless$ uname -a
Linux preding.walmart.com 2.6.31-20-generic #57-Ubuntu SMP Mon Feb 8 09:02:26 
UTC 2010 x86_64 GNU/Linux
j...@preding:~/workspace/wicket-stateless$ java -version
java version "1.6.0_0"
OpenJDK Runtime Environment (IcedTea6 1.6.1) (6b16-1.6.1-3ubuntu1)
OpenJDK 64-Bit Server VM (build 14.0-b16, mixed mode)

            Reporter: Joachim F. Kainz


I am using the following simple application class:

public class WicketApplication extends WebApplication {
    @Override
    public Class<HomePage> getHomePage() {
        return HomePage.class;
    }

    @Override
    protected void init() {
        mountBookmarkablePage("home", HomePage.class);
    }

    @Override
    protected IRequestCycleProcessor newRequestCycleProcessor() {
        return new StatelessWebRequestCycleProcessor();
    }
}

HomePage.html looks like this:

<html
  xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd";>
<head>
<title>Stateless Wicket</title>
</head>
<body>
counter 2:
<form wicket:id="inputForm" method="get">
<label for="a">a:</label>
<input wicket:id="a" id="a" type="text" size="15"/><br/>
<label for="b">b:</label>
<input wicket:id="b" id="b" type="text" size="15"/><br/>
<input type="submit" value="Execute" />
</form>
</body>
</html>

HomePage.java:

public class HomePage extends WebPage {
    public HomePage(final PageParameters parameters) {
        final Form<String> form = new StatelessForm<String>("inputForm") {
            private static final long serialVersionUID = -1804691502079814185L;

            @Override
            protected void onSubmit() {
                info("clicked sumbit");
            }

        };
        final TextField<String> a = new TextField<String>("a",
                new Model<String>(_a));
        final TextField<String> b = new TextField<String>("b",
                new Model<String>(_b));

        form.add(a);
        form.add(b);
        add(form);
    }
}

This very simple code example shows that the StatlessForm#onSubmit() function 
is never called iff mountBookmarkablePage("home", HomePage.class) is in 
WicketApplication#init(). If I remove this statement from the code, the 
onSubmit() method is called as expected.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to