You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Al Sutton <al...@alsutton.com> on 2008/01/10 12:03:33 UTC
Shouldn't this work?
I've got the following in a page inside a displaytag table;
<s:checkbox name="#attr.userPermission.id" theme="simple"
value="#attr.userPermission.startable"/>
What I would expect to see for an entry with the id 1234 set to true would
be something along the lines of;
<input type="checkbox" name="1234" value="true"/>
What I actually see is;
<input type="checkbox" name="#attr.userPermission.id" value="true"
id="UpdateProcessPermissions_#attr_userPermission_id"/>
Shouldn't the name attribute be evaluated?, and if it's not how do I get the
id of an object to be the name of the checkbox?
Ta,
Al.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE: Shouldn't this work?
Posted by Al Sutton <al...@alsutton.com>.
Your a genius (or at least in my book) :).
I looked at the ftl template for checkbox and thought using #attr would get
the same result in both fields, but as soon as I switched to %{#attr
everything worked.
Thanks.
Al.
-----Original Message-----
From: Musachy Barroso [mailto:musachy@gmail.com]
Sent: 10 January 2008 14:13
To: Struts Users Mailing List
Subject: Re: Shouldn't this work?
The name attribute is assumed to be an string, as that would be the most
common use case. Just use %{expr} and it will work as you expect.
musachy
On Jan 10, 2008 6:03 AM, Al Sutton <al...@alsutton.com> wrote:
> I've got the following in a page inside a displaytag table;
>
> <s:checkbox name="#attr.userPermission.id" theme="simple"
> value="#attr.userPermission.startable"/>
>
> What I would expect to see for an entry with the id 1234 set to true
> would be something along the lines of;
>
> <input type="checkbox" name="1234" value="true"/>
>
> What I actually see is;
>
> <input type="checkbox" name="#attr.userPermission.id" value="true"
> id="UpdateProcessPermissions_#attr_userPermission_id"/>
>
> Shouldn't the name attribute be evaluated?, and if it's not how do I
> get the id of an object to be the name of the checkbox?
>
> Ta,
>
> Al.
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
--
"Hey you! Would you help me to carry the stone?" Pink Floyd
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Shouldn't this work?
Posted by Musachy Barroso <mu...@gmail.com>.
The name attribute is assumed to be an string, as that would be the
most common use case. Just use %{expr} and it will work as you expect.
musachy
On Jan 10, 2008 6:03 AM, Al Sutton <al...@alsutton.com> wrote:
> I've got the following in a page inside a displaytag table;
>
> <s:checkbox name="#attr.userPermission.id" theme="simple"
> value="#attr.userPermission.startable"/>
>
> What I would expect to see for an entry with the id 1234 set to true would
> be something along the lines of;
>
> <input type="checkbox" name="1234" value="true"/>
>
> What I actually see is;
>
> <input type="checkbox" name="#attr.userPermission.id" value="true"
> id="UpdateProcessPermissions_#attr_userPermission_id"/>
>
> Shouldn't the name attribute be evaluated?, and if it's not how do I get the
> id of an object to be the name of the checkbox?
>
> Ta,
>
> Al.
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
--
"Hey you! Would you help me to carry the stone?" Pink Floyd
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org