You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Rick Reumann <r...@reumann.net> on 2003/06/28 18:35:14 UTC

JSTL- el - nested beans from a map used in a form?

Ok this has me stumped...

the down and dirty:

formBean has HashMap called fooMap

fooMap has keys that bring back beans of type BarBean

BarBean has properties someCode , someDescrip 

Now I want to iterate over this map and create the properties based on
the properties in BarBean and be able to update this form which will
then update the underlying BarBeans in the map.

(Ignore the part that I know that's a hassle about the reset method and
making sure Map exist there).


<c:forEach var="beanInMap" items="${formBean.fooMap}">

    someCode:     <html-el:text property="????????"/><br>
    someDescrip:  <html-el:text property="????????"/><br>
    <br>
  
</c:forEach>


the text will display fine in the form with:

someCode: <html-el:text name=beanInMap" property="beanInMap.deptCode" />

but when the form submits all the bean property values are null ( in the
reset if it matters for testing i'm just creating a few maps with empty
BarBeans in the map).

I'm stumped.. any help much appreciated.

-- 
Rick
 


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


Re: JSTL- el - nested beans from a map used in a form?

Posted by Sandeep Takhar <sa...@yahoo.com>.
I don't think you have defined your taglib at the top
of the jsp.  Your html-el should have changed when you
look at the source..

sandeep
--- Rick Reumann <r...@reumann.net> wrote:
> On Sat, 2003-06-28 at 13:51, Dan Tran wrote:
> > see this link
> >
>
http://www.strutskickstart.com/IndexedPropertiesandValidation.ppt
> 
> Thanks Dan. I looked at the presentation above, but
> it's not helping me
> much. I probably do still need the indexed="true" to
> make the properties
> indexed, but I still don't see how this is going to
> get them populated
> in the correct bean and loaded back into the map?
> Adding indexed="true"
> doesn't seem to help.
> 
> > 
> > -Dan
> > ----- Original Message ----- 
> > From: "Rick Reumann" <r...@reumann.net>
> > To: "Struts Users Mailing List"
> <st...@jakarta.apache.org>
> > Sent: Saturday, June 28, 2003 9:35 AM
> > Subject: JSTL- el - nested beans from a map used
> in a form?
> > 
> > 
> > > Ok this has me stumped...
> > > 
> > > the down and dirty:
> > > 
> > > formBean has HashMap called fooMap
> > > 
> > > fooMap has keys that bring back beans of type
> BarBean
> > > 
> > > BarBean has properties someCode , someDescrip 
> > > 
> > > Now I want to iterate over this map and create
> the properties based on
> > > the properties in BarBean and be able to update
> this form which will
> > > then update the underlying BarBeans in the map.
> > > 
> > > (Ignore the part that I know that's a hassle
> about the reset method and
> > > making sure Map exist there).
> > > 
> > > 
> > > <c:forEach var="beanInMap"
> items="${formBean.fooMap}">
> > > 
> > >     someCode:     <html-el:text
> property="????????"/><br>
> > >     someDescrip:  <html-el:text
> property="????????"/><br>
> > >     <br>
> > >   
> > > </c:forEach>
> > > 
> > > 
> > > the text will display fine in the form with:
> > > 
> > > someCode: <html-el:text name=beanInMap"
> property="beanInMap.deptCode" />
> > > 
> > > but when the form submits all the bean property
> values are null ( in the
> > > reset if it matters for testing i'm just
> creating a few maps with empty
> > > BarBeans in the map).
> > > 
> > > I'm stumped.. any help much appreciated.
> > > 
> > > -- 
> > > Rick
> > >  
> > > 
> > > 
> > >
>
---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> struts-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail:
> struts-user-help@jakarta.apache.org
> > > 
> > > 
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> struts-user-help@jakarta.apache.org
> > 
> > 
> > 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> struts-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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


RE: Submiting a form through a link

Posted by Steve Raeburn <st...@ninsky.com>.
  <a href="" onclick="document.forms[0].submit();return false;">Click
