Re: Using ArrayList instead of String[] properties

2004-01-13 Thread Mark Lowe
In the logic-el:iterate you defined the bean to scope with the id attribute, but then don't reference it in the form element html-el:checkbox name=acct property=accounts indexed=true / I'd consider not storing the formbeans in a map as you don't need to get the values out with a key. I

RE: Using ArrayList instead of String[] properties

2004-01-13 Thread shankarr
Hi! I was myself trying to work on a similar issue. My problem is as follows: i query db. Then store data in Araylist. How to pass this to jsp page? Any sample code great appreciation. Please urgent. Sha At 02:27 PM 1/12/2004 -0700, you wrote: From: Wendy Smoak Apparently you don't have to use

Re: Using ArrayList instead of String[] properties

2004-01-13 Thread Mark Lowe
what does you form bean look like (dyna or otherwise)? On 13 Jan 2004, at 12:07, shankarr wrote: Hi! I was myself trying to work on a similar issue. My problem is as follows: i query db. Then store data in Araylist. How to pass this to jsp page? Any sample code great appreciation. Please

RE: Using ArrayList instead of String[] properties

2004-01-13 Thread Robert Taylor
Message- From: shankarr [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 13, 2004 7:07 AM To: Struts Users Mailing List Subject: RE: Using ArrayList instead of String[] properties Hi! I was myself trying to work on a similar issue. My problem is as follows: i query db. Then store data

RE: Using ArrayList instead of String[] properties

2004-01-13 Thread Wendy Smoak
From: Robert Taylor [mailto:[EMAIL PROTECTED] Unless I've missed something, I don't see the need to using indexed properties here if the selected value is single String and order doesn't matter. After much consideration, neither do I! I thought ArrayList would be easier to deal with, but

Re: Using ArrayList instead of String[] properties

2004-01-13 Thread Mark Lowe
Using arrayList as a form property works fine with action forms dyna or otherwise. In fact IMO it makes like simpler. As i recall you were trying to iterate through a map of forms not an arraylist. On 13 Jan 2004, at 14:28, Wendy Smoak wrote: From: Robert Taylor [mailto:[EMAIL PROTECTED]

RE: Using ArrayList instead of String[] properties

2004-01-13 Thread Wendy Smoak
From: Mark Lowe [mailto:[EMAIL PROTECTED] Using arrayList as a form property works fine with action forms dyna or otherwise. In fact IMO it makes like simpler. As i recall you were trying to iterate through a map of forms not an arraylist. The iterator goes through a Map, yes, but that

Re: Using ArrayList instead of String[] properties

2004-01-13 Thread Mark Lowe
fair enough .. i'm having a bad day with multiple, select menus and bean utils not dealing with life every well. java.lang.IllegalArgumentException: argument type mismatch bean utils seems to be complaining that the types in my form and those in the form bean are somehow different, i cant see

RE: Using ArrayList instead of String[] properties

2004-01-13 Thread Wendy Smoak
From: Mark Lowe [mailto:[EMAIL PROTECTED] It was working, until i rearranged a few things. A few questions/suggestions in help me problem solve would be greatly appreciated if you have the time. I also don't see why BeanUtils can't handle turning multiple request parameters with the same

RE: Using ArrayList instead of String[] properties

2004-01-13 Thread Kris Schneider
For a resizable list from an array, try: List stringList = new ArrayList(Arrays.asList(stringArray)); Quoting Wendy Smoak [EMAIL PROTECTED]: From: Mark Lowe [mailto:[EMAIL PROTECTED] It was working, until i rearranged a few things. A few questions/suggestions in help me problem solve

Re: Using ArrayList instead of String[] properties

2004-01-13 Thread Mark Lowe
The only issue with using arraylist as a form property is to scope to session so you can change the size when required. I tend to use them for nesting beans rather then just storing strings. My form parameters are in an arraylist. I just think beanUtils hates me or something rational like

RE: Using ArrayList instead of String[] properties

2004-01-13 Thread Michael McGrady
Hi, Wendy, Just do this or whatever is similar that you like. This is what I do. public class ArrayListWrapper extends ArrayList { private ArrayListWrapper(Object [] param) { for(int i = 0; i param.length; i++) { this.add(param[i]); } } public static ArrayList

RE: Using ArrayList instead of String[] properties

2004-01-12 Thread Wendy Smoak
From: Wendy Smoak Apparently you don't have to use logic-el:iterate with html-el:checkbox indexed=true. This works: c:forEach items=${accountMap[accountForm.map.calendarYear]} var=account html-el:checkbox property=accounts indexed=true I lied, that doesn't work at all. It produces

Re: Using ArrayList instead of String[] properties

2004-01-09 Thread Mark Lowe
I think your multibox needs to be index=true or be a checkbox with index=true. On 9 Jan 2004, at 21:46, Wendy Smoak wrote: I have a String[] property in a DynaValidatorForm. It works fine with multiple checkboxes and accepts multiple selections. Now I need to do an advanced user interface,

RE: Using ArrayList instead of String[] properties

2004-01-09 Thread Wendy Smoak
From: Mark Lowe [mailto:[EMAIL PROTECTED] I think your multibox needs to be index=true or be a checkbox with index=true. Thanks for the hint. It looks like it's indexed=true and only valid on checkbox (not multibox). But the docs say indexed can only be used inside a logic:iterate, and

RE: Using ArrayList instead of String[] properties

2004-01-09 Thread Wendy Smoak
From: Wendy Smoak Is it true that I must use logic-el:iterate instead of c:forEach, if I want indexed properties? Oh, it figures. Something else was wrong, and of COURSE I discovered it right after hitting send. Apparently you don't have to use logic-el:iterate with html-el:checkbox

Re: Using ArrayList instead of String[] properties

2004-01-09 Thread Michael McGrady
I would personally suggest that you rethink your design. If you want an advanced user interface that does that, then I would use a ListHandler implementation of a ListIterator interface that is so popular with the J2EE pattern people. The ListIterator interface is something like the

Re: Using ArrayList instead of String[] properties

2004-01-09 Thread Mark Lowe
Reckon that looks complex to me although i tend to use action forms not dynaaction forms. public class Account { private String name; private String number; private String description; ..bla bla } may as will use dynaactionform for this example as just an