Eelco Hillenius wrote:
On 9/6/07, Arinté <[EMAIL PROTECTED]> wrote:
Ok when the user press the submit button on a wicket form, how do you make
it go to another page? onSubmit has a void return....
Use setResponsePage.
Eelco
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
I have tried that but it doesn't go to the next page. I am using wicket 13b3.
Here is the code:
public class Index extends WebPage
{
UserBean ub = new UserBean();
/**
* Comment for <code>serialVersionUID</code>
*/
private static final long serialVersionUID = 1L;
public Index()
{
add(new Label("message"));
add(new TextField("user", new IModel() {
public Object getObject()
{
return ub.getName();
}
public void setObject(Object object)
{
ub.setName((String) object);
}
public void detach(){}
}));
add(new PasswordTextField("password"));
add( new Button("logon"){
@Override
public void onSubmit()
{
info("get " + Index.this.getRequestCycle().getResponsePage());
System.out.println("get " +
Index.this.getRequestCycle().getResponsePage());
super.setResponsePage( Welcome.class );
//super.onSubmit();
}});
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]