Re: BigDecimal vs WOConditional
Re: BigDecimal vs WOConditional
- Subject: Re: BigDecimal vs WOConditional
- From: Mike Schrag <email@hidden>
- Date: Tue, 17 Feb 2009 15:21:46 -0500
Actually, this is not (or, more precisely, SHOULD not) be a
WOConditional trait; the very same behaviour should be used for
all .wod boolean bindings which contain a number object (say, for a
WOHyperlink "disabled" binding, and for WOString "escapeHTML"
binding, yadda yadda yadda...).
it's WOAssociation.booleanValueInComponent, but not every component
uses this ... the implementation is:
instanceof Number = false if intValue() == 0, true otherwise
else instanceof String = false if ("no", "false", "nil", "null"), if
the String is the String form of a number (0-9+.-), false if
parseInt(..) == 0, true otherwise
else instanceof Boolean = boolean value
else not null = true
else null = false
If each of them does this for itself (and potentially in a different
way than all the others), then the thing is much worse disaster I've
thought :(
I suspect most of WO core uses this ... Wonder has a mix where some
use ERXValueUtilities, which has a broader interpretation.
ms
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden