You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@royale.apache.org by GitBox <gi...@apache.org> on 2022/02/21 16:39:16 UTC

[GitHub] [royale-asjs] yishayw opened a new issue #1179: ComboBox - Binding Too Late For selectedItem Display

yishayw opened a new issue #1179:
URL: https://github.com/apache/royale-asjs/issues/1179


   In this app
   
   `<?xml version="1.0" encoding="utf-8"?>
   <mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:js="library://ns.apache.org/royale/basic">
       <fx:Declarations>
       </fx:Declarations>
       <fx:Script>
           <![CDATA[
               public function compute(value:String):String{
                   return value;
               }
           ]]>
       </fx:Script>
       <mx:ComboBox width="250" top="30">
           <mx:dataProvider>
               <fx:Object label="{compute('scp')}" data="scp"/>
               <fx:Object label="{compute('ftp')}" data="ftp"/>
           </mx:dataProvider>
       </mx:ComboBox>
    </mx:Application>`
   
   selected item shows as '[object Object]' instead of 'scp'


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@royale.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [royale-asjs] greg-dove commented on issue #1179: ComboBox - Binding Too Late For selectedItem Display

Posted by GitBox <gi...@apache.org>.
greg-dove commented on issue #1179:
URL: https://github.com/apache/royale-asjs/issues/1179#issuecomment-1047201304


   So at least a simple workaround might be something like:
   ```
   <fx:Declarations>
           <mx:ArrayCollection id="myDP">
               <fx:Object label="{compute('scp')}" data="scp"/>
               <fx:Object label="{compute('ftp')}" data="ftp"/>
           </mx:ArrayCollection>
   </fx:Declarations>
   ```
   
   And :  
   `<mx:ComboBox  width="250" top="30" dataProvider="{myDP}"/>`
   
   I think that would mean that the earlier bindings should run first, before the dataProvider assignment binding, because iirc they are processed (at startup/addedToParent) in the order of their declaration. I realize that this is not a solution to the actual difference in lifecycle, but something like that might be a simple way to work around the issue on occasion. In reality, because there is no event trigger for the label 'bindings', it might be something that is more suited to a labelFunction in this case (it seems that the label display is the same as the 'data' field value), that is, assuming labelFunction emulation currently works correctly on ComboBox.
   
   
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@royale.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [royale-asjs] yishayw commented on issue #1179: ComboBox - Binding Too Late For selectedItem Display

Posted by GitBox <gi...@apache.org>.
yishayw commented on issue #1179:
URL: https://github.com/apache/royale-asjs/issues/1179#issuecomment-1047065118


   In Flex the text for the combo is updated in updateDisplayList() which happens to occur after binding updates the data provider. In Royale however we initialize the text after combo box is added to parent, while the binding operation happens after the binding container is added to parent, which in this case happens later. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@royale.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org