Re: [gwt-contrib] RR: allow CheckBox to accept null?

2010-08-26 Thread Johan Rydberg

On 8/25/10 6:16 PM, Ray Ryan wrote:
The use case is dealing with boolean values that may be null, and 
really a check box is just the wrong UI there. Withdrawn.
I know of at least one data binding framework, gwt-pectin, that signals 
no value using null. As a work-around gwt-pectin has it's own CheckBox 
impl that accepts null.


Take this example; We have a master-detail interface.  a CheckBox has 
been bound to selectedElement.male.  If there is not a selected 
element, a no value signal should be sent down through data binding, 
not False. Right?


But then again, there's really no way to communicate something like a 
placeholder value for a checkbox.  But I still think CheckBox should 
accept null, for the interface to be consistent.


--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


Re: [gwt-contrib] RR: allow CheckBox to accept null?

2010-08-26 Thread Bruce Johnson
Fwiw, I don't actually care. It just seemed like something that needed
some devil's advocacy.

On Thursday, August 26, 2010, Ray Ryan rj...@google.com wrote:
 Andrew, how would this be?
     CheckBox cb = new CheckBox();

     cb.setValue(null);
     assertFalse(cb.getValue());
 rjrjr

 On Thu, Aug 26, 2010 at 5:57 PM, Andrew Pietsch andrew.piet...@gmail.com 
 wrote:
 I personally would like to see it support null, not because null is a
 valid UI state but just to be consistent with all the other widgets.
 As far as pectin is concerned the bindings always created before the
 real value arrives so wigets are aften set to null. I've tried to
 avoid wiget specific logic in the core bindings as much as possible
 (it's a slippery slope to ugliness) and CheckBox is the odd one out.
 As a somewhat silly thought would a marker interface be an option i.e.
 perhaps something like `CheckBox implements HasValue, BarfsOnNull` so
 there's at least a mechanism to find out?

 On Aug 26, 6:00 pm, Johan Rydberg johan.rydb...@edgeware.tv wrote:
 On 8/25/10 6:16 PM, Ray Ryan wrote: The use case is dealing with boolean 
 values that may benull, and
  really a check box is just the wrong UI there. Withdrawn.

 I know of at least one data binding framework, gwt-pectin, that signals
 no value usingnull. As a work-around gwt-pectin has it's ownCheckBox
 impl that acceptsnull.

 Take this example; We have a master-detail interface.  aCheckBoxhas
 been bound to selectedElement.male.  If there is not a selected
 element, a no value signal should be sent down through data binding,
 not False. Right?

 But then again, there's really no way to communicate something like a
 placeholder value for acheckbox.  But I still thinkCheckBoxshouldacceptnull, 
 for the interface to be consistent.

 --
 http://groups.google.com/group/Google-Web-Toolkit-Contributors





 --
 http://groups.google.com/group/Google-Web-Toolkit-Contributors

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors


Re: [gwt-contrib] RR: allow CheckBox to accept null?

2010-08-25 Thread Bruce Johnson
Can you provide a little more context for why it should work this way?

On Tue, Aug 24, 2010 at 6:49 PM, Ray Ryan rj...@google.com wrote:

 When we made the CheckBox widget implement HasValue, we had it throw an
 illegal argument exception when setValue() is called with null.

 I think we goofed.

 Can we get away with relaxing that? I'd like this to be the case:

 CheckBox cb = new CheckBox();
 cb.setValue(null);
 assertNull(cb.getValue());


 rjrjr

  --
 http://groups.google.com/group/Google-Web-Toolkit-Contributors

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Re: [gwt-contrib] RR: allow CheckBox to accept null?

2010-08-25 Thread Ray Ryan
Yeah, thinking about it by the light of day I think it's the wrong
direction.

The use case is dealing with boolean values that may be null, and really a
check box is just the wrong UI there. Withdrawn.

On Wed, Aug 25, 2010 at 7:01 AM, Bruce Johnson br...@google.com wrote:

 Can you provide a little more context for why it should work this way?

 On Tue, Aug 24, 2010 at 6:49 PM, Ray Ryan rj...@google.com wrote:

 When we made the CheckBox widget implement HasValue, we had it throw an
 illegal argument exception when setValue() is called with null.

 I think we goofed.

 Can we get away with relaxing that? I'd like this to be the case:

 CheckBox cb = new CheckBox();
 cb.setValue(null);
 assertNull(cb.getValue());


 rjrjr

  --
 http://groups.google.com/group/Google-Web-Toolkit-Contributors


  --
 http://groups.google.com/group/Google-Web-Toolkit-Contributors

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Re: [gwt-contrib] RR: allow CheckBox to accept null?

2010-08-25 Thread Bruce Johnson
Glad I looked at it funny, then.

Micro-design reviews ftw.

On Wed, Aug 25, 2010 at 12:16 PM, Ray Ryan rj...@google.com wrote:

 Yeah, thinking about it by the light of day I think it's the wrong
 direction.

 The use case is dealing with boolean values that may be null, and really a
 check box is just the wrong UI there. Withdrawn.


 On Wed, Aug 25, 2010 at 7:01 AM, Bruce Johnson br...@google.com wrote:

 Can you provide a little more context for why it should work this way?

 On Tue, Aug 24, 2010 at 6:49 PM, Ray Ryan rj...@google.com wrote:

 When we made the CheckBox widget implement HasValue, we had it throw an
 illegal argument exception when setValue() is called with null.

 I think we goofed.

 Can we get away with relaxing that? I'd like this to be the case:

 CheckBox cb = new CheckBox();
 cb.setValue(null);
 assertNull(cb.getValue());


 rjrjr

  --
 http://groups.google.com/group/Google-Web-Toolkit-Contributors


  --
 http://groups.google.com/group/Google-Web-Toolkit-Contributors


  --
 http://groups.google.com/group/Google-Web-Toolkit-Contributors


-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors