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 2020/02/24 11:28:02 UTC

[GitHub] [royale-asjs] javeiga-iest commented on issue #730: Jewel TabBar

javeiga-iest commented on issue #730: Jewel TabBar
URL: https://github.com/apache/royale-asjs/issues/730#issuecomment-590277151
 
 
   You are right @piotrzarzycki21 @carlosrovira , I rethink the incidence ...
   In effect, the Binding works correctly, what happens is that when making a change of provider, “SelectionChangedChange” event is triggered, and an attempt is made to access the SelectedItem property (being null):
   
   _AssignTabContent.js_
   ![image](https://user-images.githubusercontent.com/55754204/75148841-e31a7580-5700-11ea-84e0-5e9b6c24c2c9.png)
   
   
   **Code:**
   ```
   <?xml version="1.0" encoding="utf-8"?>
   <j:ScrollableSectionContent xmlns:fx="http://ns.adobe.com/mxml/2009"
       xmlns:j="library://ns.apache.org/royale/jewel"
       xmlns:js="library://ns.apache.org/royale/basic"
   	xmlns:html="library://ns.apache.org/royale/html" 
       >
   
        <fx:Script>
           <![CDATA[
               import org.apache.royale.collections.ArrayList;
               
               [Bindable]
               public var tabBarDataSample:ArrayList = new ArrayList([
                           {label:"A - Nº Clicks: " + tmp, content:"content1"},
                           {label:"B - Nº Clicks: " + tmp, content:"content2"}
                       ]);      
   
               private var tmp:int = 0;
               private function updateTabBarData():void{
                       tmp++;
                       tabBarDataSample = new ArrayList([
                           {label:"A - Nº Clicks: " + tmp, content:"content1"},
                           {label:"B - Nº Clicks: " + tmp, content:"content2"}
                       ]);      
               }
   
           ]]>
        </fx:Script>
    
       <j:beads>
           <js:ContainerDataBinding/>
       </j:beads>
   
        <j:VGroup itemsVerticalAlign="itemsCentered" percentHeight="100">
           <j:Button text="UPDATE TABBAR DATAPROVIDER" click="updateTabBarData()"/>
           <j:TabBar localId="tabBar" dataProvider="{tabBarDataSample}">
               <j:beads>
                   <j:AssignTabContent localId="tabContent" selectedContentProperty="content">
                       <j:content>
                           <j:TabBarContent height="100%" style="width: -webkit-fill-available; margin-left:20px; margin-right:20px; margin-bottom:20px; flex: 0 1 auto;">
                               <j:SectionContent name="content1">
                                   <j:Card height="100%">                            
                                       <j:CardPrimaryContent itemsHorizontalAlign="itemsCentered">
                                           <html:H3 text="content1"/>  
                                       </j:CardPrimaryContent>
                                   </j:Card>
                               </j:SectionContent>
                               <j:SectionContent name="content2">
                                   <j:Card itemsExpand="true" height="100%">                            
                                       <j:CardPrimaryContent itemsHorizontalAlign="itemsCentered">
                                           <html:H3 text="content2"/>                                    
                                       </j:CardPrimaryContent>
                                   </j:Card>
                               </j:SectionContent>
                           </j:TabBarContent>
                       </j:content>
                   </j:AssignTabContent>
               </j:beads>
           </j:TabBar>
       </j:VGroup>
       
   </j:ScrollableSectionContent>
   ```
   
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services