Spectrum Menus are a bit non-standard when it comes to data. It expects an 
IMenuItem. If it’s a plain object, the text is set to the label or text 
property of the object and the rest of the menu properties are inferred as 
well. The original object is *replaced* with a MenuItem if the original is not 
an IMenuItem.

> We are using spectrum based on royale 0.9.8 with this commit id "024b730"
> 
> In other words we are not on version 0.9.9-snapshot?

You can cherry-pick the change.

> On Feb 28, 2022, at 10:44 AM, Roman Isitua <romanisi...@gmail.com> wrote:
> 
> Is there a label property ? That allows us to specify the field in our data 
> object to be used ?
> 
> 
> Also, How can we access this latest change ?
> 
> We are using spectrum based on royale 0.9.8 with this commit id "024b730"
> 
> In other words we are not on version 0.9.9-snapshot?
> 
> 
> 
> 
> 
> On Mon, 28 Feb 2022, 09:38 Harbs, <harbs.li...@gmail.com 
> <mailto:harbs.li...@gmail.com>> wrote:
>> How can I use an arrayList of data objects instead ?
> 
> <sp:ComboBox placeholder="Type here" quiet=“true” 
> dataProvider=“{myArrayListProvider}"/>
> 
>> The spectrum combobox also doesn't have a change attribute. How do you 
>> execute an event on selecting from the list.
> 
> It looks like we forgot to add Event metadata for that.
> Fixed. 
> https://github.com/unhurdle/spectrum-royale/commit/a53c16b59cc2b352adffbb570067e9fddcb9ec46
>  
> <https://github.com/unhurdle/spectrum-royale/commit/a53c16b59cc2b352adffbb570067e9fddcb9ec46>
>> On Feb 27, 2022, at 2:48 AM, Timothy Tokmang Wang <timoshimm...@gmail.com 
>> <mailto:timoshimm...@gmail.com>> wrote:
>> 
>> The spectrum combobox also doesn't have a change attribute. How do you 
>> execute an event on selecting from the list.
>> 
>> On Sun, Feb 27, 2022 at 12:28 AM Roman Isitua <romanisi...@gmail.com 
>> <mailto:romanisi...@gmail.com>> wrote:
>> How can I populate a spectrum combo box dynamically ? I intend to use an 
>> array list of data objects ? 
>> 
>> For spectrum List (sp:List) the following can be used
>> 
>> <sp:List id="navLinks" className="home_side_nav" labelField="description" 
>>       dataProvider="{newMenuItemList}" change="onSelectMenu(event)">
>>        <sp:beads>         
>>            <js:DataItemRendererFactoryForArrayList/>
>>            <js:EasyDataProviderChangeNotifier/> 
>>            <js:DynamicRemoveAllItemRendererForArrayListData/>
>>         </sp:beads>
>>       </sp:List>
>> 
>> 
>> From the royale spectrum show case the code snippet was used.
>> 
>> <sp:ComboBox placeholder="Type here" quiet="true">
>>   <sp:dataProvider>
>>   <fx:Array>
>>     <sp:MenuItem text="Ballard"/>
>>     <sp:MenuItem text="Freemont"/>
>>     <sp:MenuItem text="Greenwood"/>
>>     <sp:MenuItem isDivider="true"/>
>>     <sp:MenuItem text="United States of America" disabled="true"/>
>>   </fx:Array>
>>   </sp:dataProvider>
>> </sp:ComboBox>
>> 
>> 
>> In the above example a static fx array was used. How can I use an arrayList 
>> of data objects instead ?
>> 
>> 
>> 
>> On Wed, Jan 12, 2022 at 5:21 PM Roman Isitua <romanisi...@gmail.com 
>> <mailto:romanisi...@gmail.com>> wrote:
>> Understood. Thanks.
>> 
>> On Wed, Jan 12, 2022 at 5:14 PM Harbs <harbs.li...@gmail.com 
>> <mailto:harbs.li...@gmail.com>> wrote:
>> 
>> 
>>> On Jan 12, 2022, at 6:08 PM, Roman Isitua <romanisi...@gmail.com 
>>> <mailto:romanisi...@gmail.com>> wrote:
>>> 
>>> What is the purpose of  <js:ArrayListSelectionModel />   ?  since it was no 
>>> longer necessary 
>> 
>> It’s necessary in Royale Basic to use ArrayLists.
>> 
>> In Spectrum, there’s a default ListModel which correctly handles both both 
>> Array and ArrayList data.
>> 
>>> 
>>> Also, another question
>>> which will you recommend one uses ? why should one choose Array over 
>>> ArrayList or ArrayList over Array.
>> 
>> Array is simpler. There’s less overhead. If you have data which doesn’t 
>> change, use Array.
>> If you need the list to update when data changes, use ArrayList.
> 

Reply via email to