here</a>
  (or the equivalent using Struts <html:link> tag.)

  <html:form action="/path">
    <html:hidden property="action" value="MyAction"/>
  </html:form>

The above code works for me. Not sure if the return false; has any impact -
probably does nothing.
Do you have more than one form on the page? You might need to change the
forms[] index number.
You can also try using the form name (which is the same as defined in
struts-config.xml) e.g.

  document.forms['testForm'].submit()

If that doesn't work then please post more of your form & link code.

Steve

p.s. Don't forget that if your users don't have javascript enabled then they
won't be able to use this feature of your site. ;-)

> -----Original Message-----
> From: Cristiano Moreira Silva [mailto:crisbrsp@yahoo.com.br]
> Sent: June 28, 2003 12:02 PM
> To: Struts Users Mailing List
> Subject: Submiting a form through a link
>
>
> Hello. I'm trying to submit a html:form through a
> html:link. When I click the link, on the onclick
> event, I call a javascript function and execute:
>
> document.forms[0].submit()
>
> Then nothing happens.
>
> Can someone send me a simple example (or a URL to it)
> of submiting a html:form through html:link? Thanks.
>
>
>
> =====
> ____________________________________________________________
> Cristiano Moreira Silva
> Site - http://computologo.vila.bol.com.br
> E-mail - crisbrsp@yahoocom.br
> "Tudo posso nAquele que me fortalece." Fp. 4:13
>
> _______________________________________________________________________
> Yahoo! Mail
> Mais espaço, mais segurança e gratuito: caixa postal de 6MB,
> antivírus, proteção contra spam.
> http://br.mail.yahoo.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>



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


Submiting a form through a link

Posted by Cristiano Moreira Silva <cr...@yahoo.com.br>.
Hello. I'm trying to submit a html:form through a
html:link. When I click the link, on the onclick
event, I call a javascript function and execute:

document.forms[0].submit()

Then nothing happens.

Can someone send me a simple example (or a URL to it)
of submiting a html:form through html:link? Thanks.



=====
____________________________________________________________
Cristiano Moreira Silva
Site - http://computologo.vila.bol.com.br
E-mail - crisbrsp@yahoocom.br
"Tudo posso nAquele que me fortalece." Fp. 4:13

_______________________________________________________________________
Yahoo! Mail
Mais espaço, mais segurança e gratuito: caixa postal de 6MB, antivírus, proteção contra spam.
http://br.mail.yahoo.com/

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


Re: JSTL- el - nested beans from a map used in a form?

Posted by Rick Reumann <r...@reumann.net>.
On Sat, 2003-06-28 at 13:51, Dan Tran wrote:
> see this link
> http://www.strutskickstart.com/IndexedPropertiesandValidation.ppt

Thanks Dan. I looked at the presentation above, but it's not helping me
much. I probably do still need the indexed="true" to make the properties
indexed, but I still don't see how this is going to get them populated
in the correct bean and loaded back into the map? Adding indexed="true"
doesn't seem to help.

> 
> -Dan
> ----- Original Message ----- 
> From: "Rick Reumann" <r...@reumann.net>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Saturday, June 28, 2003 9:35 AM
> Subject: JSTL- el - nested beans from a map used in a form?
> 
> 
> > Ok this has me stumped...
> > 
> > the down and dirty:
> > 
> > formBean has HashMap called fooMap
> > 
> > fooMap has keys that bring back beans of type BarBean
> > 
> > BarBean has properties someCode , someDescrip 
> > 
> > Now I want to iterate over this map and create the properties based on
> > the properties in BarBean and be able to update this form which will
> > then update the underlying BarBeans in the map.
> > 
> > (Ignore the part that I know that's a hassle about the reset method and
> > making sure Map exist there).
> > 
> > 
> > <c:forEach var="beanInMap" items="${formBean.fooMap}">
> > 
> >     someCode:     <html-el:text property="????????"/><br>
> >     someDescrip:  <html-el:text property="????????"/><br>
> >     <br>
> >   
> > </c:forEach>
> > 
> > 
> > the text will display fine in the form with:
> > 
> > someCode: <html-el:text name=beanInMap" property="beanInMap.deptCode" />
> > 
> > but when the form submits all the bean property values are null ( in the
> > reset if it matters for testing i'm just creating a few maps with empty
> > BarBeans in the map).
> > 
> > I'm stumped.. any help much appreciated.
> > 
> > -- 
> > Rick
> >  
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> > 
> > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 
> 


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


