3 Replies Latest reply on Nov 24, 2010 1:50 PM by federico bouzas

    s:button with image attribute doesn't add contextroot in src attribute

    Jochen Hebbrecht Newbie

      Hi all,

      I have a small problem which can be simulated in a simple test case. In a existing Seam application, add this:

      <s:button image="/img/logo.jpg"/>

      This will generate following source code:

      <input type="image" src="/img/logo.jpg" id="j_id222:j_id233:j_id234" onclick="location.href='/xxx/yyy/zzz.seam?cid=1'; return false;">

      As you can see, the src attribute doesn't start with my contextroot, so my image will never by found.
      I searched the issue tracker of Seam, but nobody reported such an issue.

      I checked the source code, and the HTML code is generated by : ButtonRendererBase.java. In this class file, you will find

            if (button.getImage() != null)
               writer.writeAttribute(HTML.SRC_ATTR, button.getImage(), HTML.SRC_ATTR);

      Now, where is the contextroot added? It's not in HtmlButton and nog in ButtonTag?