Re: cannot override chechRequired ()

2008-03-17 Thread Igor Vaynberg
you still have broken validator support for that fcp. also inside formvalidator.validate() you cannot yet access the model, but only getconvertedinput() - which will always be null for your fcp so how do you validate its value inside the form validator? you probably only use it to trigger formvalid

Re: cannot override chechRequired ()

2008-03-17 Thread Vitaly Tsaplin
Thanks Igor, With the Date object we have a very nice and consistent example. I implemented my DatePicker exactly this way. But sometimes if the data is spread over different properties of a bean or even between different beans but still needs to be processed in a consistent manner the solut

Re: cannot override chechRequired ()

2008-03-17 Thread Igor Vaynberg
well, you dont want to implement input processing, yet you are using setrequired - which is used in that processing...you see the delema? what you should do is: class mypanel extends fcp { public mypanel { super(id, new Model()); } convertinput() { setconvertedinput(Boolean.TRUE); } }

Re: cannot override chechRequired ()

2008-03-17 Thread Vitaly Tsaplin
My component accepts 3 models as parameters, and uses this models internally. The component's model is not involved at all. You mean the method convertinput () must return at least something other then null? On Tue, Mar 18, 2008 at 1:10 AM, Igor Vaynberg <[EMAIL PROTECTED]> wrote: > i assumed y

Re: cannot override chechRequired ()

2008-03-17 Thread Igor Vaynberg
i assumed you properly implemented convertinput(). you cannot call setrequired(true) on the formcomponentpanel and then expect to completely avoid the required check. the required check is two-pronged. first half is done in the checkRequired() and works on the raw input. second part makes sure tha

Re: cannot override chechRequired ()

2008-03-17 Thread Vitaly Tsaplin
It seem it happens because the method getConvertedInput () of the FormComponentPanel returns null since methods setConvertedInput (), setModeValue and convertInput() were never called. public final void validate() { validateRequired(); if (isValid

Re: cannot override chechRequired ()

2008-03-17 Thread Vitaly Tsaplin
True. But I do... unfortunately. On Mon, Mar 17, 2008 at 11:15 PM, Igor Vaynberg <[EMAIL PROTECTED]> wrote: > you should not, since checkrequired() will pass. > > -igor > > > On Mon, Mar 17, 2008 at 2:47 PM, Vitaly Tsaplin > > > <[EMAIL PROTECTED]> wrote: > >Ok :) > > > >I have the

Re: cannot override chechRequired ()

2008-03-17 Thread Igor Vaynberg
you should not, since checkrequired() will pass. -igor On Mon, Mar 17, 2008 at 2:47 PM, Vitaly Tsaplin <[EMAIL PROTECTED]> wrote: >Ok :) > >I have the following > >checkRequired () { > return true; >} > >isRequired () { > return true; >} > >In the case abov

Re: cannot override chechRequired ()

2008-03-17 Thread Vitaly Tsaplin
Ok :) I have the following checkRequired () { return true; } isRequired () { return true; } In the case above Do I have an error message saying that the field is required? On Mon, Mar 17, 2008 at 10:42 PM, Igor Vaynberg <[EMAIL PROTECTED]> wrote: > no, that mean

Re: cannot override chechRequired ()

2008-03-17 Thread Igor Vaynberg
no, that means that effectively required check is disabled - eg it always passes -igor On Mon, Mar 17, 2008 at 2:15 PM, Vitaly Tsaplin <[EMAIL PROTECTED]> wrote: > If the method checkRequired () returns TRUE that means, I guess, the > requirement condition check must always pass, but it doesn'

Re: cannot override chechRequired ()

2008-03-17 Thread Vitaly Tsaplin
If the method checkRequired () returns TRUE that means, I guess, the requirement condition check must always pass, but it doesn't happens. On Mon, Mar 17, 2008 at 10:09 PM, Igor Vaynberg <[EMAIL PROTECTED]> wrote: > the reason formcomponentpanel.checkrequired() always returns true is > that for

Re: cannot override chechRequired ()

2008-03-17 Thread Igor Vaynberg
the reason formcomponentpanel.checkrequired() always returns true is that for a formcomponentpanel it is often a noop. so that is the best default implementation we can provide. you can always override it to implement some logic if you need... -igor On Mon, Mar 17, 2008 at 1:13 PM, Vitaly Tsapli

Re: cannot override chechRequired ()

2008-03-17 Thread Vitaly Tsaplin
I run into this problem implementing my own component as a subclass of the FormComponentPanel class. In my case the method checkRequired just always returns TRUE but if I set required property to TRUE the component always generate a validation error (field bla-bla-bla is required). On Mon, Mar

Re: cannot override chechRequired ()

2008-03-17 Thread Vitaly Tsaplin
I am not sure but I suspect that if the method checkRequired returns true a requirement condition must always met in any case or the behavior is different? On Mon, Mar 17, 2008 at 8:57 PM, Igor Vaynberg <[EMAIL PROTECTED]> wrote: > why should we call checkrequired() twice? > > -igor > > > On

Re: cannot override chechRequired ()

2008-03-17 Thread Igor Vaynberg
why should we call checkrequired() twice? -igor On Mon, Mar 17, 2008 at 12:06 PM, Vitaly Tsaplin <[EMAIL PROTECTED]> wrote: >It should be probably like this > > if (isValid() && (isRequired() ? !checkRequired > () : true) && getConvertedInput() == null && isInputNullab

Re: cannot override chechRequired ()

2008-03-17 Thread Vitaly Tsaplin
It should be probably like this if (isValid() && (isRequired() ? !checkRequired () : true) && getConvertedInput() == null && isInputNullable()) the second check. Doesn't call the chechRequired () { reportRequired

Re: cannot override chechRequired ()

2008-03-17 Thread Vitaly Tsaplin
But if checkRequired () returns true isRequired () called again generating a validation error... if (isValid() && isRequired() && getConvertedInput() == null && isInputNullable()) the second check. Doesn't call the chechRequired () {

Re: cannot override chechRequired ()

2008-03-17 Thread Igor Vaynberg
sure it does, see the first line of validate() -igor On Mon, Mar 17, 2008 at 11:06 AM, Vitaly Tsaplin <[EMAIL PROTECTED]> wrote: >Hi guys, > >It seams that there is a bug in the FormComponent code. I try to > override chechRequired method but it seams to not work at all. >Here is a

cannot override chechRequired ()

2008-03-17 Thread Vitaly Tsaplin
Hi guys, It seams that there is a bug in the FormComponent code. I try to override chechRequired method but it seams to not work at all. Here is a snippet from the sources. As you can see there is a second requirement check. /** * Checks if the raw input value is not nul