Re: problem submiting List-Backed Indexed ActionForm

2005-01-17 Thread Oleg
Thank you everyone for your help. This page
http://wiki.apache.org/struts/StrutsCatalogLazyList explained the
process very clearly, perfect! Thank you, it works now.

Oleg


On Sun, 16 Jan 2005 10:03:32 -0800, Richard Yee [EMAIL PROTECTED] wrote:
 Why don't you send the code in your reset() method so we can see if it is
 correct.
 
 -Richard
 
 
 At 05:51 PM 1/15/2005, you wrote:
 I am initializing ArrayList fields in reset(), but code is ommited.
 I wish it was that easy :)
 
 
 On Sat, 15 Jan 2005 19:17:09 -0600, Kishore Senji [EMAIL PROTECTED] wrote:
   Looks like you are not properly initializing your fields (ArrayList)
in FormActionForm. You should initialize it while declaring or in the
   reset()
  
  
   On Sat, 15 Jan 2005 17:06:33 -0800, Oleg [EMAIL PROTECTED] wrote:
I finally got it to display, no problem, however there is an error
when I submit:
   
java.lang.NullPointerException
  org.apache.commons.beanutils.PropertyUtils.getIndexedProperty
   
Here is what I got so far.
Struts Version 1.2.4.
   
My FormActionForm includes an ArrayList fields of Bean Field.
   
FormActionForm:
   
   public ArrayList getFields() {
 return fields;
   }
   
 public void setFields(ArrayList fields) {
   this.fields = fields;
 }

   
Field
   
 private String label;
 private String name;
 private String value;
 private String type;
... with all getters and setters ..
   
  ...
JSP (displays no problem!!):
logic-el:iterate name=formActionForm property=fields id=foo
indexId=ctr
 tr
 tdhtml-el:text property='%= fields[ + ctr + ].label %' //td
 tdhtml-el:text property='%= fields[ + ctr + ].value %' //td
 tdhtml-el:checkbox property='%= fields[ + ctr + ].required
  %' //td
 /tr
/logic-el:iterate
   
Hit the wall here, big time.
   
Thanks,
Oleg
   
-
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]



RE: problem submiting List-Backed Indexed ActionForm

2005-01-16 Thread Karr, David
If you don't understand how the code works, there's no better solution
than running the application in your debugger and stepping through the
Struts and Commons source code.  When you get to the line that throws
the NPE, you'll have the first clue about what's going wrong.  You'll
need to make sure you have the source distributions corresponding to the
binary versions that you're using.  It's easy enough to know that you'll
need the source distribution for Struts 1.2.4, but it might not be
obvious that you'll need the source for Commons BeanUtils, version
1.6.1.  This is from the install guide.

Barring that, it would have helped if you'd included the actual
exception stack trace.  Someone could then look at the actual line to
get a clue about what's happening (although running in the debugger is
still better).

That being said, the most likely answer is that your fields list is
null, or too short.

 -Original Message-
 From: Oleg [mailto:[EMAIL PROTECTED] 
 
 I finally got it to display, no problem, however there is an 
 error when I submit:
 
 java.lang.NullPointerException
org.apache.commons.beanutils.PropertyUtils.getIndexedProperty
 
 Here is what I got so far.
 Struts Version 1.2.4.
  
 My FormActionForm includes an ArrayList fields of Bean Field.
 
 FormActionForm:
 
 public ArrayList getFields() {
   return fields;
 }
 
   public void setFields(ArrayList fields) {
 this.fields = fields;
   }
 
 
 Field
 
   private String label;
   private String name;
   private String value;
   private String type;
 ... with all getters and setters .. 
 ..
 .
 JSP (displays no problem!!):
  logic-el:iterate name=formActionForm property=fields 
 id=foo indexId=ctr
   tr
   tdhtml-el:text property='%= fields[ + ctr + ].label 
 %' //td
   tdhtml-el:text property='%= fields[ + ctr + ].value 
 %' //td
   tdhtml-el:checkbox property='%= fields[ + ctr + 
 ].required %' //td
   /tr
 /logic-el:iterate
 
 
 Hit the wall here, big time.
 
 Thanks,
 Oleg
 
 -
 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]



Re: problem submiting List-Backed Indexed ActionForm

2005-01-16 Thread Richard Yee
Why don't you send the code in your reset() method so we can see if it is 
correct.

-Richard
At 05:51 PM 1/15/2005, you wrote:
I am initializing ArrayList fields in reset(), but code is ommited.
I wish it was that easy :)
On Sat, 15 Jan 2005 19:17:09 -0600, Kishore Senji [EMAIL PROTECTED] wrote:
 Looks like you are not properly initializing your fields (ArrayList)
  in FormActionForm. You should initialize it while declaring or in the
 reset()


 On Sat, 15 Jan 2005 17:06:33 -0800, Oleg [EMAIL PROTECTED] wrote:
  I finally got it to display, no problem, however there is an error
  when I submit:
 
  java.lang.NullPointerException
org.apache.commons.beanutils.PropertyUtils.getIndexedProperty
 
  Here is what I got so far.
  Struts Version 1.2.4.
 
  My FormActionForm includes an ArrayList fields of Bean Field.
 
  FormActionForm:
 
 public ArrayList getFields() {
   return fields;
 }
 
   public void setFields(ArrayList fields) {
 this.fields = fields;
   }
  
 
  Field
 
   private String label;
   private String name;
   private String value;
   private String type;
  ... with all getters and setters ..
  