Re: JSTL- el - nested beans from a map used in a form?

Posted by Dan Tran <da...@hotmail.com>.
see this link
http://www.strutskickstart.com/IndexedPropertiesandValidation.ppt

-Dan
----- Original Message ----- 
From: "Rick Reumann" <r...@reumann.net>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Saturday, June 28, 2003 9:35 AM
Subject: JSTL- el - nested beans from a map used in a form?


> Ok this has me stumped...
> 
> the down and dirty:
> 
> formBean has HashMap called fooMap
> 
> fooMap has keys that bring back beans of type BarBean
> 
> BarBean has properties someCode , someDescrip 
> 
> Now I want to iterate over this map and create the properties based on
> the properties in BarBean and be able to update this form which will
> then update the underlying BarBeans in the map.
> 
> (Ignore the part that I know that's a hassle about the reset method and
> making sure Map exist there).
> 
> 
> <c:forEach var="beanInMap" items="${formBean.fooMap}">
> 
>     someCode:     <html-el:text property="????????"/><br>
>     someDescrip:  <html-el:text property="????????"/><br>
>     <br>
>   
> </c:forEach>
> 
> 
> the text will display fine in the form with:
> 
> someCode: <html-el:text name=beanInMap" property="beanInMap.deptCode" />
> 
> but when the form submits all the bean property values are null ( in the
> reset if it matters for testing i'm just creating a few maps with empty
> BarBeans in the map).
> 
> I'm stumped.. any help much appreciated.
> 
> -- 
> Rick
>  
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 

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


Re: JSTL- el - nested beans from a map used in a form?

Posted by Jason Lea <ja...@kumachan.net.nz>.
Hi Rick,

Rick Reumann wrote:
> On Sat, 2003-06-28 at 19:00, Jason Lea wrote:
>  
> 
>>Here are some ideas, I haven't tested them so they could be horribly 
>>wrong :)
>>
>>The html-el:text tag are just like the html:text tag, but I can evaluate 
>>EL expressions.
>>
>>What you want to generate is something like this:
>>
>>someCode:  <input type="text" name="fooMap['aCode'].someCode" 
>>value="aCode"><br>
>>
>>because when this is submitted Struts will do something like:
>>formBean.getFooMap().get("aCode").setSomeCode("a new value")
> 
> 
> Thanks Jason. I'll have to try some of this. The problem with the above
> though is what do i substitute in for "aCode" that represents "key". The
> keys can be different obviously as the iterations take place.  
> 
> 
>>So then looking at the html:text tag documentation we see for 'property':
>>
>>"Name of this input field, and the name of the corresponding bean 
>>property if value is not specified. The corresponding bean property (if 
>>any) must be of type String."
>>
>>This means the value of 'property' will be the name of the text input 
>>field - this is the bit we want to become name="fooMap['aCode'].someCode".
>>
>>The other importent part is the 'indexed' property:
>>
>>"Valid only inside of logic:iterate tag.  
> 
> 
> Actually this seemed to also work within the JSTL foreach loop.
> 
> 
>>If true then name of the html 
>>tag will be rendered as "id[34].propertyName". Number in brackets will 
>>be generated for every iteration and taken from ancestor logic:iterate tag."
>>
>>You are using JSTL and have not created a logic:iterate tag so the index 
>>isn't going to be generated for you.  You could switch to using 
>>logic:iterate and I think the tags figure out what to call themselves eg
>>
>><html:form action="....">
>>     <logic:iterate id="beanInMap" name="fooMap">
>>         someCode:     <html-el:text name="beanInMap" 
>>property="deptCode" indexed="true"/><br>
>>     </logic:iterate>
>></html:form>
> 
> 
> I tried the above but it complained that it couldn't find my map (fooMap
> in the above example).

