RE: Nested form beans

2006-09-22 Thread Frank W. Zammetti
) { >> af1 = new SimpleObject1AsAnotherActionForm1(); >> af2 = new SimpleObject2AsAnotherActionForm2(); >> } >> } >> >> Access: >> <%= masterForm.af1.field1 %> >> >> Peiyun >> >> -Original Message- >> From: Frank W

RE: Nested form beans

2006-09-22 Thread Frank W. Zammetti
t; } > > Access: > <%= masterForm.af1.field1 %> > > Peiyun > > -Original Message- > From: Frank W. Zammetti [mailto:[EMAIL PROTECTED] > Sent: September 22, 2006 4:23 PM > To: Struts Users Mailing List > Cc: Struts Users Mailing List > Subject: Re: Nested fo

RE: Nested form beans

2006-09-22 Thread Jiang, Peiyun
: <%= masterForm.af1.field1 %> Peiyun -Original Message- From: Frank W. Zammetti [mailto:[EMAIL PROTECTED] Sent: September 22, 2006 4:23 PM To: Struts Users Mailing List Cc: Struts Users Mailing List Subject: Re: Nested form beans On Fri, September 22, 2006 3:59 pm, Hubert Rabago wrote: > I

Re: Nested form beans

2006-09-22 Thread Frank W. Zammetti
On Fri, September 22, 2006 3:59 pm, Hubert Rabago wrote: > I can't see anything that would cause your problem. > I guess if it were me, I'd fire up my debugger and start stepping > through some code. > Sorry. Yeah, that's the next step. Was hoping to avoid it with an easy answer, but that's the w

Re: Nested form beans

2006-09-22 Thread Hubert Rabago
I can't see anything that would cause your problem. I guess if it were me, I'd fire up my debugger and start stepping through some code. Sorry. All I can say at this point is that I know what you're doing is possible cause that's how FormDef does nested beans. Hubert On 9/22/06, Frank W. Zammett

Re: Nested form beans

2006-09-22 Thread Hubert Rabago
It still sounds like Struts is getting nulls for the subbeans when it tries to populate subbean.fieldX. Put some more logging, this time in the getters for the subbean in MasterForm, and log what it's returning. Hubert On 9/22/06, Frank W. Zammetti <[EMAIL PROTECTED]> wrote: As a follow-up, I

Re: Nested form beans

2006-09-22 Thread Frank W. Zammetti
As a follow-up, I threw some logging in the field1 and field2 setters in the subbeans... they don't appear to ever get called. I don't have to do anything special to tell Struts I'm using nested beans, do I? I didn't think so... Frank -- Frank W. Zammetti Founder and Chief Software Architect

Re: Nested form beans

2006-09-22 Thread Hubert Rabago
Either that or create new beans (if they're null) when their getters are called. By the time Struts attempts to populate the form bean, the nested forms should already be instantiated. MasterForm.getAction1Form() and MasterForm.getAction2Form() should not return a null. Hubert On 9/22/06, Chri

Re: Nested form beans

2006-09-22 Thread Chris Pratt
In your no-arg constructor of your outer ActionForm (the container), make sure it instantiates each of the nested ActionForms using their no-arg constructors. (*Chris*) On 9/22/06, Frank W. Zammetti <[EMAIL PROTECTED]> wrote: Sorry, by af1 and af2 I did mean actionForm1 and actionForm2... my m

Re: Nested form beans

2006-09-22 Thread Frank W. Zammetti
Sorry, by af1 and af2 I did mean actionForm1 and actionForm2... my mistake wasn't quite *THAT* obvious! ;) LOL Frank -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com AIM/Yahoo: fzammetti MSN: [EMAIL PROTECTED] Author of "Practical Ajax Projec

Re: Nested form beans

2006-09-22 Thread Frank W. Zammetti
Hi Hubert, Yes, I get nulls for af1 and af2... I do have getters and setters for them. Lemme throw some data your way... I was hoping to avoid posting all this, but I suspect there to be something my eyes just aren't catching, so... Here's ActionForm1: package app.test.formbeans; import org.a

Re: Nested form beans

2006-09-22 Thread Hubert Rabago
So what does happen when you submit the form? Are you getting NPEs? By the time Struts attempts to populate the form bean, the nested forms should already be instantiated. You should have getters and setters for af1 and af2, and getAf1() and getAf2() should not return a null. This could be an

Nested form beans

2006-09-22 Thread Frank W. Zammetti
I'm facing a situation where ideally I'd like to have a single ActionForm like so: public class MyActionForm extends ActionForm { AnotherActionForm1 af1; AnotherActionForm2 af2; } When in my JSP I do: ...I do indeed see the value as I expect. The way I did this is to have an Action mappin