[OpenAjaxIDE] Multiselect properties - must have datatype of array

Aaron Reed aaronr at us.ibm.com
Tue Aug 12 12:28:00 PDT 2008


I don't have a problem with your proposal other than it leaves the additive
capability completely out.  It would be up to the WG to decide if there is
any value to providing an additive capability or if the only possible
processing would be building an array or OR'ing numeric values.

--Aaron
IBM Corporation
Internal Zip: 9022D016
11501 Burnet Road
Austin, TX 78758
(512)838-9948
inet: aaronr at us.ibm.com
  _
 (} @
 |=     Volleyball Rules!!!
/\




                                                                           
             Jon                                                           
             Ferraiolo/Menlo                                               
             Park/IBM at IBMUS                                             To 
             Sent by:                  ide at openajax.org                    
             ide-bounces at opena                                          cc 
             jax.org                                                       
                                                                   Subject 
                                       Re: [OpenAjaxIDE] Multiselect       
             08/12/2008 01:37          properties - must have datatype  of 
             PM                        array                               
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           




I should point out that Aaron proposed something similar several emails
back:

* http://openajax.org/pipermail/ide/2008q3/000606.html


Inactive hide details for Jon Ferraiolo/Menlo Park/IBM at IBMUSJon
Ferraiolo/Menlo Park/IBM at IBMUS

                                                                           
                         Jon                                               
                         Ferraiolo/M                                       
                         enlo                                              
                         Park/IBM at IB                                       
                         MUS                                            To 
                         Sent by:                                          
                         ide-bounces          ide at openajax.org             
                         @openajax.o                                       
                         rg                                             cc 
                                                                           
                                                                           
                         08/12/2008                                Subject 
                         11:18 AM                                          
                                              Re: [OpenAjaxIDE]            
                                              Multiselect properties -     
                                              must have datatype of array  
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           



I believe we should not ignore MS's requirements, and therefore I am in
favor of finding a way to provide for bitfields. I don't like the
@operator. That just seems too much. Here is a simpler proposal:

* If multiple="true", then 'datatype' must be either Array or a Number
* If multiple="true" and datatype="Number", then the option values must be
positive integers (usually, powers of 2), and the ultimate value of the
property consists of an integer that holds the result of OR'ing together
the values for all selected options

Jon

Inactive hide details for Aaron Reed/Austin/IBMAaron Reed/Austin/IBM
                                                                           
          Aaron Reed/Austin/IBM                                            
                                                                           
                                                                           
          08/11/2008 03:55 PM                                              
                                                                        To 
                                                                           
                                                Jon Ferraiolo/Menlo        
                                                Park/IBM at IBMUS             
                                                                           
                                                                        cc 
                                                                           
                                                ide at openajax.org           
                                                                           
                                                                   Subject 
                                                                           
                                                Fw: [OpenAjaxIDE]          
                                                Multiselect properties -   
                                                must have datatype of      
                                                array                      
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           


Dojo introduced a multi-select, it is in 1.1.1. But it is little more than
a wrapper for the HTML control. And it really isn't just a SELECT element,
a multiply selectable list could also be represented by a group of
checkboxes which is reasonably common on the web, too. Now, finding an
example of an UNCONSTRAINED multiply selectable control on almost any
platform is quite difficult. That might be a combination that implementors
would punt on.


Not that I really have much stake in the game or anything, but I would
argue that if there is any value at all to having a datatype of Array or
[], then I think that the spec probably needs to allow the user a way to
actually generate the data for that array.

--Aaron
IBM Corporation
Internal Zip: 9022D016
11501 Burnet Road
Austin, TX 78758
(512)838-9948
inet: aaronr at us.ibm.com
_
(} @
|= Volleyball Rules!!!
/\


Inactive hide details for Jon Ferraiolo/Menlo Park/IBM at IBMUSJon
Ferraiolo/Menlo Park/IBM at IBMUS
                                                                           
      Jon Ferraiolo/Menlo Park/IBM at IBMUS                                   
      Sent by: ide-bounces at openajax.org                                    
                                                                           
                                                                           
      08/11/2008 05:31 PM                                               To 
                                                                           
                                                    ide <ide at openajax.org" 
                                                    <ide at openajax.org>">   
                                                                           
                                                                        cc 
                                                                           
                                                                           
                                                                   Subject 
                                                                           
                                                    Re: [OpenAjaxIDE]      
                                                    Multiselect properties 
                                                    - must have datatype   
                                                    of array               
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           



After thinking about this one some more and doing some research, we need to
ask ourselves whether it makes sense to drop the 'multiple' attribute on
the <options> element. Yes, HTML's SELECT element allows multiple
selections, but none of the following systems offers the feature:
Dojo/Dijit, YUI, ExtJS, Spry, and the EnumValues feature in Google Gadgets,
Unless my research is wrong, it looks as if the lack of multi-select hasn't
harmed these other major UI systems. If we drop 'multiple' and someone
needs multi-select for a property, then among their alternatives would be
to find a clever way to use the other features (e.g., represent your
multi-select as a series of boolean properties) and/or create a custom
property editor.