Are you using the html:form tag?  All of these tags should be inside one 
so they know what formBean to use.

> 
> 
>>or use the <nested:*> tags, which would be something like:
>>
>><nested:form action="....">
>>     <nested:iterate name="fooMap">
>>         someCode:     <nested:text property="deptCode" /><br>
>>     </nested:iterate>
>></html-el:form>
>>
>>If you want to use JSTL, you probably have to generate the property name 
>>yourself:
>>
>><html:form action="....">
>>     <c:forEach var="beanInMap" items="${formBean.fooMap}">
>>         someCode:     <html-el:text 
>>property="fooMap['${beanInMap.someCode}'].someCode" /><br>
>>         someDescrip:  <html-el:text 
>>property="fooMap['${beanInMap.someDescrip}'].someDescrip" /><br>
>>         <br>
>>     </c:forEach>
>></html:form>
> 
> 
> With the above I end up with the error:
> 
> org.apache.jasper.JasperException: An error occurred while evaluating
> custom action attribute "property" with value
> "departments['${beanInMap.deptCode}'].deptCode": Unable to find a value
> for "deptCode" in object of class "java.util.HashMap$Entry" using
> operator "." (null)

Ahh, yes.  That now triggers something I read a while ago.  When JSTL 
gets something out of a map it will be of the type java.util.Map.Entry 
so perhaps try

<c:forEach var="beanInMap" items="${employeeForm.departments}">
       Code:  <html-el:text 
property="departments['${beanInMap.key}'].deptCode" />
<br>
       Name:  <html-el:text 
property="departments['${beanInMap.key}'].deptName" />
<br>
<br>
</c:forEach>

You will have to use the <html-el:text> to evaluate the ${beanInMap.key} 
  (at least I hope it tries to evaluate it that way).  If you use 
<html:text> then it will just treat it as text, essentially looking up 
the departments map with '${beanInMap.key}' instead of the actual key.


> 
> the syntax looks like:
> 
> <c:forEach var="beanInMap" items="${employeeForm.departments}">
>       Code:     
> <html:text  property="departments['${beanInMap.deptCode}'].deptCode" />
> <br>
>       Name:  
> <html:text  property="departments['${beanInMap.deptName}'].deptName" />
> <br>
> <br>
> </c:forEach> 
> 
> I've tried all kinds of other combos also and still stumped.
> 
> Thanks for the help so far.
> 
> 
>>Rick Reumann wrote:
>>
>>>Ok this has me stumped...
>>>
>>>the down and dirty:
>>>
>>>formBean has HashMap called fooMap
>>>
>>>fooMap has keys that bring back beans of type BarBean
>>>
>>>BarBean has properties someCode , someDescrip 
>>>
>>>Now I want to iterate over this map and create the properties based on
>>>the properties in BarBean and be able to update this form which will
>>>then update the underlying BarBeans in the map.
>>>
>>>(Ignore the part that I know that's a hassle about the reset method and
>>>making sure Map exist there).
>>>
>>>
>>><c:forEach var="beanInMap" items="${formBean.fooMap}">
>>>
>>>    someCode:     <html-el:text property="????????"/><br>
>>>    someDescrip:  <html-el:text property="????????"/><br>
>>>    <br>
>>>  
>>></c:forEach>
>>>
>>>
>>>the text will display fine in the form with:
>>>
>>>someCode: <html-el:text name=beanInMap" property="beanInMap.deptCode" />
>>>
>>>but when the form submits all the bean property values are null ( in the
>>>reset if it matters for testing i'm just creating a few maps with empty
>>>BarBeans in the map).
>>>
>>>I'm stumped.. any help much appreciated.
>>>
>>
>>
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 


-- 
Jason Lea


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


