You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Russell Webb <ru...@voxsurf.com> on 2008/01/14 17:20:04 UTC
Link and Submit behaviour
Got a question on what the expected behaviours are from a link and a
button both of which have their response page set to the same page
(onClick & onSubmit respectively). I took these form items from the
Cheesr example in 'Wicket in Action' and I have used both of these on
the second tab on an AjaxTabbedPanel and both response pages set to
return to the page containing the tabbed panel. Selecting the link
redisplays the tabbed panel showing the first tab. The button, however,
displays the second tab.
I did attempt a cancel "button" and this behaved the same as the link
but I don't understand why disabling validation and form updating should
make a difference. Does anyone have any suggestions as to why there is
different behaviour here?
public class VxsUserPage extends VxsBasePage {
...
public TabPanel2(String id) {
super(id);
Form form = new Form("form");
add(form);
form.add(new VxsUserSettingsPanel("userSettings", new Model(
VxsUserPage.this.user)));
form.add(new Link("cancel") {
@Override
public void onClick() {
setResponsePage(VxsUserPage.class);
}
});
form.add(new Button("submit") {
@Override
public void onSubmit() {
setResponsePage(VxsUserPage.class);
}
});
}
...
}
Regards,
Russell
--
*VoxSurf Limited*
Registered & principal office:
2nd Floor
Elme House
133 Long Acre
London WC2E 9DT
United Kingdom
Company No (England): 4051448
http://www.voxsurf.com/
Email disclaimer: This can be viewed at http://www.voxsurf.com/disclaimer.html
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Link and Submit behaviour
Posted by n0_fixed_ab0de <ru...@voxsurf.com>.
That was it, thanks
--
View this message in context: http://www.nabble.com/Link-and-Submit-behaviour-tp14805240p14841550.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: Link and Submit behaviour
Posted by Frank Bille <fr...@apache.org>.
Could it be because there is validation errors? Try adding a FeedbackPanel.
Frank
On Jan 14, 2008 5:20 PM, Russell Webb <ru...@voxsurf.com> wrote:
> Got a question on what the expected behaviours are from a link and a
> button both of which have their response page set to the same page
> (onClick & onSubmit respectively). I took these form items from the
> Cheesr example in 'Wicket in Action' and I have used both of these on
> the second tab on an AjaxTabbedPanel and both response pages set to
> return to the page containing the tabbed panel. Selecting the link
> redisplays the tabbed panel showing the first tab. The button, however,
> displays the second tab.
> I did attempt a cancel "button" and this behaved the same as the link
> but I don't understand why disabling validation and form updating should
> make a difference. Does anyone have any suggestions as to why there is
> different behaviour here?
>
> public class VxsUserPage extends VxsBasePage {
> ...
>
> public TabPanel2(String id) {
> super(id);
>
> Form form = new Form("form");
> add(form);
> form.add(new VxsUserSettingsPanel("userSettings", new Model(
> VxsUserPage.this.user)));
>
> form.add(new Link("cancel") {
> @Override
> public void onClick() {
> setResponsePage(VxsUserPage.class);
> }
> });
>
> form.add(new Button("submit") {
> @Override
> public void onSubmit() {
> setResponsePage(VxsUserPage.class);
> }
> });
> }
> ...
> }
>
> Regards,
> Russell
>
> --
> *VoxSurf Limited*
> Registered & principal office:
> 2nd Floor
> Elme House
> 133 Long Acre
> London WC2E 9DT
> United Kingdom
> Company No (England): 4051448
>
> http://www.voxsurf.com/
>
> Email disclaimer: This can be viewed at
> http://www.voxsurf.com/disclaimer.html
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>