You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Sergey Olefir <so...@gmail.com> on 2010/03/23 10:09:09 UTC
Simple way to use button as link?
Hi,
for user interface reasons I want to use button on an otherwise
read-only page that would simply open another page (e.g. act just like
a link would). What would be the simplest way to achieve that
(including i18n)?
I'm currently using form like this:
<form wicket:id="signButtonForm">
<button type="submit"><wicket:message key="i18nKey">Placeholder:
Execute</wicket:message></button>
</form>
---
Form<?> form = new Form<Object>("signButtonForm")
{
protected void onSubmit()
{
setResponsePage(new OtherPage());
}
};
add(form);
---
This works, but seems rather verbose and roundabout. Is there a better way?
Thanks in advance!
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Simple way to use button as link?
Posted by James Carman <jc...@carmanconsulting.com>.
Try <button wicket:id="myLink"><wicket:message key="i18nkey"
/></button>. Then, just add any type of link object to your page with
id "myLink." You can attach a link to darn-near anything and it will
work.
On Tue, Mar 23, 2010 at 5:09 AM, Sergey Olefir <so...@gmail.com> wrote:
> Hi,
>
> for user interface reasons I want to use button on an otherwise
> read-only page that would simply open another page (e.g. act just like
> a link would). What would be the simplest way to achieve that
> (including i18n)?
>
> I'm currently using form like this:
> <form wicket:id="signButtonForm">
> <button type="submit"><wicket:message key="i18nKey">Placeholder:
> Execute</wicket:message></button>
> </form>
>
> ---
>
> Form<?> form = new Form<Object>("signButtonForm")
> {
> protected void onSubmit()
> {
> setResponsePage(new OtherPage());
> }
> };
> add(form);
>
> ---
>
> This works, but seems rather verbose and roundabout. Is there a better way?
>
> Thanks in advance!
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org