Hi again,

I maybe replied a little bit quickly (it was launch time :p). So, I meant
about something like this:

HTML:
    <body onload="window.document.getElementById('form').submit();">
        <form id="form" wicket:id="form">
          <input type="hidden" wicket:id="page" />
        </form>
    </body>

Java counterpart:
    private FormComponent<String> input;

    public HomePage(final PageParameters parameters) {

        final Form<Void> form = new Form<Void>("form") {

            private static final long serialVersionUID = 1L;

            @Override
            @SuppressWarnings("unchecked")
            protected void onSubmit()
            {
                String typeName = input.getModelObject(); //ie:
"com.mycompany.MyPage"
                Class<? extends Page> page = (Class<? extends Page>)
Class.forName(typeName); //!\ need to catch exception
                this.setResponsePage(page);
            }
        };
        this.add(form.setMarkupId("form")); //be careful, you have to set
the htmlId yourself because it is hard-coded in the javascript

        this.input = new HiddenField<String>("page", new
Model<String>(MyPage.class.getName()));
        form.add(this.input);
    }


Where MyPage is the page you want to redirect to.

Hope it answers your need.
Sebastien.


On Mon, Apr 30, 2012 at 12:34 PM, raju.ch <[email protected]>wrote:

> Thnx for the reply sebastian, but I didn't get the solution what you
> suggested..Can you please explain it with an example?
>
> thanks in advance
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/call-onsubmit-automatically-tp4597765p4597836.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to