Re: PROPOSAL: S2 ajax validation

2007-05-30 Thread Musachy Barroso
Given that DWR integration is broken anyway, and the ajax validation had mixed content of 2.1 already, I started to draft the documentation for it here (DWR was there before): http://cwiki.apache.org/confluence/display/WW/AJAX+Validation //editing help more than welcomed :) musachy On 4/29/07,

Re: PROPOSAL: S2 ajax validation

2007-04-29 Thread Musachy Barroso
One of the things I want to do is update the documentation for all the ajax tags, so we don't have that super-page with everything on it :). I think Don told me once that the wiki could be branched with the code. If the boxes are the only way I will just wait until we start building 2.1 to avoid m

Re: PROPOSAL: S2 ajax validation

2007-04-29 Thread Dave Newton
--- Musachy Barroso <[EMAIL PROTECTED]> wrote: > is there anyway I can update the docs (wiki) > without affecting 2.0.8 documentation? AFAIK this is handled w/ version notations in colorful boxes so it'll stand out :/ I don't know if there is a [reasonable] way to support a 2.0 vs. 2.1 docs on a h

Re: PROPOSAL: S2 ajax validation

2007-04-28 Thread Musachy Barroso
Just to follow up on this, everything is in trunk. This is how it works: Actions with the "jsonValidation" interceptor applied, will return something like: /* { "errors": ["Action error"], "fieldErrors": { "name": ["Name is required", "Something else"] } } */ i

Re: PROPOSAL: S2 ajax validation

2007-04-23 Thread Musachy Barroso
That would be the function I mentioned before. With that in mind, I think it would be better to have the interceptor and the generic function in core, so it can be used with other js libraries. I was going to put it in the Dojo plugin as we are moving all the ajax stuff there, but it isn't specifi

Re: PROPOSAL: S2 ajax validation

2007-04-23 Thread Brian Pontarelli
Excellent. Well, then really all that is lacking is a generic JS script to handle the response and add errors to the form/labels/some div. It would be excellent to have a JS plugin model where developers can select the JS framework they want to use and then they can plugin to the Struts handlin

Re: PROPOSAL: S2 ajax validation

2007-04-23 Thread Musachy Barroso
By the way, should we ever bring the JSON plugin in? musachy On 4/23/07, Musachy Barroso <[EMAIL PROTECTED]> wrote: Thanks for the code. Mine is very similar with some JSON encoding added. The resulting JSON is a little bit different: /* { "errors": [ "Error0", "Error1" ], "fi

Re: PROPOSAL: S2 ajax validation

2007-04-23 Thread Musachy Barroso
Thanks for the code. Mine is very similar with some JSON encoding added. The resulting JSON is a little bit different: /* { "errors": [ "Error0", "Error1" ], "fieldErrors": { "field1" : ["Error0", "Error1"], "field2": ["Error0", "Error1"], } } */ musachy On 4/23/07, Br

Re: PROPOSAL: S2 ajax validation

2007-04-23 Thread Brian Pontarelli
I've also done this exercise twice in the past and both times I used other JS libraries including prototype. My first solution was specifically for WebWork and I don't recall any changes I had to make when moving it over to Struts2. Perhaps it makes sense to ensure that this will be completely

Re: PROPOSAL: S2 ajax validation

2007-04-23 Thread Musachy Barroso
This would be for 2.1, and it would be in Bind.js. It is actually only one function, which will be calling the functions in validation.js(addError/clearErrors...). I'm planning to do some cleanup after that as we have some javascript/css files hanging around, which are not used. musachy On 4/23/

Re: PROPOSAL: S2 ajax validation

2007-04-23 Thread Ian Roughley
Is the Ajax code all in a module now (2.1.x)? Would this change be checked into the 2.0.x branch or just the trunk under the Ajax module, and then some cleanup/removal of existing code in the trunk? /Ian Musachy Barroso wrote: I have this working, but I want to give it a little more time to

Re: PROPOSAL: S2 ajax validation

2007-04-22 Thread Musachy Barroso
I have this working, but I want to give it a little more time to anyone to object before committing it :), just to review, these are the different validation options: 1. regular form, regular submit button (normal validation) 2. css_html form, or xhtml form (validate="true"), regular submit but

PROPOSAL: S2 ajax validation

2007-04-21 Thread Musachy Barroso
I'd like to propose a change on the way we do ajax validation. Instead of using DWR which requires an external dependency and configuring a servlet, I'd like to have an interceptor in the dojo plugin that extends the validator interceptor, which outputs JSON with the messages when there are valida