View Stack in a FlowBox

Hello,
I have a application with one Grid that is displayed when the application starts. With a additional button I add 2 other Grids. This works with a ViewStack around the 2 optional Grids. The 3 Grids are horizontal. Now when I minimize the application I want the Grids change to vertical. I found the flexlib library with the "FlowBox" class. My question is now: How can I add the 2 Grids inside the ViewStack to the FlowBox so they change to vertical one by one, depending on how much I minimize the window.
thank you.

Hi David,
Thanks for the suggestion.
However, this may not work for me.
I just explained only one piece of the requirement.
I need to give user an option to select a report view based on two dimensions.
ie. report by product&report by geography adn each view should contain a column selector for selecting measure from a drop down box.
hence i created two compound lay outs each with a pivot table and a column selector.
And showed these two compound lay outs in a view selector and this View selector in a separate compound lay out.
Now the requirement is, user should have an option to select a chart view or table view with in report by product&report by geography .
Hence I need to find out to include view selector in a view selector.
Thanks
~Vijay

Similar Messages

  • Why do I need to declare "defaultButton" ? (In a component form part of view stack)

    After doing some research and some help from FlexGuy in another thread, I realize that I need to make sure I have custom components initialized before accessing parts of the component.  Just recently I was thrown for a long time when I tried to first click on a form field that was part of a component in my view stack, I'd get:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at mx.managers::FocusManager/focusInHandler()[C:\autobuild\galaga\frameworks\projects\framew ork\src\mx\managers\FocusManager.as:601]
    With the debugger it's occuring in the focusInHandler method of FocusManager.as: (apparently _defaultButton is null.)
    // restore the default button to be the original one
                    if (defButton && defButton != _defaultButton)
                        defButton.emphasized = false;
                        defButton = _defaultButton;
                       _defaultButton.emphasized = true;
    This prompted me, on a whim, to delcare a defaultButton:
    <mx:Form id="empForm" defaultButton="{submitButton}">
    which refers to my submit button:
    <mx:Button id="submitButton" click="submitEmployee()" label="{submitLabel}"/>
    My question, is why is this necessary? In some examples I don't see this declared at all, but I seem to need it? (I'm calling creationPolicy="all" to make sure my components are initialized but I still seem to have to this defaultButton declared?)

    It's a way of proving that you are able to purchase content from that country's store i.e. that you have a valid billing address in it
    From Why can’t I select None when I edit my Apple ID payment information? - Apple Support :
    If you changed your country or region
    When you change the country or region of an existing Apple ID, you must provide a payment method and update your billing options. If you want to remove your payment method after you change the country or region, you can change your payment information to None.

  • Setting selectedIndex on view stack after removal

    I'm having an issue where when I remove an element from a ViewStack its not selecting the previous item in the list. It keeps snapping back to index 0.
    here's some simple code:
    <?xml version="1.0" encoding="utf-8"?>
    <s:WindowedApplication
              xmlns:fx="http://ns.adobe.com/mxml/2009"
              xmlns:s="library://ns.adobe.com/flex/spark"
              xmlns:mx="library://ns.adobe.com/flex/mx"
              creationComplete="onCreationComplete();"
    >
              <fx:Script>
                        <![CDATA[
                                  import spark.components.Label;
                                  import spark.components.NavigatorContent;
                                  private function onCreationComplete():void {
                                            for (var i:int = 0; i < 10; i++) {
                                                      addNew();
                                  private function removeCurrent():void {
                                            var child:NavigatorContent = layouts.selectedChild as NavigatorContent;
                                            if (child) {
                                                      layouts.removeChild(child);
                                  private function addNew():void {
                                            var title:String = "item " + layouts.length;
                                            var content:NavigatorContent = new NavigatorContent();
                                            content.label = title;
                                            var label:Label = new Label();
                                            label.text = title;
                                            content.addElement(label);
                                            layouts.addElement(content);
                        ]]>
              </fx:Script>
              <s:layout>
            <s:VerticalLayout/>
        </s:layout>
        <!-- Drop down list to show the view stack, uses double data binding -->
              <s:DropDownList id="dropDown" width="200" labelField="label" dataProvider="{layouts}" selectedIndex="@{layouts.selectedIndex}" />
              <!-- TabBar to show the view stack, uses single data binding -->
              <s:TabBar id="tabBar" width="100%" dataProvider="{layouts}" />
              <!-- Content view stack -->
              <mx:ViewStack id="layouts">
              </mx:ViewStack>
              <!-- Buttons to test -->
              <s:Button label="remove" click="removeCurrent();"/>
              <s:Button label="add" click="addNew();" />
    </s:WindowedApplication>
    when you remove the current item, the stack selects item 0. I cannot seem to override this. I want the view stack to select the previous item in the list

    Using SuperTabBar from the flexlib solves this issue. http://flexlib.googlecode.com/svn/trunk/examples/SuperTabNavigator_Sample.swf
    when you delete a tab, the bar selects the next one in line. Am I wrong in expecting this functionality out of the box in the spark componenet library?

  • Hbox in view stack does not update width

    Hi there,   I'm working on flash builder and I have four hboxes nested inside a view stack. I dynamically populate each hbox with images grabbed from the database. For some reason only the visible hbox correctly updates its' width while the other 3 hbox takes on the width of this one so I end up with all four hbox having the same width. This is a problem when I have lots of images in one than the other and some of them gets cut off.
    The hboxes do not have scroll bars as the viewstack has a mouse easing scroller function attached to it - the hbox scrolls according to the position of the mouse.
    Am I doing something wrong here?
    <mx:Canvas height="110"
                       width="663"
                       visible.loginState = "false"
                       x="10"
                       y="577" horizontalScrollPolicy="off" verticalScrollPolicy="off" id="viewStackContainer">
                <mx:ViewStack id="myViewStack" creationPolicy="all"
                              borderStyle="none">
                    <!-- Books Library -->
                    <mx:HBox horizontalAlign="left" verticalScrollPolicy="off" horizontalScrollPolicy="off" verticalAlign="middle" horizontalGap="0" id="books" />
                    <!-- EBooks Library -->
                    <mx:HBox horizontalAlign="left" verticalScrollPolicy="off" horizontalScrollPolicy="off" verticalAlign="middle" horizontalGap="0" id="ebooks" />
                    <!-- Recordings Library -->
                    <mx:HBox horizontalAlign="left" verticalScrollPolicy="off" horizontalScrollPolicy="off" verticalAlign="middle" horizontalGap="0" id="recordings" />
                    <!-- Readings Library -->
                    <mx:HBox horizontalAlign="left" verticalScrollPolicy="off" horizontalScrollPolicy="off" verticalAlign="middle" horizontalGap="0" id="readings" />
                </mx:ViewStack>
            </mx:Canvas>

    Hi thanks for your reply. As the hbox gets populated i need it to resize itself. Once each hbox has been populated with the images I attach a function to the viewstack which allows me to scroll the hbox with mouse position - so it scrolls horizontally depending on where the mouse is in relation to the viewstack. So as you can see I need by this point for each hbox to have resized in order to correctly calculate my scrolling function.  The bizarre thing is the selected Index hbox displays all the images but the rest of the hboxes takes on the same width as this one and this is a problem because some of my other hbox contains more images.  As a test I set the selected Index of the viewStack to be the third Hbox, then I restarted the application and now all the hbox takes on the wdith of this one.   I am creating a library of thumbnails which is dynamically driven. It's not possible for me to predetermine the width of each. Do you have any suggestions for this?

  • Show a custom component on button click in a view stack`

    Hello folks
    I have a view stack in which i have some custom components.
    Now there is one custom component in which there is one button. On the button click, i want to show another custom component but i dont know how to do it. Should i write the inline mxml click event in custom component?? If yes then how??
    Currently i am doing it as
    click="{customcomponent}"

    As you know, ViewStack  has containers, lilke VBox for its views.
    Assuming one of your views VBox has an id of myVBox, and that VBox has the Button that when clicked will display the component, just have the component in the view already, but you can make it invisible with visible=false and includeInLayout=false, and then upon button click set those two variables to true.
    You will probably want a show handler for the view VBox to make those properties false each time that view is displayed.
    Here is some simple sample code.
    If this post answers your question or helps, please mark it as such.
    ---------- MySimpleComponent.mxml ----------
    <?xml version="1.0" encoding="utf-8"?>
    <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml"
      width="100%" height="100%" horizontalAlign="center">
      <mx:Label text="My Custom Component"/>
    </mx:VBox>
    ---------- MainApp.mxml  ----------
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
      xmlns:comp="*" horizontalAlign="center" verticalAlign="middle">
      <mx:Script>
        <![CDATA[
        ]]>
      </mx:Script>
      <mx:LinkBar dataProvider="{vs}"/>
      <mx:ViewStack id="vs" width="100%" height="100%">
        <mx:VBox label="view1" width="100%" height="100%"
          horizontalAlign="center">
          <mx:Label text="View One"/>
        </mx:VBox>
        <mx:VBox label="view2"  width="100%" height="100%"
          show="myComp.visible=false;myComp.includeInLayout=true;"
          horizontalAlign="center">
          <mx:Label text="View Two"/>
          <mx:Button label="Make myComp Visible" click="myComp.visible=true;myComp.includeInLayout=true;"/>
          <comp:MySimpleComponent id="myComp" visible="false" includeInLayout="false"/>
        </mx:VBox>
      </mx:ViewStack>
    </mx:Application>

  • View stack call

    Lets say i have a component with the name "Accounts" in this
    component it has a view stack named "stkView". How do i reference
    the "stkView" in the main application?

    Usually you just chain the ids to the ViewStack.
    So if the component instance is created in AS:
    private var acct:Accounts = new Accounts();
    private function init():void{
    acct.stkView.selectedChild = "cont2";
    }

  • Flex 4 custom component with children inserted directly into view stack

    I give up. Hopefully I am just missing something easy, but I feel like I am pulling teeth trying to get this to work. All I want is a custom 'wizard' component whose children are placed within a ViewStack and beneath the ViewStack there is a next and back button. Here are some code excerpts to illustrate my approach:
    WizardGroup.as:
    [SkinPart(required="true")]
    public var nextBt:Button = new Button();
    [SkinPart(required="true")]
    public var backBt:Button = new Button();
    [SkinPart(required="true")]
    public var stack:ViewStackSpark = new ViewStackSpark();
    WizardGroupSkin.mxml:
    <s:VGroup width="100%" height="100%"
              paddingBottom="10" paddingTop="10" paddingLeft="10" paddingRight="10">
         <container:ViewStackSpark id="stack" width="100%" height="100%">
              <s:Group id="contentGroup" width="100%" height="100%" minWidth="0" minHeight="0"/>
         </container:ViewStackSpark>
         <s:HGroup horizontalAlign="right" width="100%">
              <s:Button id="nextBt" label="Next" enabled="{hostComponent.permitNext}" enabled.last="false"/>
              <s:Button id="backBt" label="Back" enabled="{hostComponent.permitBack}" enabled.first="false"/>
         </s:HGroup>
    </s:VGroup>
    While this comes very close to working, the major problem is that the children of the WizardGroup component are not added as children of the viewstack. Instead, they are added as children of the contentGroup. So the viewstack will always only have one child: contentGroup.
    I also tried the approach of binding the contents of the view stack to the children of contentGroup, but with Spark containers, there is no way to access an array of children or array of elements (ie, there is no contentGroup.getChildren() or contentGroup.getElements()).  Finally, I tried making the id of the ViewStackSpark "contentGroup" but since the ViewStackSpark inherits from BorderContainer, Flex complains at runtime that it can't cast the BorderContainer to Group.
    Help would be greatly appreciated.
    Thanks everyone.
    Josh

    I finally figured it out. The trick is to set the default property of the WizardGroup to a public member array I am calling "content"
    [DefaultProperty("content")]
    public class WizardGroup extends TitleWindow
        [SkinPart(required="true")]
        public var nextBt:Button = new Button();
        [SkinPart(required="true")]
        public var backBt:Button = new Button();
        [Bindable]
        public var content:Array;
    And then within the skin, bind the content of the viewstack to the hostComponent's content array:
            <s:VGroup width="100%" height="100%"
                      paddingBottom="10" paddingTop="10" paddingLeft="10" paddingRight="10">
                <container:ViewStackSpark id="stack" width="100%" height="100%" content="{hostComponent.content}"/>
                <s:HGroup horizontalAlign="right" width="100%">
                    <s:Button id="nextBt" label="Next" enabled="{hostComponent.permitNext}" enabled.last="false"/>
                    <s:Button id="backBt" label="Back" enabled="{hostComponent.permitBack}" enabled.first="false"/>
                </s:HGroup>
            </s:VGroup>

  • View Stacks or States?

    So I have this interface where someone logs into a system and
    they go to a dashboard. That's part is cool. But then I have the
    option of then using a view stack to allow people to navigate the
    different menu options/tabs or I could use states to accomplish the
    same thing. It isn't entirely clear to me which way I should go
    when I'm building out the interface.
    When should I choose one over the other?

    Gregory Pierce wrote:
    > So I have this interface where someone logs into a
    system and they go to a
    > dashboard. That's part is cool. But then I have the
    option of then using a view
    > stack to allow people to navigate the different menu
    options/tabs or I could
    > use states to accomplish the same thing. It isn't
    entirely clear to me which
    > way I should go when I'm building out the interface.
    >
    > When should I choose one over the other?
    >
    In my limited experience I base it on the amount of change
    between one
    view to another. In my first live application I have a two
    element view
    stack and two view states. The view states are used to
    add/remove a
    single control from the user interface. The view stack is
    used to
    completely change every element of the view from one 'page'
    to the next.
    For a small application with only four main UI views it works
    nicely.
    Let me know if you would like more details.
    <mx:states>
    <mx:State name="comment">
    <mx:AddChild position="lastChild">
    <Ctrl:comment
    id="commentDialog"
    saveCommentEvent="saveCommentEventHandler(event)"
    cancelDialogEvent="cancelCommentEventHanderl(event)"
    commentType="{commentType}"
    horizontalCenter="0" top="50"/>
    </mx:AddChild>
    </mx:State>
    <mx:State name="login">
    <mx:AddChild position="lastChild">
    <mx:Container
    top="0" left="0"
    width="100%" height="100%"
    backgroundColor="#000022"
    backgroundAlpha=".85"/>
    </mx:AddChild>
    <mx:AddChild position="lastChild">
    <Ctrl:loginForm
    id="loginForm"
    horizontalCenter="0"
    top="100"
    loginSubmitEvent="loginCheck(event)"/>
    </mx:AddChild>
    </mx:State>
    </mx:states>
    <mx:ViewStack id="troubleLog"
    width="100%" height="100%"
    minWidth="0" minHeight="0">
    <views:masterList x="0" y="0" id="master"
    gridSource="{troubleLogAry}"
    loadTroubleEvent="readTroubleEvent(event)"
    newTroubleEvent="initTroubleEvent()"
    selectTroubleLogView="viewDetails(1)"
    filterUpdateEvent="updateFilterHandler(event)"/>
    <views:logDetails x="0" y="0" id="details"
    colorsAry="{colorsAry}"
    troubleLogEntry="{troubleLogEntry}"
    assigneesAry="{assigneesAry}"
    applicationsAry="{applicationsAry}"
    saveTroubleEvent="saveTroubleEvent(event)"
    selectTroubleLogView="viewDetails(0)"
    showCommentDialogEvent="displayCommentHandler(event)"/>
    </mx:ViewStack>

  • View stack creation policy

    I have a view stack named myViewStack. Now within the view
    stack i have components when i switch between the view stack views
    I want each component's creation complete to be executed. The
    myViewStack creationPolicy is set to all once a user logs into the
    program. Any ideas on how I would do this.
    Thanks....

    The problem is in one view stack page i have a drop down list
    that you can select different companies then in the other viewstack
    page it has a display of charts. So lets say the drop down country
    list is in selectedIndex=1 the charting is in selectedIndex=2 when
    i select different companies from the dropdown component in
    selectedindex=1 it will change the data in selectedindex=2

  • View stack issue creation

    Lets say you have the following view stack with the following
    components in it. When i turn on creationPolicy="all"
    Any of the components will not call their
    creationComplete="loadData()" any ideas as to why?

    The problem is in one view stack page i have a drop down list
    that you can select different companies then in the other viewstack
    page it has a display of charts. So lets say the drop down country
    list is in selectedIndex=1 the charting is in selectedIndex=2 when
    i select different companies from the dropdown component in
    selectedindex=1 it will change the data in selectedindex=2

  • Previews not loading in grid view (stacks) 10.6.3

    Hi, I am having a rather odd bug with stacks: everything works just dandy (previews load) unless I look at a certain folder. If I navigate to the folder (in stack view) it will load maybe 80% of the item previews and then just stop (it loads different ones each time). After I have done this, no preview for anything will load other than folder icons (in stacks, that is), unless I log-out log-in or restart. I have tested this many times, and it is consistent. Cover flow still works, even after stack previews have stopped appearing. An annoyance really, but I still would like to fix it if possible, so thanks in advance for any ideas.

    That's the point to where I was getting - without icon previews, the default icon for .m4v files should be the following:
    (This was just taken from my wife's MacBook Pro, still on iTunes 10.6.2 but running Snow Leopard 10.6.8)
    Under Lion (10.7.4) and iTunes 10.6.3, the default icon (no previews) is empty white, which I do not believe should be - I had the above generic icon for .m4v files in Lion under 10.6.2.
    Yet iTunes-associated audio files are fine: (from my iMac)
    Strange, isn't it??
    Steve

  • People view stacks have no photos assigned

    I had PE11 and have now upgraded to PE13. When I'm in the people view all of my people show no picture assigned to their stack of pictures. How do I assign a photo to them? Thanks! Brian

    Please post Photoshop Elements related queries over at
    http://forums.adobe.com/community/photoshop_elements

  • Help with view stack, PLEASE.

    I have a ViewStack controled by a ToggleButtonBar inside a
    ApplicationControlBar the data provider for the ToggleButtonBar is
    my viewstack, ok it all works like a charm when i run it from flex
    builder 2 but when i try to execute the aplication from another
    path it only shows the initial view, when click the toggle buttons
    they change state but the view remains the same :(, i don´t
    know what to do and the worst thing is that my deadline is allready
    past :S I realy need your help on this one guys, thanks in advanced
    for your help and replyes.

    Maybe you can post some simplified code.

  • Changing States or View Stack?

    Okay, I know this probably sounds ridiculously simple but I
    can't find any documentation to answer my question.
    What is the best way to design a four or five "page" project.
    Each of these "pages" are quite different in layout and content but
    I'm not sure that I should be adding and/or removing so many child
    aspects in different states.
    Would you do this in different states or can you just do
    separate mxml documents for each "page" (and if so, can it still be
    compiled into just one swf)?
    Thanks!

    First, please use a descriptive subject, you will get much
    better response that way than by whining about your ignorace.
    I use states for smaller changes, but they are kind of messy
    for bigger stuff. For major changes and navigation I advise
    ViewStack. Viewstack is very easy to code and use.
    Implement each view as an mxml component[Optional. You can
    also creeate the views in-line, but this is not best practice], and
    declare each as a child of ViewStack. Control the displayed view by
    setting the ViewStack.selectedIndex. That simple.
    Note, mxml components do not use the mx:Application as the
    root tag. That creates a, duh, Application. Use one of the
    containers as the root tag, like Canvas, or VBox, etc.
    There are other architectural options, including SWFLoader
    and Modules, but start with a normal component architecture until
    you see a reason to do otherwise.
    Tracy

  • Dynamic View Stack

    Hi all,
    I am trying to create a reusable wizard application component
    around the ViewStack component. The component will make it easy for
    people to create a new wizard by defining paths through the wizard
    in XML along with the names of the views/pages, and then
    implementing the views/pages in mxml.
    Is there a way to add named views, implemented as mxml pages
    (probably based on Canvas), at runtime? The trick seems to be
    creating a DisplayObject from an arbitrary name that maps to the
    actual mxml file. Is this even possible? Does the ViewStack require
    all the views to be defined statically?
    Below is the XML that defines the wizard.

    "Mike Eppel" <[email protected]> wrote in
    message
    news:g96m8h$9gg$[email protected]..
    > Hi all,
    >
    > I am trying to create a reusable wizard application
    component around the
    > ViewStack component. The component will make it easy for
    people to create
    > a new
    > wizard by defining paths through the wizard in XML along
    with the names of
    > the
    > views/pages, and then implementing the views/pages in
    mxml.
    >
    > Is there a way to add named views, implemented as mxml
    pages (probably
    > based
    > on Canvas), at runtime? The trick seems to be creating a
    DisplayObject
    > from an
    > arbitrary name that maps to the actual mxml file. Is
    this even possible?
    > Does
    > the ViewStack require all the views to be defined
    statically?
    Use getDefinitionByName and ClassFactory to dynamically
    create your class.
    Just be sure that you actually have at least one "hard"
    reference to each
    class you intend to use, or the class might not get compiled
    into your swf.
    Here's a full write-up of how to do that:
    http://www.paulofierro.com/archives/520/

Maybe you are looking for

  • LD_LIBRARY_PATH

    Hi Guys, I am running Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production on Solaris 10. I am using oraenv to setup my environment variables. But when I try to run sqlplus I get these: SP2-1503: Unable to initialize Oracle ca

  • InDesign Server CS5.5 installation issue

    I am developing solution using InDesign Servers via COM which is hosted on Windows Server 2008 R2. And I am experiencing problem utilizing CS 5.5 server: When InDesign Server CS5.5 is installed on Windows Server 2008  (64bit) its COM component is reg

  • New Database Design

    Hi, I'm an DBA and i was assigned to design a new database(fresh) in oracle 11gR2 in windows platform for a project. Since, i'm new to database design, getting confusion on what perspective to approach and where to begin. Can anyone please help on th

  • Microsoft Shadow Copy Service disables itself when trying to run backups.

    I am running Vista Business SP2 and Symantec System Recovery 2013 on my Dell Optiplex GX620 Work Station and my Latitude D830 Laptop. My automatic backups constantly fail due to the fact that the Microsoft Shadow Copy Service continually disables its

  • 3G coverage..​. How do I make it so?

    I recently purchased a BlackBerry Curve 8530 for Virgin Mobile. It says that my phone can physically use 3G. I am in a location where I KNOW 3G is available, and my phone still shows 1XEV signal. Why is this, and how can I make it use 3G?