Re: JSTL- el - nested beans from a map used in a form?

Posted by Rick Reumann <r...@reumann.net>.
On Sat, 2003-06-28 at 19:00, Jason Lea wrote:
 
> Here are some ideas, I haven't tested them so they could be horribly 
> wrong :)
> 
> The html-el:text tag are just like the html:text tag, but I can evaluate 
> EL expressions.
> 
> What you want to generate is something like this:
> 
> someCode:  <input type="text" name="fooMap['aCode'].someCode" 
> value="aCode"><br>
> 
> because when this is submitted Struts will do something like:
> formBean.getFooMap().get("aCode").setSomeCode("a new value")

Thanks Jason. I'll have to try some of this. The problem with the above
though is what do i substitute in for "aCode" that represents "key". The
keys can be different obviously as the iterations take place.  

> 
> So then looking at the html:text tag documentation we see for 'property':
> 
> "Name of this input field, and the name of the corresponding bean 
> property if value is not specified. The corresponding bean property (if 
> any) must be of type String."
> 
> This means the value of 'property' will be the name of the text input 
> field - this is the bit we want to become name="fooMap['aCode'].someCode".
> 
> The other importent part is the 'indexed' property:
> 
> "Valid only inside of logic:iterate tag.  

Actually this seemed to also work within the JSTL foreach loop.

> If true then name of the html 
> tag will be rendered as "id[34].propertyName". Number in brackets will 
> be generated for every iteration and taken from ancestor logic:iterate tag."
> 
> You are using JSTL and have not created a logic:iterate tag so the index 
> isn't going to be generated for you.  You could switch to using 
> logic:iterate and I think the tags figure out what to call themselves eg
> 
> <html:form action="....">
>      <logic:iterate id="beanInMap" name="fooMap">
>          someCode:     <html-el:text name="beanInMap" 
> property="deptCode" indexed="true"/><br>
>      </logic:iterate>
> </html:form>

I tried the above but it complained that it couldn't find my map (fooMap
in the above example).

> 
> or use the <nested:*> tags, which would be something like:
> 
> <nested:form action="....">
>      <nested:iterate name="fooMap">
>          someCode:     <nested:text property="deptCode" /><br>
>      </nested:iterate>
> </html-el:form>
> 
> If you want to use JSTL, you probably have to generate the property name 
> yourself:
> 
> <html:form action="....">
>      <c:forEach var="beanInMap" items="${formBean.fooMap}">
>          someCode:     <html-el:text 
> property="fooMap['${beanInMap.someCode}'].someCode" /><br>
>          someDescrip:  <html-el:text 
> property="fooMap['${beanInMap.someDescrip}'].someDescrip" /><br>
>          <br>
>      </c:forEach>
> </html:form>

With the above I end up with the error:

org.apache.jasper.JasperException: An error occurred while evaluating
custom action attribute "property" with value
"departments['${beanInMap.deptCode}'].deptCode": Unable to find a value
for "deptCode" in object of class "java.util.HashMap$Entry" using
operator "." (null)

the syntax looks like:

<c:forEach var="beanInMap" items="${employeeForm.departments}">
      Code:     
<html:text  property="departments['${beanInMap.deptCode}'].deptCode" />
<br>
      Name:  
<html:text  property="departments['${beanInMap.deptName}'].deptName" />
<br>
<br>
</c:forEach> 

I've tried all kinds of other combos also and still stumped.

Thanks for the help so far.

> 
> Rick Reumann wrote:
> > Ok this has me stumped...
> > 
> > the down and dirty:
> > 
> > formBean has HashMap called fooMap
> > 
> > fooMap has keys that bring back beans of type BarBean
> > 
> > BarBean has properties someCode , someDescrip 
> > 
> > Now I want to iterate over this map and create the properties based on
> > the properties in BarBean and be able to update this form which will
> > then update the underlying BarBeans in the map.
> > 
> > (Ignore the part that I know that's a hassle about the reset method and
> > making sure Map exist there).
> > 
> > 
> > <c:forEach var="beanInMap" items="${formBean.fooMap}">
> > 
> >     someCode:     <html-el:text property="????????"/><br>
> >     someDescrip:  <html-el:text property="????????"/><br>
> >     <br>
> >   
> > </c:forEach>
> > 
> > 
> > the text will display fine in the form with:
> > 
> > someCode: <html-el:text name=beanInMap" property="beanInMap.deptCode" />
> > 
> > but when the form submits all the bean property values are null ( in the
> > reset if it matters for testing i'm just creating a few maps with empty
> > BarBeans in the map).
> > 
> > I'm stumped.. any help much appreciated.
> > 
> 
> 
> 


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


Re: JSTL- el - nested beans from a map used in a form?

Posted by Jason Lea <ja...@kumachan.net.nz>.
Hi Rick,

Here are some ideas, I haven't tested them so they could be horribly 
wrong :)

The html-el:text tag are just like the html:text tag, but I can evaluate 
EL expressions.

What you want to generate is something like this:

someCode:  <input type="text" name="fooMap['aCode'].someCode" 
value="aCode"><br>

because when this is submitted Struts will do something like:
formBean.getFooMap().get("aCode").setSomeCode("a new value")

So then looking at the html:text tag documentation we see for 'property':

"Name of this input field, and the name of the corresponding bean 
property if value is not specified. The corresponding bean property (if 
any) must be of type String."

This means the value of 'property' will be the name of the text input 
field - this is the bit we want to become name="fooMap['aCode'].someCode".

The other importent part is the 'indexed' property:

"Valid only inside of logic:iterate tag. If true then name of the html 
tag will be rendered as "id[34].propertyName". Number in brackets will 
be generated for every iteration and taken from ancestor logic:iterate tag."

You are using JSTL and have not created a logic:iterate tag so the index 
isn't going to be generated for you.  You could switch to using 
logic:iterate and I think the tags figure out what to call themselves eg

<html:form action="....">
     <logic:iterate id="beanInMap" name="fooMap">
         someCode:     <html-el:text name="beanInMap" 
property="deptCode" indexed="true"/><br>
     </logic:iterate>
</html:form>

or use the <nested:*> tags, which would be something like:

<nested:form action="....">
     <nested:iterate name="fooMap">
         someCode:     <nested:text property="deptCode" /><br>
     </nested:iterate>
</html-el:form>

If you want to use JSTL, you probably have to generate the property name 
yourself:

<html:form action="....">
     <c:forEach var="beanInMap" items="${formBean.fooMap}">
         someCode:     <html-el:text 
property="fooMap['${beanInMap.someCode}'].someCode" /><br>
         someDescrip:  <html-el:text 
property="fooMap['${beanInMap.someDescrip}'].someDescrip" /><br>
         <br>
     </c:forEach>
</html:form>



Rick Reumann wrote:
> Ok this has me stumped...
> 
> the down and dirty:
> 
> formBean has HashMap called fooMap
> 
> fooMap has keys that bring back beans of type BarBean
> 
> BarBean has properties someCode , someDescrip 
> 
> Now I want to iterate over this map and create the properties based on
> the properties in BarBean and be able to update this form which will
> then update the underlying BarBeans in the map.
> 
> (Ignore the part that I know that's a hassle about the reset method and
> making sure Map exist there).
> 
> 
> <c:forEach var="beanInMap" items="${formBean.fooMap}">
> 
>     someCode:     <html-el:text property="????????"/><br>
>     someDescrip:  <html-el:text property="????????"/><br>
>     <br>
>   
> </c:forEach>
> 
> 
> the text will display fine in the form with:
> 
> someCode: <html-el:text name=beanInMap" property="beanInMap.deptCode" />
> 
> but when the form submits all the bean property values are null ( in the
> reset if it matters for testing i'm just creating a few maps with empty
> BarBeans in the map).
> 
> I'm stumped.. any help much appreciated.
> 




-- 
Jason Lea


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