How to find out that component is being updated by AjaxFormComponentUpdatingBehavior?

2009-05-29 Thread Sergej Logish
Hello community!

I have created component, which supports code input by which it then finds
corresponding value in DB and shows it's name (clasifier).
If user clears code and leaves input component,
AjaxFormComponentUpdatingBehavior takes it's turn and removes previously
fetched
label (if any).
The problem is, that removing current value is a *valid* operation even if
component itself is marked as *required*. So, in order to correctly
process component update I need to know, if this AJAX request is this single
component update or entire form submit (which also could
be AJAX request).
I just didn't find any good solution yet. Currently I just always return *true
*from overriden* checkRequired()* method in case of AJAX request.
But if entire form, were component resides, will be submitted via AJAX,
required validation will be just bypassed... That's not good.

Thanks in advance for any advices!


How to find that component is being updated by AjaxFormComponentUpdatingBehavior?

2009-05-28 Thread Sergej Logish
Hello community!
I have created component, which supports text code input by which it then
finds corresponding value in DB.
If user deletes code and leaves input component,
AjaxFormComponentUpdatingBehavior takes it's turn
and removes previously fetched value (if any). The problem is, that removing
current value is valid operation
even if component marked as required. So, I need to maintain two component
states - single value update
via AJAX and complete form submit, which in turn also can be AJAX'ified.
I just didn't find any robust solution yet. Currently my component returns
true from checkRequired() method in
case of AJAX request target, but if form will be submitted via AJAX
component could end up in invalid state.
Would be very grateful for advices!