struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff_Mycha...@nlgroup.ca
Subject [LazyCollections] Anyone else using this?
Date Sat, 19 Oct 2002 18:01:01 GMT
Greetings:
      I am just starting to use this Class from commons.collections jar
that is in Struts 1.1b2 ( I am using tomcat 4.04)

I have several questions...

1- Is there anyone out there using this collection that can share some
insight?
2 - There was talk of a tutorial regarding this utility, but I cannot find
one in jakarta commons or keyboardmonkey.com.
 Does one exist? I have read (I think) all the posts in the archive
regarding this.

3 -  I am in the process of implementing a standard dynamic list of value
objects on a page that have several columns that are editable.
    I have it working for the most part but I have one *odd* issue.
When I submit the form, the list gets populated as it should but with one
extra value bean.

USAGE:
My form Bean contains the  property:
private List papVoList = LazyCollections.lazyList(new ArrayList(),PapVoViewBean.class);

 I use the nested tags to render the table on the page.

In my loadAction I send a standard java.util.List from the backend (which is probably a Vector);
List myList = businessService.getPapVoList();
myForm.setPapVoList(myList);
*** By doing this I guess the initialized LazyList in the form bean is replaced with a standard
List just for the loading of the page.
but when the form is submitted, I assume a new request scope form bean is created. ( if not
the list would not be populated at all)

Am I setting things up correctly?

Sorry for the Rambling, but here are some of the things I have observed:

A list of 20 goes onto the page and a list of 21 get created upon submit.
** The new** object has property with a value from the last legitimate
object in the list. Example:

vo[0]: amount=111 ,date=111
vo[1]: amount=222,date=222
...
vo[19]: amount=999,date=999
vo[20]: amount=999,date=null  (Extra object)
I do not understand why amt has a value but date does not.

I have verified that the control names are correct on the page . Example:
FROM papVoList[0].papDate    TO  papVoList[19].papDate  and no more.
I have printed the parameter names and values directly from the request and found no stray
parameters.

Another odd thing is that I tried to use the LazyCollections.clean(List) method(I didn't think
I would need to) ,
 it would produce yet another blank object to end of the list.

List myList = myForm.getMyList();
myList.size(): 21
LazyCollections.clean(myList)
myList.size(): 22




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


Mime
View raw message