Re: the checkRequired () magic is back (bug or a normal behavior?)

2008-03-24 Thread Johan Compagner
done On Thu, Mar 20, 2008 at 2:03 AM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: Oh, sorry. I meant write in javadoc :) On Thu, Mar 20, 2008 at 2:02 AM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: For me that's probably fine if you will clearly right in javadoc that anyone who overrides

the checkRequired () magic is back (bug or a normal behavior?)

2008-03-19 Thread Vitaly Tsaplin
Hi guys, According to the wicket javadoc the method checkRequired () of the FormComponent class ...should typically only be called when isRequired() returns true. But it seems to be different... public final void validate() { validateRequired();

Re: the checkRequired () magic is back (bug or a normal behavior?)

2008-03-19 Thread Johan Compagner
and did you look at checkRequired? public boolean checkRequired() { if (isRequired()) { On Wed, Mar 19, 2008 at 2:24 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: Hi guys, According to the wicket javadoc the method checkRequired () of the FormComponent class ...should

Re: the checkRequired () magic is back (bug or a normal behavior?)

2008-03-19 Thread Vitaly Tsaplin
checkRequired () itself shouldn't be called at all unless setRequired is true... On Wed, Mar 19, 2008 at 9:43 PM, Johan Compagner [EMAIL PROTECTED] wrote: and did you look at checkRequired? public boolean checkRequired() { if (isRequired()) { On Wed, Mar 19, 2008

Re: the checkRequired () magic is back (bug or a normal behavior?)

2008-03-19 Thread Johan Compagner
it checks if the required needs to be checked and if that is the case it checks if the input is set On Wed, Mar 19, 2008 at 10:32 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: checkRequired () itself shouldn't be called at all unless setRequired is true... On Wed, Mar 19, 2008 at 9:43 PM,

Re: the checkRequired () magic is back (bug or a normal behavior?)

2008-03-19 Thread Vitaly Tsaplin
But the javadoc says: public boolean checkRequired() Checks if the form component's 'required' requirement is met. This method should typically only be called when FormComponent.isRequired() returns true. And I agree with javadoc :) checkRequired () should be called only to know if the form

Re: the checkRequired () magic is back (bug or a normal behavior?)

2008-03-19 Thread Johan Compagner
i dont agree then you have to do everywhere if (isRequired()) checkRequired() thats horrible, checkRequired() can test that just as fine i will update the javadoc johan On Wed, Mar 19, 2008 at 10:51 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: But the javadoc says: public boolean

Re: the checkRequired () magic is back (bug or a normal behavior?)

2008-03-19 Thread Igor Vaynberg
i agree with vitaly, johan? -igor On Wed, Mar 19, 2008 at 2:51 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: But the javadoc says: public boolean checkRequired() Checks if the form component's 'required' requirement is met. This method should typically only be called when

Re: the checkRequired () magic is back (bug or a normal behavior?)

2008-03-19 Thread Johan Compagner
i disagree i will not check everywhere for isRequired() that can be done in 1 method On Wed, Mar 19, 2008 at 10:54 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: i agree with vitaly, johan? -igor On Wed, Mar 19, 2008 at 2:51 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: But the javadoc

Re: the checkRequired () magic is back (bug or a normal behavior?)

2008-03-19 Thread Igor Vaynberg
why dont we build that check into validateRequired() so validateRequired() { if (isrequired() { ...current code } } that way you never have to call checkrequired() directly, just call validaterequired() -igor On Wed, Mar 19, 2008 at 2:54 PM, Johan Compagner [EMAIL PROTECTED] wrote: i dont

Re: the checkRequired () magic is back (bug or a normal behavior?)

2008-03-19 Thread Igor Vaynberg
but then you are pushing this check to users who change what checkrequired() means, they will probably forget to do isrequired() check first... -igor On Wed, Mar 19, 2008 at 2:56 PM, Johan Compagner [EMAIL PROTECTED] wrote: i disagree i will not check everywhere for isRequired() that can

Re: the checkRequired () magic is back (bug or a normal behavior?)

2008-03-19 Thread Vitaly Tsaplin
but then you are pushing this check to users who change what checkrequired() means, they will probably forget to do isrequired() check first... ^^ | -Sure, sure, sure! :) That what is really annoying. On Wed, Mar 19, 2008 at 10:57 PM, Igor Vaynberg

Re: the checkRequired () magic is back (bug or a normal behavior?)

2008-03-19 Thread Johan Compagner
nope i am against that validateRequired is protected checkRequired is public And if i want to test for requirement from outside i dont want to call first for every thing isRequired first i find it very odd that a method can return very funny stuff when you dont call one method before it first it

Re: the checkRequired () magic is back (bug or a normal behavior?)

2008-03-19 Thread Johan Compagner
if you also want to check it in validateRequired() thats fine by me by the way But i dont want it to be removed in checkRequired() And the javadoc must be updated anyway johan On Wed, Mar 19, 2008 at 11:05 PM, Johan Compagner [EMAIL PROTECTED] wrote: nope i am against that validateRequired

Re: the checkRequired () magic is back (bug or a normal behavior?)

2008-03-19 Thread Igor Vaynberg
thats kinda cludge imho. checkrequired() defines the process of checking, whether that needs to be invoked or not is up to the formcomponent and its required attribute. we can make validaterequired() public, although i dont see where you would call only that instead of the entire validate()

Re: the checkRequired () magic is back (bug or a normal behavior?)

2008-03-19 Thread Vitaly Tsaplin
The code should follow the design and not conversely... On Wed, Mar 19, 2008 at 11:10 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: thats kinda cludge imho. checkrequired() defines the process of checking, whether that needs to be invoked or not is up to the formcomponent and its required

Re: the checkRequired () magic is back (bug or a normal behavior?)

2008-03-19 Thread Johan Compagner
On Wed, Mar 19, 2008 at 11:10 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: thats kinda cludge imho. checkrequired() defines the process of checking, whether that needs to be invoked or not is up to the formcomponent and its required attribute. exactly and why do you want that outside of that

Re: the checkRequired () magic is back (bug or a normal behavior?)

2008-03-19 Thread Johan Compagner
ì guess checkRequired( ) is only overridable because of FormComponentPanel so that again that can be overriden to have there own requirement check? so yes it should really be at least protected On Wed, Mar 19, 2008 at 11:10 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: thats kinda cludge imho.

Re: the checkRequired () magic is back (bug or a normal behavior?)

2008-03-19 Thread Vitaly Tsaplin
Any component is overridable, nothing prevents my from overriding the FormComponent in case if my component does not require any complex markup. On Wed, Mar 19, 2008 at 11:22 PM, Johan Compagner [EMAIL PROTECTED] wrote: ì guess checkRequired( ) is only overridable because of

Re: the checkRequired () magic is back (bug or a normal behavior?)

2008-03-19 Thread Johan Compagner
huh this is dont get? What do you do exactly in checkRequired()? i guess the only thing that is really made for is when you have a composite component with more then 1 real input field (in html) that then have to be combined to check if the requirement is met (all 3 must be filled in or something

Re: the checkRequired () magic is back (bug or a normal behavior?)

2008-03-19 Thread Igor Vaynberg
thats what i said! -igor On Wed, Mar 19, 2008 at 3:14 PM, Johan Compagner [EMAIL PROTECTED] wrote: On Wed, Mar 19, 2008 at 11:10 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: thats kinda cludge imho. checkrequired() defines the process of checking, whether that needs to be invoked or

Re: the checkRequired () magic is back (bug or a normal behavior?)

2008-03-19 Thread Igor Vaynberg
ok, so given that we make checkrequired protected (pushes it into 1.5 timeframe) are you ok with moving isrequired() check out into validaterequired() ? -igor On Wed, Mar 19, 2008 at 3:22 PM, Johan Compagner [EMAIL PROTECTED] wrote: ì guess checkRequired( ) is only overridable because of

Re: the checkRequired () magic is back (bug or a normal behavior?)

2008-03-19 Thread Johan Compagner
yes and add a big javadoc warning that this method is not meant to be called only meant to be overriden.. johan On Wed, Mar 19, 2008 at 11:35 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: ok, so given that we make checkrequired protected (pushes it into 1.5 timeframe) are you ok with moving

Re: the checkRequired () magic is back (bug or a normal behavior?)

2008-03-19 Thread Igor Vaynberg
do we need to add that to all our protected methods? if someone needs it, and they probably do since we made it public, we should prob make validateRequired() public - it is final iirc -igor On Wed, Mar 19, 2008 at 3:36 PM, Johan Compagner [EMAIL PROTECTED] wrote: yes and add a big javadoc

Re: the checkRequired () magic is back (bug or a normal behavior?)

2008-03-19 Thread Johan Compagner
no some protected methods can be called just fine from the outside world like validateRequired() (that could be public yes) But checkRequired() doesn't make much to call from the outside world because we have validateRequired() except that validateRequired() does set an error then and doesn't

Re: the checkRequired () magic is back (bug or a normal behavior?)

2008-03-19 Thread Johan Compagner
hmm the more i think about it the more i stand with my initial reply. checkRequired was always meant to be standalone it always checked from day 1 if required must be checked (thats why it is called *check*Required) and then it actually did the test. it was first protected final and then a long

Re: the checkRequired () magic is back (bug or a normal behavior?)

2008-03-19 Thread Vitaly Tsaplin
What if a requirement cannot be met if an input contains only spaces. I would override the checkRequired to do so. And it could be done for a text field. Why not? Anyway if I can override checkRequired I may not be calling isRequired and it's perfectly legal. Because the method is under my

Re: the checkRequired () magic is back (bug or a normal behavior?)

2008-03-19 Thread Vitaly Tsaplin
Whatever... the only thing you should do asap is to modify the javadoc... according to the current state. For now it's confusing... On Thu, Mar 20, 2008 at 1:18 AM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: What if a requirement cannot be met if an input contains only spaces. I would

Re: the checkRequired () magic is back (bug or a normal behavior?)

2008-03-19 Thread Johan Compagner
Thats all fine, but it was not build/designed that way period... The biggest api break was at the moment we removed final, which was there for quite sometime, and then sneaky add javadoc that it is required to call isRequired first before calling this method! but before that for this public

Re: the checkRequired () magic is back (bug or a normal behavior?)

2008-03-19 Thread Vitaly Tsaplin
For me that's probably fine if you will clearly right in javadoc that anyone who overrides checkRequired should carefully call isRequired in order to conform the common behavior. On Thu, Mar 20, 2008 at 1:33 AM, Johan Compagner [EMAIL PROTECTED] wrote: Thats all fine, but it was not

Re: the checkRequired () magic is back (bug or a normal behavior?)

2008-03-19 Thread Vitaly Tsaplin
Oh, sorry. I meant write in javadoc :) On Thu, Mar 20, 2008 at 2:02 AM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: For me that's probably fine if you will clearly right in javadoc that anyone who overrides checkRequired should carefully call isRequired in order to conform the common