You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by grazia <Gr...@gmail.com> on 2013/03/27 00:39:26 UTC

AjaxLink with image

The image in the AjaxLink does not display, anyone could help me figure this
one out ?

   private static final ResourceReference DELETE = new
PackageResourceReference(SabcActionsPanel.class, "delete.png");
 
final AjaxLink deleteLink = new AjaxLink("delete") {

            private static final long serialVersionUID = 1L;

            public void onClick(AjaxRequestTarget target) {
                target.appendJavaScript("alert('Going to delete!')");
            }
        };
        deleteLink.add(new Image("deleteImg", DELETE));
        deleteLink.setOutputMarkupId(true);

        add(deleteLink);

in Html, I have tried:


or

    <wicket:link>
         
    </wicket:link>






--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/AjaxLink-with-image-tp4657544.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: AjaxLink with image

Posted by Martin Grigorov <mg...@apache.org>.
Your markup didn't make it and Nabble says your thread cannot be found.


On Wed, Mar 27, 2013 at 1:39 AM, grazia <Gr...@gmail.com>wrote:

> The image in the AjaxLink does not display, anyone could help me figure
> this
> one out ?
>
>    private static final ResourceReference DELETE = new
> PackageResourceReference(SabcActionsPanel.class, "delete.png");
>
> final AjaxLink deleteLink = new AjaxLink("delete") {
>
>             private static final long serialVersionUID = 1L;
>
>             public void onClick(AjaxRequestTarget target) {
>                 target.appendJavaScript("alert('Going to delete!')");
>             }
>         };
>         deleteLink.add(new Image("deleteImg", DELETE));
>         deleteLink.setOutputMarkupId(true);
>
>         add(deleteLink);
>
> in Html, I have tried:
>
>
> or
>
>     <wicket:link>
>
>     </wicket:link>
>
>
>
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/AjaxLink-with-image-tp4657544.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com <http://jweekend.com/>

Re: AjaxLink with image

Posted by Paul Bors <pa...@bors.ws>.
I take it delete.png is in the same package as SabcActionsPanel.class and
they both are in a jar that's placed on your classpath and end up in your
deployed folder under WEB-INF\lib.

Have you checked the HTML source code of your page after wicket rendered it
on  your page and that your <img src="#" wicket:id="deleteImg"/> changed to
something like <img src="../some.class.path/delete.png"... >?

Try loading that relative SRC in your browser's URL. Can you get to that
image?
~ Thank you,
   Paul Bors
On Wed, Mar 27, 2013 at 3:49 AM, Marco Springer <ma...@glitchbox.nl> wrote:

> The Markup is missing somehow but I'd say the following HTML should do the
> trick:
> <a wicket:id="delete">
>   <img src="#" wicket:id="deleteImg"/>
> </a>
>
> Check the log if it isn't complaining that it can't find the "delete.png"
> file..
>
> On Tuesday 26 March 2013 16:39:26 grazia wrote:
> > The image in the AjaxLink does not display, anyone could help me figure
> this
> > one out ?
> >
> >    private static final ResourceReference DELETE = new
> > PackageResourceReference(SabcActionsPanel.class, "delete.png");
> >
> > final AjaxLink deleteLink = new AjaxLink("delete") {
> >
> >             private static final long serialVersionUID = 1L;
> >
> >             public void onClick(AjaxRequestTarget target) {
> >                 target.appendJavaScript("alert('Going to delete!')");
> >             }
> >         };
> >         deleteLink.add(new Image("deleteImg", DELETE));
> >         deleteLink.setOutputMarkupId(true);
> >
> >         add(deleteLink);
> >
> > in Html, I have tried:
> >
> >
> > or
> >
> >     <wicket:link>
> >
> >     </wicket:link>
> >
> >
> >
> >
> >
> >
> > --
> > View this message in context:
> >
> http://apache-wicket.1842946.n4.nabble.com/AjaxLink-with-image-tp4657544.ht
> > ml Sent from the Users forum mailing list archive at Nabble.com.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
>

Re: AjaxLink with image

Posted by Marco Springer <ma...@glitchbox.nl>.
The Markup is missing somehow but I'd say the following HTML should do the 
trick:
<a wicket:id="delete">
  <img src="#" wicket:id="deleteImg"/>
</a>

Check the log if it isn't complaining that it can't find the "delete.png" file..

On Tuesday 26 March 2013 16:39:26 grazia wrote:
> The image in the AjaxLink does not display, anyone could help me figure this
> one out ?
> 
>    private static final ResourceReference DELETE = new
> PackageResourceReference(SabcActionsPanel.class, "delete.png");
> 
> final AjaxLink deleteLink = new AjaxLink("delete") {
> 
>             private static final long serialVersionUID = 1L;
> 
>             public void onClick(AjaxRequestTarget target) {
>                 target.appendJavaScript("alert('Going to delete!')");
>             }
>         };
>         deleteLink.add(new Image("deleteImg", DELETE));
>         deleteLink.setOutputMarkupId(true);
> 
>         add(deleteLink);
> 
> in Html, I have tried:
> 
> 
> or
> 
>     <wicket:link>
> 
>     </wicket:link>
> 
> 
> 
> 
> 
> 
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/AjaxLink-with-image-tp4657544.ht
> ml Sent from the Users forum mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org