You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Igor Vaynberg (JIRA)" <ji...@apache.org> on 2010/03/11 05:35:27 UTC

[jira] Commented: (WICKET-2774) Form#onSubmit() not called in StatlessForm on pages mounted using WebPage#mountBookmarkablePage(String, Class)

    [ https://issues.apache.org/jira/browse/WICKET-2774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12843903#action_12843903 ] 

Igor Vaynberg commented on WICKET-2774:
---------------------------------------

does it work if you remove the StatelessWebRequestCycleProcessor? that is not a class we ship with wicket...

> Form#onSubmit() not called in StatlessForm on pages mounted using WebPage#mountBookmarkablePage(String, Class)
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-2774
>                 URL: https://issues.apache.org/jira/browse/WICKET-2774
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.6, 1.4.7
>         Environment: jfk@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
> jfk@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.