I'll have a look over where i've got it working (I don't think there were any hacks in there but its possible).
Cheers Mark
On Monday, September 1, 2003, at 04:28 PM, Terry Brick wrote:
Thank you much for your response. Two things....
1) Sorry, I left out a big piece of detail. I'm interested in doing this validation only on the server side (no javascript). Yet I still can't get it to work. Are you saying that I'm doing it correctly as show here?
<field property="my_collection_property" indexedListProperty="form_bean_name">
Your html:messages code was helpful in getting the errors for the top level bean, but there are still no errors for the nested beans... but that's because it's not validating them. I know this because validation will pass if the top level bean has the correct properties... regardless of what's in the nested beans. The nested beans just aren't being checked for validation.
2) About the book..... I completely agree. Glad to know it's not just me ;)
--- Mark Lowe <[EMAIL PROTECTED]> wrote:Programming jakarta struts is a nice introduction to webapp development in general and struts development too. The only problem is as soon as you want to do anything vaguely useful there's no detail. Its not a criticism of the book as such just that its scope is different to these sorts of problems.
There's and indexedListProperty attribute in validator for the purpose of which you speak, and it works although not for the javascript generation.
The array of form elements aren't generated in the javascript, but the js itself does handle indexed properties.. for example if you hard code myobj[0].myproperty in validator it works. So the only piece of the validator puzzle thats missing is generating the js array of indexed form elements .. If i'm not making any sense, have a before and after look at the javascript.
I think fixing the validator to generate indexed elements would be the fastest way of dealing with this, or add this to bugzilla. A hack could be to just layer some most js onto the page.
If you using the html:errors stuff and cant get it to spit them out, you could try bean:messages and spit out the errors like that, they are there (the errors) they're just hiding.
<logic:messagesPresent> <pre> <html:messages id="error"> <bean:write name="error"/> </html:messages> <pre> </logic:messagesPresent>
rather than
<pre> <html:errors /> </pre>
Cheers Mark
__________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com
--------------------------------------------------------------------- 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]