You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by hill180 <hi...@gmail.com> on 2010/02/24 16:22:47 UTC
Links
Is there an easy way to point two wicket:id link tags to the same link. I
just have the link on the Nav Bar, and in the footer bar, and they do the
same thing.
IE:
<a href="#" wicket:id="restartLink">CANCEL BUTTON</a>
....
<a href="#" wicket:id="cancelLink">CANCEL BUTTON</a>
Java:
restartLink = new Link("restartLink") {
@Override
public void onClick() {
//.....
}
};
cancelLink = new Link("cancelLink") {
@Override
public void onClick() {
//same as restart Link Code.....
}
};
}
Thanks!
Re: Links
Posted by Martijn Dashorst <ma...@gmail.com>.
you need two link instances and two wicket:id's for the cancel links.
<a href="#" wicket:id="restartLink">Restart</a>
....
<a href="#" wicket:id="cancelLink">Cancel</a>
add(new Link("restartLink") {
public void onClick() {
onCancel();
}
});
...
add(new Link("cancelLink") {
public void onClick() {
onCancel();
}
});
...
public void onCancel() {
... cancel functionality goes here
}
Martijn
On Wed, Feb 24, 2010 at 4:22 PM, hill180 <hi...@gmail.com> wrote:
> Is there an easy way to point two wicket:id link tags to the same link. I
> just have the link on the Nav Bar, and in the footer bar, and they do the
> same thing.
>
>
>
> IE:
>
> <a href="#" wicket:id="restartLink">CANCEL BUTTON</a>
>
> ....
>
> <a href="#" wicket:id="cancelLink">CANCEL BUTTON</a>
>
> Java:
>
> restartLink = new Link("restartLink") {
>
> @Override
> public void onClick() {
> //.....
> }
> };
> cancelLink = new Link("cancelLink") {
>
> @Override
> public void onClick() {
> //same as restart Link Code.....
> }
> };
>
>
> }
>
> Thanks!
>
--
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.4 increases type safety for web applications
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.4
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Links
Posted by Azzeddine Daddah <az...@gmail.com>.
public class MyLink extends Link<Void> {
public MyLink(String id) {
super(id);
}
@Override
public void onClick() {
// Your code here
}
}
add(new MyLink("restartLink"));
add(new MyLink("cancelLink"));
On Wed, Feb 24, 2010 at 4:22 PM, hill180 <hi...@gmail.com> wrote:
> Is there an easy way to point two wicket:id link tags to the same link. I
> just have the link on the Nav Bar, and in the footer bar, and they do the
> same thing.
>
>
>
> IE:
>
> <a href="#" wicket:id="restartLink">CANCEL BUTTON</a>
>
> ....
>
> <a href="#" wicket:id="cancelLink">CANCEL BUTTON</a>
>
> Java:
>
> restartLink = new Link("restartLink") {
>
> @Override
> public void onClick() {
> //.....
> }
> };
> cancelLink = new Link("cancelLink") {
>
> @Override
> public void onClick() {
> //same as restart Link Code.....
> }
> };
>
>
> }
>
> Thanks!
>
--
Hbiloo
www.hbiloo.com
Re: Links
Posted by haiko van der schaaf <ha...@ns.nl>.
"Is there an easy way to point two wicket:id link tags to the same link"
>>From a HTML and thus wicket component perspective the links are not the
same. Only the behaviour is the same.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org