You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by dh...@lexmark.com on 2002/07/18 23:23:58 UTC

Runtime expression not evaluated


Hi,

Can anyone tell me why, in the following code, the id of the image is
"checkBox<%=index%>" rather than "checkBox1", "checkBox2" etc.?  The id of the
<td> works just fine!

                        <logic:iterate id="comboValue" name="Prompt"
property="comboValues" indexId="index">
                        <TR>
                           <td ID="multiValue<%=index%>"><bean:write
name="comboValue"/></td>
                           <TD>
                              <A href="javascript:onMultiPress(<%= index %>)"
style="cursor:default">
                                 <html:img styleId="checkBox<%=index%>"
page="/images/checkbox_empty.gif" border="0"/>
                              </A>
                           </TD>
                         </TR>
                        </logic:iterate>

Thanks,

David





--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Runtime expression not evaluated

Posted by Max Cooper <ma...@maxcooper.com>.
You can't mix a string and a <%= %> in an attribute value. It has to be one
or the other. I know, it seems weird, but try it and you'll see.

You should be able to do one of these instead:

<% String idValue = "multiValue" + String.valueOf(index); %>
<td ID="<%=idValue%>">

or

<td ID='<%=("multiValue" + String.valueOf(index))%>'>

^ note single quote usage

-Max


----- Original Message -----
From: <dh...@lexmark.com>
To: <st...@jakarta.apache.org>
Sent: Thursday, July 18, 2002 2:23 PM
Subject: Runtime expression not evaluated


>
>
> Hi,
>
> Can anyone tell me why, in the following code, the id of the image is
> "checkBox<%=index%>" rather than "checkBox1", "checkBox2" etc.?  The id of
the
> <td> works just fine!
>
>                         <logic:iterate id="comboValue" name="Prompt"
> property="comboValues" indexId="index">
>                         <TR>
>                            <td ID="multiValue<%=index%>"><bean:write
> name="comboValue"/></td>
>                            <TD>
>                               <A href="javascript:onMultiPress(<%= index
%>)"
> style="cursor:default">
>                                  <html:img styleId="checkBox<%=index%>"
> page="/images/checkbox_empty.gif" border="0"/>
>                               </A>
>                            </TD>
>                          </TR>
>                         </logic:iterate>
>
> Thanks,
>
> David
>
>
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>