You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Mike Bydalek (JIRA)" <ji...@apache.org> on 2008/02/26 00:53:07 UTC

[jira] Issue Comment Edited: (WW-1677)
    [ https://issues.apache.org/struts/browse/WW-1677?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43366#action_43366 ] 

mbydalek edited comment on WW-1677 at 2/25/08 3:52 PM:
-----------------------------------------------------------

Based on Don's thought of doing this like the div and form components, I created a little patch that does just that.

The following code now renders as expected:

<s:submit type="button" cssClass="button positive save" theme="simple" label="">
  <img src="<s:url value="/images/tick.png" />" alt=""> Save
</s:submit>

Output:

<button type="submit" id="bleh_0" value="Submit" class="button positive save">

    <img src="/tutorial/images/tick.png" alt=""> Save
</button>

The only caveat was setting the label attribute to "", otherwise, it would output "Submit" as well.  This is in Submit.evalutateParams() but since I'm really new to Struts, I'm not sure how to handle that in a good way.

Additionally, I reverted the fix applied by Don since it seemed redundant.

-Mike

      was (Author: mbydalek):
    Based on Don's thought of doing this like the div and form components, I created a little patch that does just that.

The following code now renders as expected:

<s:submit type="button" cssClass="button positive save" theme="simple" label="">
  <img src="<s:url value="/images/tick.png" />" alt=""> Save
</s:submit>

Output:

<button type="submit" id="bleh_0" value="Submit" class="button positive save">

    <img src="/tutorial/images/tick.png" alt=""> Save
</button>

The only caveat was setting the label attribute to "", otherwise, it would output "Submit" as well.  This is in Submit.evalutateParams() but since I'm really new to Struts, I'm not sure how to handle that in a good way.

Additionally, I reverted the fix applied by mrdon since it seemed redundant.

-Mike
  
> <s:submit type="button" does not render the enclosed content inside properly
> ----------------------------------------------------------------------------
>
>                 Key: WW-1677
>                 URL: https://issues.apache.org/struts/browse/WW-1677
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Tags
>         Environment: Windows XP SP2, JSDK 6.0, Tomcat 5.5, Spring 2.0
>            Reporter: Peng Wang
>             Fix For: 2.1.x
>
>         Attachments: button.patch, buttons.jpg, index.jsp, submit-button.patch
>
>
> Please take a look at the following code, the <s:submit tag did not render the tags properly. 
> <code>
> <s:submit type="button" theme="simple">
>       <s:text name="testplan.form.submit.label" />&nbsp;<img align="top" src="<s:url value="/images/save_16.png" />"/>
> </s:submit>
> </code
> I expected the output would be 
> <code>
> <button type="submit">Submit&nbsp;<img align="top" src="images/save_16.png"/></button>
> </code>
> but the actual out put is
> <code>
> Submit&nbsp;<img align="top" src="/autobase/images/save_16.png?testPlan.id=1"/><button type="submit" id="testPlanForm_save" name="save" value="Submit">Submit</button>
> </code>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.