You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@royale.apache.org by Carlos Rovira <ca...@apache.org> on 2018/09/15 17:40:41 UTC
Re: [royale-asjs] branch develop updated: Ensure the list selects the
selectedItem if someone is set by the user at creation time. This fixes
preselection in ComboBox popup list too.
This is related to the question I just post in other thread.
The question is still valid, and depending on responses I should update
this to handle CHANGE event at proper time in selectionChangeHandler
thanks
Carlos
El sáb., 15 sept. 2018 a las 19:38, <ca...@apache.org> escribió:
> This is an automated email from the ASF dual-hosted git repository.
>
> carlosrovira pushed a commit to branch develop
> in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
>
>
> The following commit(s) were added to refs/heads/develop by this push:
> new dbe2af3 Ensure the list selects the selectedItem if someone is
> set by the user at creation time. This fixes preselection in ComboBox popup
> list too.
> dbe2af3 is described below
>
> commit dbe2af3bc46c04d58d18186045556489bb3d90b8
> Author: Carlos Rovira <ca...@apache.org>
> AuthorDate: Sat Sep 15 19:38:37 2018 +0200
>
> Ensure the list selects the selectedItem if someone is set by the user
> at creation time. This fixes preselection in ComboBox popup list too.
> ---
> .../royale/org/apache/royale/jewel/beads/views/ListView.as | 11
> +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git
> a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/ListView.as
> b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/ListView.as
> index c61a12d..b971fb7 100644
> ---
> a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/ListView.as
> +++
> b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/ListView.as
> @@ -94,12 +94,23 @@ package org.apache.royale.jewel.beads.views
> listModel = _strand.getBeadByType(ISelectionModel)
> as ISelectionModel;
> listModel.addEventListener("selectedIndexChanged",
> selectionChangeHandler);
> listModel.addEventListener("rollOverIndexChanged",
> rollOverIndexChangeHandler);
> +
> IEventDispatcher(_strand).addEventListener("itemsCreated",
> itemsCreatedHandler);
>
> super.handleInitComplete(event);
> }
>
> /**
> * @private
> + * Ensure the list selects the selectedItem if someone is
> set by the user at creation time
> + */
> + private function itemsCreatedHandler(event:Event):void
> + {
> + if(listModel.selectedIndex != -1)
> + selectionChangeHandler(null);
> + }
> +
> + /**
> + * @private
> * @royaleignorecoercion
> org.apache.royale.core.ISelectableItemRenderer
> */
> protected function selectionChangeHandler(event:Event):void
>
>
--
Carlos Rovira
http://about.me/carlosrovira