You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jim Reynolds <ji...@gmail.com> on 2005/12/07 19:39:37 UTC

Syntax assistance bean tag

Need a little help with syntax dilemma:

I am iterating over a list like so:
<logic:iterate id="attributeBean" name="AttributesForm"
property="attributeList" '>
and creating <html:radio buttons like this:
tml:radio name="attributeBean" property="attributeName"
value="selected" indexed="true"
onclick="javascript:selectedRadio('XXX');" />

And the problem is within the onclick event, I need to send another
property from attributeBean to a handler.

javascript:selectRadio('<bean:write name="attributeBean"
property="attributeName"/>');

But no matter what I try, <bean:write
<c:out
I get error messages:

Any ideas how to accomplish this?

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Syntax assistance bean tag

Posted by Laurie Harper <la...@holoweb.net>.
Jim Reynolds wrote:
> Need a little help with syntax dilemma:
> 
> I am iterating over a list like so:
> <logic:iterate id="attributeBean" name="AttributesForm"
> property="attributeList" '>
> and creating <html:radio buttons like this:
> tml:radio name="attributeBean" property="attributeName"
> value="selected" indexed="true"
> onclick="javascript:selectedRadio('XXX');" />
> 
> And the problem is within the onclick event, I need to send another
> property from attributeBean to a handler.
> 
> javascript:selectRadio('<bean:write name="attributeBean"
> property="attributeName"/>');
> 
> But no matter what I try, <bean:write
> <c:out
> I get error messages:
> 
> Any ideas how to accomplish this?

Try searching the archives for 'nest tag': you can't nest one JSP tag 
inside another like that. Here's one solution:


   <c:set var="arg" value="${attributeBean.attributeName}"/>
   <html:radio name="attributeBean" property="attributeName"
     value="selected" indexed="true"
     onclick="javascript:selectedRadio('${arg}');"/>

L.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org