Adam Winer wrote:
> On 8/28/07, Vadim Dmitriev <[EMAIL PROTECTED]> wrote:
>   
>> Hi!
>>
>> As far as I know ADF had some limitation regarding client-side
>> validation with subforms. Suppose we have following block in a page:
>> <tr:form>
>>     <tr:inputText required="true" />
>>     <tr:subform>
>>         <tr:inputText />
>>         <tr:commandButton />
>>     </tr:subform>
>> </tr:form>
>>
>> In that case if we will try to submit that page via commandButton with
>> outer input field empty - validation error will occur on client, while
>> with client-side validation disabled this request will be absolutely
>> valid (i.e. no server-side validation exceptions will be thrown).
>>     
>
> In fact, that's false.  Server-side validation will fire for
> the inputText, as components outside subforms always
> execute.
>
> There should be no cases whatsoever where client-side
> validation is stricter than server-side.  Any such cases
> are major bugs, as they open security holes
> in any application that relies on the client-side validation.
>
> -- Adam
>   
Seems I misunderstood tr:subform description.
As written in [1]: "The CoreSubform represents an independently
submittable region of a page. The contents of a subform will only be
validated (or otherwise processed) if a component inside of the subform
is responsible for submitting the page." Maybe it worth to mention
there, that subform's parent form will also be validated and processed?
However thanks for clearing that for me, Adam!

[1] - http://myfaces.apache.org/trinidad/trinidad-api/tagdoc/tr_subform.html
>> Yesterday i faced that problem with trinidad. Maybe there is some quick
>> workaround? I really don't want to take "immediate/binding/submitted
>> value" way. Not to mention that that method leads to skipping subform
>> validation :)
>>
>> I took a quick look into trinidad's client-side validation
>> implementation and found interesting block of code in the
>> _multiValidation() function related to skipping all subform's fields
>> validators if user submitted outer form. Maybe it will be easier for me
>> (if at all possible) to modify that filtering process to skip outer form
>> validators if subform is submitted?
>>
>> Thank you in advance!
>>
>> P.S. I understand that AJAX-enabled server-side validation is actually
>> fast and consumes very little of traffic, but my boss stands for "if we
>> can do it on client-side - we'll do it on client". So I have choice of
>> either "fixing" said problem in trinidad itself or writing all
>> client-side validation from scratch.
>>
>>     

Reply via email to