java - Wicket wrap img element in a link -


i have wicket code shows image:

<div class="someclass">    <img wicket:id="some-image"/> </div> 

this works great.

i have requirement sais, image might wrapped in link , link needs generated wicket side.

so implement nicest way possible without having add both sections this:

<a wicket:id="link-for-image">    <div class="someclass">       <img wicket:id="some-image-with-link"/>    </div> </a>  <div class="someclass">    <img wicket:id="some-image"/> </div> 

and hiding 1 or other.

what standard way of implementing nicely?

is there way define kind of generic type "link-for-image" can maybe create web markup container instead of link?

thanks!!!

  1. use either border
  2. use fragments
  3. output <a> always, hide href attribute.

ps: <div> not allowed inside <a> due html standard.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -