You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dave <no...@yahoo.com> on 2005/08/10 15:48:11 UTC

Instantiation of form bean

Thanks to all that answered my first question. And, as an explanation when I 
said I waited 30 minutes, I meant I did not see my own message after having 
waited 30 minutes.

However, what is clear to me is that I did not provide enough information to 
generate a solution.

In the forms bean section of my struts-config I have a bean defined:

<form-bean name="ReviewAccountForm" 
type="org.apache.struts.validator.DynaValidatorForm">
   <form-property name="member" type="com.eri.web.Member"/>
</form-bean>

My action form is of the type  
com.eri.web.struts.actions.dispatch.LookupDispatchAction and I have extended 
this with my class.

I have properly configured a method of this to be called such that my member is 
filled and set in session with:
request.getSession().setAttribute(AppConstants.LOGIN_SESSION_KEY, member);

At the top of my form I display various portions of the member's properties.

Which gets me to my select on my form which is defined as:

<html:select property="member.startYear">
   <html:optionsCollection property="member.displayYear" value="val" 
label="text"/>
</html:select>

Using console messages I have determined that the properties of member at the 
time displayYear is called are null, from which I conclude that a new member 
object has been constructed. Which is not my desire, I want it to use the 
existant member object.


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


Re: Instantiation of form bean

Posted by Gareth Evans <ga...@msoft.co.uk>.
Try,

<html:select property="member.startYear">
     <html:optionsCollection name="member" property="displayYear" value="val" label="text"/>
</html:select>

Gareth

Dave wrote:

> Thanks to all that answered my first question. And, as an explanation when I 
> said I waited 30 minutes, I meant I did not see my own message after having 
> waited 30 minutes.
> 
> However, what is clear to me is that I did not provide enough information to 
> generate a solution.
> 
> In the forms bean section of my struts-config I have a bean defined:
> 
> <form-bean name="ReviewAccountForm" 
> type="org.apache.struts.validator.DynaValidatorForm">
>    <form-property name="member" type="com.eri.web.Member"/>
> </form-bean>
> 
> My action form is of the type  
> com.eri.web.struts.actions.dispatch.LookupDispatchAction and I have extended 
> this with my class.
> 
> I have properly configured a method of this to be called such that my member is 
> filled and set in session with:
> request.getSession().setAttribute(AppConstants.LOGIN_SESSION_KEY, member);
> 
> At the top of my form I display various portions of the member's properties.
> 
> Which gets me to my select on my form which is defined as:
> 
> <html:select property="member.startYear">
>    <html:optionsCollection property="member.displayYear" value="val" 
> label="text"/>
> </html:select>
> 
> Using console messages I have determined that the properties of member at the 
> time displayYear is called are null, from which I conclude that a new member 
> object has been constructed. Which is not my desire, I want it to use the 
> existant member object.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 

-- 
Gareth Evans

MSoft eSolutions Limited
Technology Centre
Inward Way
Rossmore Business Park
Ellesmere Port
Cheshire
CH65 3EN

-- 
Tel:    +44 (0)870 0100 704
Fax:    +44 (0)870 9010 705
E-Mail: gareth@msoft.co.uk
Web:    www.msoft.co.uk

----------------------------------------------
Terms:
Please note that any prices quoted within this e-mail are subject to VAT.
All program details and code described in this e-mail are subject to
copyright © of MSoft eSolutions Limited and remain the intellectual
property of MSoft eSolutions Limited.
Any proposal or pricing information contained within this e-mail are
subject to MSoft eSolutions' Terms and Conditions
----------------------------------------------
Disclaimer:
This message is intended only for use of the addressee. If this message
was sent to you in error, please notify the sender and delete this
message. MSoft eSolutions Limited cannot accept responsibility for viruses,
so please scan attachments. Views expressed in this message do not
necessarily reflect those of MSoft eSolutions Limited who will not
necessarily be bound by its contents.


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