[OpenAjaxIDE] Multiselect properties - must have datatype of array

Bertrand Le Roy Bertrand.Le.Roy at microsoft.com
Wed Aug 6 17:52:32 PDT 2008


If we don’t, there’s a whole category of properties from Microsoft  Ajax that you won’t be able to edit in an IDE efficiently.
Is there an example of the array style being used in an existing Ajax library?

From: ide-bounces at openajax.org [mailto:ide-bounces at openajax.org] On Behalf Of Jon Ferraiolo
Sent: Wednesday, August 06, 2008 5:45 PM
To: Kin Blas
Cc: ide at openajax.org
Subject: Re: [OpenAjaxIDE] Multiselect properties - must have datatype of array


Do we really have to support bitfields?


[cid:image001.gif at 01C8F7ED.3397B7F0]"Kin Blas" <jblas at adobe.com>


Perhaps we need an “output format” attribute?

output=”[string]” in Jon’s case and output=”bitfieldOr” in Bertrand’s case. These would result in [“panda”, “tiger”] for John’s case and 1|2 in Bertrand’s case?

--== Kin ==--

________________________________
From: ide-bounces at openajax.org [mailto:ide-bounces at openajax.org] On Behalf Of Bertrand Le Roy
Sent: Wednesday, August 06, 2008 4:15 PM
To: Jon Ferraiolo; ide at openajax.org
Subject: Re: [OpenAjaxIDE] Multiselect properties - must have datatype of array

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://openajax.org/pipermail/ide/attachments/20080806/a3c5d31b/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.gif
Type: image/gif
Size: 105 bytes
Desc: image001.gif
Url : http://openajax.org/pipermail/ide/attachments/20080806/a3c5d31b/attachment.gif 


More information about the IDE mailing list