Thanks David that worked  - I did try that in my investigations but must
have missed
something

HUW

-----Original Message-----
From: Karr, David [mailto:[EMAIL PROTECTED]
Sent: 28 February 2003 18:24
To: Struts Users Mailing List
Subject: RE: logic:iterate over a HashMap - can't pass key to get value
method


Expression scriptlets have to be the entire attribute value, not just a
portion of it.  Change the value of the "property" attribute to (don't
forget the wrapping single quotes):

'<%= "locationroomValue(" + (String)mapEntry.getKey() + ")" %>'

> -----Original Message-----
> From: Huw Jones [mailto:[EMAIL PROTECTED]
> Sent: Friday, February 28, 2003 10:16 AM
> To: [EMAIL PROTECTED]
> Subject: logic:iterate over a HashMap - can't pass key to get value
method
>
>
> I'm having problems passing the key from the Hash map into the method
I
> have
> written to get the value. The code below
> does not work - specifically the bit where I try and pass in the
> mapEntry.getKey() to locationroomValue. I've hit
> a wall trying to sort this - what am I doing wrong - is it a scope
issue.
> If
> I hard code the key it works ok.
>
> <logic:notEmpty name="locationForm" property="locationroom">
>     <logic:iterate name="locationForm" property="locationroom"
> indexId="cnt"
> id="mapEntry" type="java.util.Map.Entry" >
>      <bean:write name="mapEntry" property="key"/>
>      <html:text name="locationForm"
> property="locationroomValue(<%=(String)mapEntry.getKey()%>)" size="25"
> maxlength="25"/>
>     </logic:iterate>
> </logic:notEmpty>
>
>
> Thanks
>
>
> Huw Jones
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to