Jon


Inactive hide details for Wayne Vicknair/Austin/IBMWayne
Vicknair/Austin/IBM
                                                                           
                                           Wayne                           
                                           Vicknair/Aus                    
                                           tin/IBM                         
                                                                           
                                                                        To 
                                           08/07/2008                      
                                           12:16 PM            Bertrand Le 
                                                               Roy         
                                                               <Bertrand.L 
                                                               e.Roy at micro 
                                                               soft.com>   
                                                                           
                                                                        cc 
                                                                           
                                                               "ide at openaj 
                                                               ax.org"     
                                                               <ide at openaj 
                                                               ax.org>,    
                                                               "ide-bounce 
                                                               s at openajax. 
                                                               org"        
                                                               <ide-bounce 
                                                               s at openajax. 
                                                               org>, Jon   
                                                               Ferraiolo/M 
                                                               enlo        
                                                               Park/IBM at IB 
                                                               MUS         
                                                                           
                                                                   Subject 
                                                                           
                                                               RE:         
                                                               [OpenAjaxID 
                                                               E]          
                                                               Multiselect 
                                                               properties  
                                                               - must have 
                                                               datatype of 
                                                               arrayJon    
                                                               Ferraiolo   
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           

OK. I get it. I think we need a new tag to describe "flags". The enums plus
bitwise operations are definitely a useful idiom to model. It seems like
we're trying to get too much out of <options> which was intended to model
HTML <select> behavior.

BTW, the values I described are already in metadata in our widget property
test cases.


Cheers,
Wayne
Wayne E. Vicknair
Consulting Product Design Professional
IBM SWG Emerging Internet Technologies
Office: 512.838.0707 Email: waynev at us.ibm.com


Inactive hide details for Bertrand Le Roy ---08/07/2008 01:22:30
PM---That's not the same thing. In both of the cases you descrBertrand Le
Roy ---08/07/2008 01:22:30 PM---That's not the same thing. In both of the
cases you describe, the valid values are determined by the application
developer, not
                                                                           
                                           Bertrand Le                     
                                           Roy                             
                                           <Bertrand.Le                    
                                           .Roy at microso                    
                                           ft.com>                      To 
                                                                           
                                                               Wayne       
                                           08/07/08            Vicknair/Au 
                                           01:21 PM            stin/IBM at IB 
                                                               MUS         
                                                                           
                                                                        cc 
                                                                           
                                                               "ide at openaj 
                                                               ax.org"     
                                                               <ide at openaj 
                                                               ax.org>,    
                                                               "ide-bounce 
                                                               s at openajax. 
                                                               org"        
                                                               <ide-bounce 
                                                               s at openajax. 
                                                               org>, Jon   
                                                               Ferraiolo/M 
                                                               enlo        
                                                               Park/IBM at IB 
                                                               MUS         
                                                                           
                                                                   Subject 
                                                                           
                                                               RE:         
                                                               [OpenAjaxID 
                                                               E]          
                                                               Multiselect 
                                                               properties  
                                                               - must have 
                                                               datatype of 
                                                               array       
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           


That's not the same thing. In both of the cases you describe, the valid
values are determined by the application developer, not by the framework
developer. The values for what you describe will *never* end up in the
metadata.

-----Original Message-----
From: Wayne Vicknair [mailto:waynev at us.ibm.com.]
Sent: Thursday, August 07, 2008 7:57 AM
To: Bertrand Le Roy
Cc: ide at openajax.org; ide-bounces at openajax.org; Jon Ferraiolo
Subject: Re: [OpenAjaxIDE] Multiselect properties - must have datatype of
array

I believe that the <options> and <option> element combination do indeed
express a constrained, multiple-value parameter.  HTML DOM and Dojo's
dijit.form.MultiSelect both happen to implement that concept with an,
admittedly inefficient, array return value. That implementation does not
diminish the expressiveness of the <options> construct. An implementation
could choose to iterate over the array values converting them to numbers
and bitwise  or-ing them together.

Cheers,
(Embedded image moved to file: pic29320.gif)Wayne Wayne E. Vicknair
Consulting Product Design Professional IBM SWG Emerging Internet
Technologies
Office: 512.838.0707 Email: waynev at us.ibm.com




          Bertrand Le Roy
          <Bertrand.Le.Roy@
          microsoft.com>                                             To
          Sent by:                  Jon Ferraiolo/Menlo Park/IBM at IBMUS
          ide-bounces at opena                                          cc
          jax.org                   "ide at openajax.org"
                                    <ide at openajax.org>
                                                                Subject
          08/06/08 07:50 PM         Re: [OpenAjaxIDE] Multiselect
                                    properties - must have datatype of
                                    array










Same thing that happens in C. Never been a problem as you rarely have the
many flag values. Storing a list of countries or states would be more
efficiently stored in more elaborate data structures. The use we have of
flags is typically stuff like read/write/readwrite or left, right, top,
bottom and combinations. You get the idea. Bit structures are way more
efficient for this type of situation.
Sure, HTML options are different but I’m not sure I see your point.
Anyway, that’s the design we have in our APIs and it would be nice if it
was possible to express it.

