|
I wanted a panel constructed with an image
filename which would popup the image in another window. I wanted my code in one place, my static
image files stored in the WEB-INF folder of my web module, and couldn’t
figure out how to make Image component find them. Igor replied: “If they live outside a jar in a
static location then why do you even need an Image component? Add a webmarkup
container with an attribute modifier that rewrites the src
attri to point at an image, and attach that to <img markup>.” What Igor
suggested is exactly what I want to do, but I’m having trouble changing
the “src” attribute on my image display
page. My HTML for the pop-up panel
is: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.sourceforge.net/" xml:lang="en" lang="en"> <head></head> <body>
<img wicket:id = "picture" alt="Picture" src="REPLACE_THIS.png"/> </body> </html> My code is: public class PicturePage extends WebPage {
public PicturePage( PageParameters pageParameters ) { String pictureFile
= pageParameters.getString("pictureFile"); WebMarkupContainer
wmc = new WebMarkupContainer("picture"); wmc.add( new AttributeModifier( "src",
new Model(pictureFile) ) ); add(
wmc );
} } But it is not changing my “src” attribute.
What am I doing wrong? |
- RE: [Wicket-user] Location of image files Frank Silbermann
- Re: [Wicket-user] Location of image files Igor Vaynberg
- RE: [Wicket-user] Location of image files Frank Silbermann
- Re: [Wicket-user] Location of image files Igor Vaynberg
- Re: [Wicket-user] Location of image files Timo Stamm
- RE: [Wicket-user] Location of image files Frank Silbermann
- RE: [Wicket-user] Location of image files Frank Silbermann
