But I agree with Francis. This should work. May be Johan can help on this. Juergen
On 10/10/05, Phil Kulak <[EMAIL PROTECTED]> wrote: > Images in Wicket are bit tricky. If you didn't want to use > ResourceReferences, you could do something like this: > > AttributeModifier src = new AttributeModifier("src", true, new Model() { > @Override > public Object getObject(Component component) { > // Do some logic and return a string... > } > } > > add(new WebMarkupContainer("image").add(src)); > > Otherwise, I usually just put the dynamic images in the package, then > create static resource references to them: > > public static final ResourceReference ERROR_IMG = > new PackageResourceReference(MyClass.class, "error.gif"); > > and use those in the image: > > add(new Image("image") { > @Override > public ResourceReference getImageResourceReference() { > if (anyMessage(FeedbackMessage.ERROR)) { > return ERROR_IMG; > } > return INFORMATION_IMG; > } > }); > > On 10/10/05, Francis Amanfo <[EMAIL PROTECTED]> wrote: > > I'm adding the image dynamically based on a condition. I can't see why this > > shouldn't work. The images directory are located in the application root. > > Tried also to put it in the presentation package but didn't work. Whats the > > solution then? > > > > > > > > On 10/10/05, Phil Kulak <[EMAIL PROTECTED]> wrote: > > > > > > Do you have a resource reference named "images/delete.gif"? Because if > > > you're just trying to make a static link to a static image, there's no > > > need to get Wicket involved: > > > > > > <img src="images/delete.gif" type="image" width="12" height="12" > > > alt="[Delete]" border="0" valign="middle" /> > > > > > > On 10/10/05, Francis Amanfo <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > > > > > > I have a Panel whose markup contains: > > > > > > > > <img src="images/delete.gif" type="image" wicket:id="deleteImage" > > > > width="12" height="12" alt="[Delete]" border="0" valign="middle" /> > > > > > > > > The markup is located in package org.foo.presentation > > > > In my panel class located in the same package as the markup I do: > > > > > > > > add(new Image("deleteImage", "images/delete.gif")) > > > > > > > > The problem is the image doesn't get dsiplayed. Viewing the source html > > in > > > > my browser I see: > > > > > > > > <img width="12" height= > > > > "12" type="image" wicket:id="deleteImage" > > > > valign="middle" border="0" > > > > > > src="/portal/app/resources/org.foo.presentation.PSBreadCrumbsPanel/images/delete_en_US.gif" > > > > alt="[Delete]" > > > > /> > > > > > > > > I don't get it. Any help? > > > > > > > > Francis > > > > > > > > > > > > > ------------------------------------------------------- > > > This SF.Net email is sponsored by: > > > Power Architecture Resource Center: Free content, downloads, discussions, > > > and more. http://solutions.newsforge.com/ibmarch.tmpl > > > _______________________________________________ > > > Wicket-user mailing list > > > Wicket-user@lists.sourceforge.net > > > https://lists.sourceforge.net/lists/listinfo/wicket-user > > > > > > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: > Power Architecture Resource Center: Free content, downloads, discussions, > and more. http://solutions.newsforge.com/ibmarch.tmpl > _______________________________________________ > Wicket-user mailing list > Wicket-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wicket-user > ------------------------------------------------------- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl _______________________________________________ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user