Thank you for your reply.

> Depends how the container produces the output.

Well, like I say below, I'm just using a MarkupContainer to output pure html
for images, and a HeaderContributor for the CSS, nothing more.

This is the code for the CSS:

    private void addCss( final Page page, final String cssLink )
    {
        final HeaderContributor cssHeaderContributor =
            new HeaderContributor
            (
                    new IHeaderContributor()
                    {
                        private static final long serialVersionUID = 1L;

                        public void renderHead( final IHeaderResponse
response )
                        {
                            response.renderString( cssLink );
                        }
                    }
            );

        page.add( cssHeaderContributor );
    }

And this for the image:

        final MarkupContainer container = new WebMarkupContainer( id );
        final Model srcAttributeModel = new Model( imageUrl );
        final AttributeModifier srcAttribute = new AttributeModifier(
            "src",
            true,
            srcAttributeModel );
        container.add( srcAttribute );
        add( container );

I think the html looks something like this:
  <img wicket:id="blah">IMAGE</img>


> If oncomponenttag is used it should work.

Really? I don't see why I'd need onComponentTag for the approach I'm
using...


> if the tags are generated by a model you might want turn off
> setescapemodelstrings on the container.

The html is rendered just fine. If I copy the code and paste it in a static
html file, everything renders just fine.


Thanks!
Dave



> On Thu, Feb 28, 2008 at 4:16 AM, David Leangen <[EMAIL PROTECTED]> wrote:
> >
> >  Hello,
> >
> >  I am adding a MarkupContainer to my page that outputs something like
> >  this:
> >
> >   <img wicket:id="logoImage" src="file:///resources/images/logo.jpg">
> >
> >  or this:
> >
> >  <link rel="stylesheet" type="text/css"
> >  href="file:///resources/stylesheets/text.css" /
> >  >
> >
> >  [Just in case this does not render because of html-based mail clients:
> >
> >   &lt;img wicket:id="logoImage"
> >  src="file:///resources/images/logo.jpg"&gt;
> >
> >  or this:
> >
> >  &lt;link rel="stylesheet" type="text/css"
> >  href="file:///resources/stylesheets/text.css" /&gt;
> >
> >  ]
> >
> >  Although this works from a static html page, it doesn't work
> when Wicket
> >  renders this page. The html shows up correctly when I view the source,
> >  but the image and CSS don't get rendered.
> >
> >  Is something happening behind the scenes that I should be aware of?
> >
> >
> >  Thanks!
> >  Dave
> >
> >
> >
> >
> >  ---------------------------------------------------------------------
> >  To unsubscribe, e-mail: [EMAIL PROTECTED]
> >  For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>


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

Reply via email to