Hi, I have probably a newbie question, but I cannot find way how to do it.

I my application I use many AjaxLinks. I always want the link to be represented 
by an image. The image is always the same so I want to prevent myself for 
writing the same code. 
I made my component that extends AjaxLink. In constructor of this component I 
just add the image to it. 
     add (new Image ("myImg", new ResourceReference ("myImg")));  
Now I need to automatically add the correspond HTML code 
    <img wicket:id="myImg" border="0" />
to the web page when I use this component.

E.G. 
 JAVA
.
add (new MyAjaxLink ("myLink") {
  @Override
  public void onClick (AjaxRequestTarget target) {
    ...
  } 
);
.
and
HTML
.
<a wicket:id="my link"> here should be the HTML code from my component </a>
.
will be rendered as
  <a wicket:id="my link"> <img wicket:id="myImg" border="0" /> </a>

I know that the functionality that I ant is provided by Panel Component. But I 
need it when using component that extends AjaxLink not Panel. I think that one 
possible reason is to insert the image to my component as a Panel. But that 
will be very awful reason. Is there any other way how to do it??

Thank for any advice.

Milan

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to