You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@royale.apache.org by Roman Isitua <ro...@gmail.com> on 2022/02/26 23:28:38 UTC
Re: Spectrum UI components
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 <ro...@gmail.com> wrote:
> Understood. Thanks.
>
> On Wed, Jan 12, 2022 at 5:14 PM Harbs <ha...@gmail.com> wrote:
>
>>
>>
>> On Jan 12, 2022, at 6:08 PM, Roman Isitua <ro...@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.
>>
>
Re: Spectrum UI components
Posted by Roman Isitua <ro...@gmail.com>.
So that I am clear about what you said. By cherry pick you mean take what
you just did on the royale spectrum source and apply it locally (on my pc)
on the spectrum 0.9.8 source ?
In other words what do you mean by cherry pick ?
On Mon, 28 Feb 2022, 10:14 Harbs, <ha...@gmail.com> wrote:
> 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 <ro...@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, <ha...@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
>>
>> On Feb 27, 2022, at 2:48 AM, Timothy Tokmang Wang <ti...@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 <ro...@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 <ro...@gmail.com>
>>> wrote:
>>>
>>>> Understood. Thanks.
>>>>
>>>> On Wed, Jan 12, 2022 at 5:14 PM Harbs <ha...@gmail.com> wrote:
>>>>
>>>>>
>>>>>
>>>>> On Jan 12, 2022, at 6:08 PM, Roman Isitua <ro...@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.
>>>>>
>>>>
>>
>
Re: Spectrum UI components
Posted by Harbs <ha...@gmail.com>.
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 <ro...@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.lists@gmail.com <ma...@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 <timoshimmo88@gmail.com <ma...@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 <romanisitua@gmail.com <ma...@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 <romanisitua@gmail.com <ma...@gmail.com>> wrote:
>> Understood. Thanks.
>>
>> On Wed, Jan 12, 2022 at 5:14 PM Harbs <harbs.lists@gmail.com <ma...@gmail.com>> wrote:
>>
>>
>>> On Jan 12, 2022, at 6:08 PM, Roman Isitua <romanisitua@gmail.com <ma...@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.
>
Re: Spectrum UI components
Posted by Roman Isitua <ro...@gmail.com>.
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, <ha...@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
>
> On Feb 27, 2022, at 2:48 AM, Timothy Tokmang Wang <ti...@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 <ro...@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 <ro...@gmail.com>
>> wrote:
>>
>>> Understood. Thanks.
>>>
>>> On Wed, Jan 12, 2022 at 5:14 PM Harbs <ha...@gmail.com> wrote:
>>>
>>>>
>>>>
>>>> On Jan 12, 2022, at 6:08 PM, Roman Isitua <ro...@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.
>>>>
>>>
>
Re: Spectrum UI components
Posted by Harbs <ha...@gmail.com>.
> 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
> On Feb 27, 2022, at 2:48 AM, Timothy Tokmang Wang <ti...@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 <romanisitua@gmail.com <ma...@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 <romanisitua@gmail.com <ma...@gmail.com>> wrote:
> Understood. Thanks.
>
> On Wed, Jan 12, 2022 at 5:14 PM Harbs <harbs.lists@gmail.com <ma...@gmail.com>> wrote:
>
>
>> On Jan 12, 2022, at 6:08 PM, Roman Isitua <romanisitua@gmail.com <ma...@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.
Re: Spectrum UI components
Posted by Timothy Tokmang Wang <ti...@gmail.com>.
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 <ro...@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 <ro...@gmail.com>
> wrote:
>
>> Understood. Thanks.
>>
>> On Wed, Jan 12, 2022 at 5:14 PM Harbs <ha...@gmail.com> wrote:
>>
>>>
>>>
>>> On Jan 12, 2022, at 6:08 PM, Roman Isitua <ro...@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.
>>>
>>