On 04/01/2004 17:16, "Matthias Wessendorf" <[EMAIL PROTECTED]>
wrote:

> Hi Pedro,
> 
> the properties are!!! important!!!
> 
> 
> 
> i do the following in an action:
> 
> request.setAttribute("helperBean",myValueObject);
> 
> return mapping.findForward("updateFormularPage");
> 
> 
> 
> and have something like that in
> the forwarded jsp
> 
> <struts-html:form action="/myActionPath">
> <struts-html:text name="helperBean" property="foo"/>
> 

  I didn't knew html:text had a name attribute :)
  I usually use

<html:text property="background" styleClass="field_required"/> (I supposed,
in this case, the name attribute is the form-bean name defined on the struts
config file)...

  One more question, if you have validation errors (after submitting the
form), you still have to pass the form properties to your helperBean or the
JSP page automatically presents the previous sent values (just like doing a
back on the browser)?

Thank you again,

Pedro Salgado


> ...
> 
> </struts-html:form>
> 
> 
> it works fine!
> 
> 
> Regards, Matthias
> 
> 
> 
> -----Original Message-----
> From: Pedro Salgado [mailto:[EMAIL PROTECTED]
> Sent: Saturday, January 03, 2004 6:08 PM
> To: Struts Users Mailing List
> Subject: Re: dynaform populate
> 
> 
> On 04/01/2004 16:55, "Matthias Wessendorf"
> <[EMAIL PROTECTED]>
> wrote:
> 
>> Hi Pedro,
>> 
>> with:
>> 
>> FormBeanConfig fbc = new FormBeanConfig();
>> fbc.setName("myForm");
>> DynaActionFormClass dafc =
>> DynaActionFormClass.createDynaActionFormClass(fbc);
>> DynaActionForm formBean = (DynaActionForm) dafc.newInstance();
>> formBean.set("property", businessObject.getProperty());
>> request.setAttribute("userPrefsForm",formBean);
>> //End
>> 
>> you can create a dynaBean.
>> i had the problem long time ago two.
>> 
>> why are willing to use dynaBeans for populating a JSP-Form-Page?
>> 
>> i use "ValueObjects" or "HelperBeans" instead, which i store in
>> request and with there properties the formfilds get filled to!
> 
> What you are telling me is that if I store a bean with the same name as
> the form, the html tag lib will interpret it as being the form, right?
> 
> Thank you very much!
> 
> Pedro Salgado
> 
>> 
>> look
>> http://rollerjm.free.fr/images/ClassStruts1_1.gif
>> an nice diagramm :-)
>> 
>> greetings
>> Matthias
>> 
>> 
>> 
>> -----Original Message-----
>> From: Pedro Salgado [mailto:[EMAIL PROTECTED]
>> Sent: Saturday, January 03, 2004 5:29 PM
>> To: Struts Users Mailing List
>> Subject: dynaform populate
>> 
>> 
>> 
>> Can anyone help me on this?
>> I am trying to pass a populated DynaActionForm to a JSP file and I
>> can't figure out how can I populate the form...
>> 
>> I have the following sequence:
>> 
>> - form A (name : gotoUserPrefsForm, id : String - user id)
>> - action ViewUserPreferences (uses form A)
>> - form B (name : userPrefsForm, severall attributes)
>> 
>> 
>> ViewUserPreferences {
>> 
>>   /** @param form this is form A. */
>>   ... execute(..., form, ...) {
>> 
>>       int id = FormUtils.getIntValue(form, "id");
>> 
>>       UserPreferences prefs = service.getUserPreferences("id");
>> 
>>       // here starts the problem!!!
>>       // gets the form bean configuration
>>       FormBeanConfig fc =
>> config.findFormBeanConfig(mapping.getName());
>> 
>>       // this is supposed to be form B
>>       DynaValidatorForm dynaForm = // how do I create a new instance
>> with the FormBeanConfig?...
>> 
>> 
>>       dynaForm.set("background", prefs.getBackground());
>> 
>>       request.setAttribute("userPrefsForm", dynaForm);
>> 
>>   }
>> 
>> }
>> 
>> 
>> Any ideas?
>> 
>> Pedro Salgado
>> 
>> 
>> ---------------------------------------------------------------------
>> 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]
> 
> 
> ---------------------------------------------------------------------
> 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