Re: Automatic inserting HTML code

2008-10-22 Thread Igor Vaynberg
search this list for TextLink and see how it outputs text into link's body.

-igor

On Wed, Oct 22, 2008 at 3:08 AM, Milan Křápek <[EMAIL PROTECTED]> wrote:
> 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
>
> to the web page when I use this component.
>
> E.G.
>  JAVA
> .
> add (new MyAjaxLink ("myLink") {
>  @Override
>  public void onClick (AjaxRequestTarget target) {
>...
>  }
> );
> .
> and
> HTML
> .
>  here should be the HTML code from my component 
> .
> will be rendered as
>
>
> 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]
>
>


Automatic inserting HTML code

2008-10-22 Thread Milan Křápek
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 

to the web page when I use this component.

E.G. 
 JAVA
.
add (new MyAjaxLink ("myLink") {
  @Override
  public void onClick (AjaxRequestTarget target) {
...
  } 
);
.
and
HTML
.
 here should be the HTML code from my component 
.
will be rendered as


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]