From: Jon Ferraiolo [㓤mailto:jferrai at us.ibm.com.]
Sent: Wednesday, August 06, 2008 5:32 PM
To: Bertrand Le Roy
Cc: ide at openajax.org
Subject: RE: [OpenAjaxIDE] Multiselect properties - must have datatype of
array



What happens if you are doing multi-select with more than (4bytes) 32
alternatives (e.g., # states in US) or more than (8bytes) 64 alternatives
(e.g., # countries in the world)?

HTML's OPTION element doesn't require the use of bit flags (i.e., values
which are powers of 2), and that's what our <option> element will be mapped
into for a large number of cases.


(Embedded image moved to file: pic32049.gif)Inactive hide details for
Bertrand Le Roy <Bertrand.Le.Roy at microsoft.com>Bertrand Le Roy
<Bertrand.Le.Roy at microsoft.com>


Options are for enums, right? If so, that is completely different from our
usage. Multiple value enums (or flags) have integer values (like in C) and
are combined through the | or operator. Testing for a specific value is
done with the & and operator.
So for example, you’d have:
<property name="FavoriteAnimals">
__<options multiple="true">
____<option value="1"><label locid="animal_panda">Panda</label></option>
____<option value="2"><label locid="animal_tiger">Tiger</label></option>
____<option value="4"><label locid="animal_cat">House cat</label></option>
____<option value="8"><label locid="animal_dog">Man's best
friend</label></option> __</options> </property>

And if the user picks Tiger and House Cat, that gives 6.

From: ide-bounces at openajax.org [mailto:ide-bounces at openajax.org.] On Behalf
Of Jon Ferraiolo
Sent: Wednesday, August 06, 2008 10:14 AM
To: ide at openajax.org
Subject: [OpenAjaxIDE] Multiselect properties - must have datatype of array


Aaron Reed of IBM is implementing the <property><options multiple="true">
feature in the open source reference implementation and the question can up
about how to represent the multiple choices when the property value is
persisted into the property storage area. Here is an example:

<property name="FavoriteAnimals">
__<options multiple="true">
____<option value="panda"><label
locid="animal_panda">Panda</label></option>
____<option value="tiger"><label
locid="animal_tiger">Tiger</label></option>
____<option value="cat"><label locid="animal_cat">House
cat</label></option> ____<option value="dog"><label
locid="animal_dog">Man's best friend</label></option> __</options>
</property>

Let's suppose the user picked "Tiger" and "House cat".

Given that we are focused on JavaScript, our proposal is that the natural
way to store a multi-select option would be as a JavaScript array. In this
case, the array would be ["tiger","cat"].

Does this make sense to people?

If so, then should we change the spec to say that if a <property> uses
<options> with multiple="true", then the <property> element must have
datatype="[]".

A follow on question is whether we should require an array of Strings, or
is it OK to have an array of anything, such as Number? Is the array could
contain things other than String, then implementations would need to a
string-to-whatever conversion at some point (e.g., string-to-number). I
would thing that array-of-Strings is the way to go.

Jon _______________________________________________
IDE mailing list
IDE at openajax.org
http://openajax.org/mailman/listinfo/ide



_______________________________________________
IDE mailing list
IDE at openajax.org
http://openajax.org/mailman/listinfo/ide


_______________________________________________
IDE mailing list
IDE at openajax.org
http://openajax.org/mailman/listinfo/ide
_______________________________________________
IDE mailing list
IDE at openajax.org
http://openajax.org/mailman/listinfo/ide
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://openajax.org/pipermail/ide/attachments/20080812/a19a68d4/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graycol.gif
Type: image/gif
Size: 105 bytes
Desc: not available
Url : http://openajax.org/pipermail/ide/attachments/20080812/a19a68d4/attachment-0007.gif 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pic15625.gif
Type: image/gif
Size: 1255 bytes
Desc: not available
Url : http://openajax.org/pipermail/ide/attachments/20080812/a19a68d4/attachment-0008.gif 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ecblank.gif
Type: image/gif
Size: 45 bytes
Desc: not available
Url : http://openajax.org/pipermail/ide/attachments/20080812/a19a68d4/attachment-0009.gif 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 23921343.gif
Type: image/gif
Size: 149 bytes
Desc: not available
Url : http://openajax.org/pipermail/ide/attachments/20080812/a19a68d4/attachment-0010.gif 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 23786566.gif
Type: image/gif
Size: 2342 bytes
Desc: not available
Url : http://openajax.org/pipermail/ide/attachments/20080812/a19a68d4/attachment-0011.gif 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 23989250.gif
Type: image/gif
Size: 960 bytes
Desc: not available
Url : http://openajax.org/pipermail/ide/attachments/20080812/a19a68d4/attachment-0012.gif 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 23576776.gif
Type: image/gif
Size: 1255 bytes
Desc: not available
Url : http://openajax.org/pipermail/ide/attachments/20080812/a19a68d4/attachment-0013.gif 


More information about the IDE mailing list