Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

using images for links with <wicket:link>

I'm trying to use an image for a link like so:

<wicket:link>
    <a href="UploadPage.html">
        <img src="/logo.png"/>
    </a>
</wicket:link>

In the rendered HTML, the href of the <a> is correctly set to my upload page.

But curiously, Wicket adds onclick=window.location.href='/logo.png' to the <img> tag. The end result is that clicking on the logo loads the logo itself, rather than the upload page.

A simple work-around is to not use <wicket:link>, and hard-code the url to my upload page, but I'd like to know if there is a proper solution to this.

like image 246
George Armhold Avatar asked Jun 03 '11 14:06

George Armhold


1 Answers

For me it helped to add empty onClick (Wicket 1.5):

<li><a class="current" href="main">
   <img onClick="" src="img/icons/home.png"/>
</a></li>

after this, the link points to the page, not the image itself

like image 181
vinga Avatar answered Sep 17 '22 20:09

vinga