tags:

views:

406

answers:

1

On clicking the anchor tag link “click me” control goes to the action defined in <s:url> tag and sends all the param values defined under <s:url> tag . See below -

<s:url id="matchId" action="someAction">
<s:param name="QuotFileName" value="FileName"/>
<s:param name="QuotContentType" value="ContentType"/>
</s:url>
<s:a href="%{ matchId }">click me</s:a>

Its all running well. But I want to do the same thing using checkbox i.e <s:checkbox> instead of anchor tag i.e <s:a>. But there is no href attribute in <s:checkbox> tag… See below code -

<s:url id="matchId" action="someAction">
<s:param name="QuotFileName" value="FileName"/>
<s:param name="QuotContentType" value="ContentType"/>
</s:url>
<s:checkbox href="%{ matchId }"></s:checkbox>

Please suggest what should I use inplace of ‘href ‘attribute of <s:checkbox>.

+1  A: 

Can you use the onclick attribute to call some Javascript that sets window.location to whatever you want?

http://struts.apache.org/2.1.6/docs/checkbox.html

Nate