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 3d986f2  tour-de-jewel: example adding dataprovider to togglebuttonbar 
at initcomplete time
3d986f2 is described below

commit 3d986f2e5bef4db25e04be92ae72b5a0d72cc43e
Author: Carlos Rovira <[email protected]>
AuthorDate: Sun Feb 14 20:11:54 2021 +0100

    tour-de-jewel: example adding dataprovider to togglebuttonbar at 
initcomplete time
---
 .../src/main/royale/ButtonBarPlayGround.mxml            | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git 
a/examples/jewel/TourDeJewel/src/main/royale/ButtonBarPlayGround.mxml 
b/examples/jewel/TourDeJewel/src/main/royale/ButtonBarPlayGround.mxml
index 4fc370f..b83eed1 100644
--- a/examples/jewel/TourDeJewel/src/main/royale/ButtonBarPlayGround.mxml
+++ b/examples/jewel/TourDeJewel/src/main/royale/ButtonBarPlayGround.mxml
@@ -21,8 +21,9 @@ limitations under the License.
        xmlns:j="library://ns.apache.org/royale/jewel" 
        xmlns:html="library://ns.apache.org/royale/html" 
        xmlns:js="library://ns.apache.org/royale/basic"
-       xmlns:models="models.*" 
-       xmlns:c="components.*" sourceCodeUrl="ButtonBarPlayGround.mxml">
+       xmlns:models="models.*" xmlns:c="components.*" 
+       sourceCodeUrl="ButtonBarPlayGround.mxml"
+       initComplete="setDataProvider(event)">
 
        <c:beads>
                <js:ContainerDataBinding/>
@@ -159,10 +160,14 @@ limitations under the License.
                                
                                <j:ToggleButtonBar localId="tbb2" 
toggleOnClick="true"
                                        change="tbbChangeHandler(event)"
-                                       emphasis="emphasized" 
rightPosition="true"  iconField="icon"
+                                       emphasis="emphasized" 
rightPosition="true" iconField="icon"
                                        
dataProvider="{listModel.iconButtonData}"/>
                                
+                               <j:ToggleButtonBar localId="tbb3"
+                                       emphasis="secondary" iconField="icon"/>
+                               
                                <j:Label localId="tbb_label"/> 
+                               
                        </j:Card>
                </j:GridCell>
        </j:Grid>
@@ -182,6 +187,12 @@ limitations under the License.
                                        tbb_label.text = "Nothing is selected";
                                }
                        }
+
+                       private var tbb3AL:ArrayList = new ArrayList(["SALE", 
"RENTAL"]);
+
+            protected function setDataProvider(event:Event):void {
+                tbb3.dataProvider = tbb3AL;
+            }
                ]]>
        </fx:Script>
 

Reply via email to