Doh, my bad :-( I guess I was reading too fast (or with my eyes closed perhaps?...) Re-reading what you're doing, I'd say this is either a bug or a design limitation. It's probably worth a Jira ticket either way.

L.

billgloff wrote:
Laurie,

As you can see above in my sample code, I am already setting the
type="button" as you have suggested and I have also verified that the html
getting rendered is a <button..> and not <input type="button"..>.

Can you try it for yourself as see if you can get it to work?

Maybe I will have to write up a bug report for this.

Thanks,
Bill



Laurie Harper wrote:
billgloff wrote:
Using the button element in normal HTML you can do the following:

<button type="submit">
   &lt;img src="/images/icons/tick.png" alt=""/&gt;  Save
</button>
which gives you an icon along with the label on the button itself.

When I attempt to try the same thing using S2 tags e.g.

<s:submit theme="simple" type="button">                                         
      
   &lt;img src="/images/icons/tick.png" alt=""/&gt;  Save                       
                                                            
</s:submit>

is gets rendered in the following way:

&lt;img src="/images/icons/tick.png" alt=""/&gt;Save                            
                                                    
<button type="submit" id="someForm_0" value="Submit">Submit</button>

I also have tried using the following inside the body with no luck.

<s:param name="body">
  &lt;img src="/images/icons/tick.png" alt=""/&gt;  Save
</s:param>
How can I add an icon to my button?
I do not understand why any text in the tag body gets pushed out to the
front of the tag.
Thanks for any help on this!
s:submit is rendering an <input type="submit"..., not a <button... so the behaviour you're seeing is expected. If you want a button element, set <s:submit>'s 'type' attribute to 'button', as listed in the tag docs [1].

L.

[1] http://struts.apache.org/2.x/docs/submit.html


---------------------------------------------------------------------
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