...
  JSP (displays no problem!!):
  logic-el:iterate name=formActionForm property=fields id=foo
  indexId=ctr
   tr
   tdhtml-el:text property='%= fields[ + ctr + ].label %' //td
   tdhtml-el:text property='%= fields[ + ctr + ].value %' //td
   tdhtml-el:checkbox property='%= fields[ + ctr + ].required 
%' //td
   /tr
  /logic-el:iterate
 
  Hit the wall here, big time.
 
  Thanks,
  Oleg
 
  -
  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]


problem submiting List-Backed Indexed ActionForm

2005-01-15 Thread Oleg
I finally got it to display, no problem, however there is an error
when I submit:

java.lang.NullPointerException
   org.apache.commons.beanutils.PropertyUtils.getIndexedProperty

Here is what I got so far.
Struts Version 1.2.4.
 
My FormActionForm includes an ArrayList fields of Bean Field.

FormActionForm:

public ArrayList getFields() {
  return fields;
}

  public void setFields(ArrayList fields) {
this.fields = fields;
  }


Field

  private String label;
  private String name;
  private String value;
  private String type;
... with all getters and setters ..
...
JSP (displays no problem!!):
 logic-el:iterate name=formActionForm property=fields id=foo
indexId=ctr
  tr
  tdhtml-el:text property='%= fields[ + ctr + ].label %' //td
  tdhtml-el:text property='%= fields[ + ctr + ].value %' //td
  tdhtml-el:checkbox property='%= fields[ + ctr + ].required %' //td
  /tr
/logic-el:iterate


Hit the wall here, big time.

Thanks,
Oleg

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



Re: problem submiting List-Backed Indexed ActionForm

2005-01-15 Thread Kishore Senji
Looks like you are not properly initializing your fields (ArrayList)
 in FormActionForm. You should initialize it while declaring or in the
reset()


On Sat, 15 Jan 2005 17:06:33 -0800, Oleg [EMAIL PROTECTED] wrote:
 I finally got it to display, no problem, however there is an error
 when I submit:
 
 java.lang.NullPointerException
   org.apache.commons.beanutils.PropertyUtils.getIndexedProperty
 
 Here is what I got so far.
 Struts Version 1.2.4.
 
 My FormActionForm includes an ArrayList fields of Bean Field.
 
 FormActionForm:
 
public ArrayList getFields() {
  return fields;
}
 
  public void setFields(ArrayList fields) {
this.fields = fields;
  }
 
 
 Field
 
  private String label;
  private String name;
  private String value;
  private String type;
 ... with all getters and setters ..
 ...
 JSP (displays no problem!!):
 logic-el:iterate name=formActionForm property=fields id=foo
 indexId=ctr
  tr
  tdhtml-el:text property='%= fields[ + ctr + ].label %' //td
  tdhtml-el:text property='%= fields[ + ctr + ].value %' //td
  tdhtml-el:checkbox property='%= fields[ + ctr + ].required %' 
 //td
  /tr
 /logic-el:iterate
 
 Hit the wall here, big time.
 
 Thanks,
 Oleg
 
 -
 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]



Re: problem submiting List-Backed Indexed ActionForm

2005-01-15 Thread Oleg
I am initializing ArrayList fields in reset(), but code is ommited.
I wish it was that easy :)


On Sat, 15 Jan 2005 19:17:09 -0600, Kishore Senji [EMAIL PROTECTED] wrote:
 Looks like you are not properly initializing your fields (ArrayList)
  in FormActionForm. You should initialize it while declaring or in the
 reset()
 
 
 On Sat, 15 Jan 2005 17:06:33 -0800, Oleg [EMAIL PROTECTED] wrote:
  I finally got it to display, no problem, however there is an error
  when I submit:
 
  java.lang.NullPointerException
org.apache.commons.beanutils.PropertyUtils.getIndexedProperty
 
  Here is what I got so far.
  Struts Version 1.2.4.
 
  My FormActionForm includes an ArrayList fields of Bean Field.
 
  FormActionForm:
 
 public ArrayList getFields() {
   return fields;
 }
 
   public void setFields(ArrayList fields) {
 this.fields = fields;
   }
  
 
  Field
 
   private String label;
   private String name;
   private String value;
   private String type;
  ... with all getters and setters ..
  ...
  JSP (displays no problem!!):
  logic-el:iterate name=formActionForm property=fields id=foo
  indexId=ctr
   tr
   tdhtml-el:text property='%= fields[ + ctr + ].label %' //td
   tdhtml-el:text property='%= fields[ + ctr + ].value %' //td
   tdhtml-el:checkbox property='%= fields[ + ctr + ].required %' 
  //td
   /tr
  /logic-el:iterate
 
  Hit the wall here, big time.
 
  Thanks,
  Oleg
  
  -
  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]



Re: problem submiting List-Backed Indexed ActionForm

2005-01-15 Thread Curtis Taylor
Hi Oleg,
Have a look here:
http://wiki.apache.org/struts/StrutsCatalogLazyList
I've found these techniques to be invaluable.
HTH,
-- Curtis
Oleg wrote:
I am initializing ArrayList fields in reset(), but code is ommited.
I wish it was that easy :)

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