Flex :: GetChildren() Not Working For ViewStack?
Mar 15, 2011My Strucutre is like this.
<mx:ViewStack>
<mx:HBox>
<mx:Form>
[code]......
My Strucutre is like this.
<mx:ViewStack>
<mx:HBox>
<mx:Form>
[code]......
I have a ViewStack which is dataProvider for a TabBar. There are two VBoxs as children for this ViewStack. It works fine with absolute values for width and height for these VBoxs, but when specified in percentages, the VBox uses all the available space (100%) for any percentage value. find the code and screen shots below.
how can children of a ViewStack be aligned to center? There is no horizontalAlign property for ViewStack and it is not working with horizontalCenter= "0".
Code:
<mx:ViewStack id="viewStack" width="100%" height="100%" selectedIndex="0" horizontalCenter="0" textAlign="center">
<mx:VBox label="Tab 1" width="25%" height="10%" borderThickness="2" borderColor="red"
[Code]....
I've been searching for the last couple days but can't seem to find a basic example of what I'm looking for. I'm developing a Flex 4.5 app and in it I have a viewstack of 2 components that use some of the same services. Currently the only way I can get the app to correctly use the web services is by defining 2 different web services that use the same PHP web service file. For example: I have an app, and within it I have a viewstack with tab navigation of 2 components: #1) retrieve a list of all Salary Employees, and #2) retrieve a list of all Contractors. Currently to get it working I am defining a UsersTableEmployees webservice within component #1 and a UsersTableContractors webservice within component #2, but they both point to the same PHP class, and only differ in the arugment value I pass to them. Ie, getUsers("employee") and getUsers ("contractors"). Of course this is not best practice.
Searching StackOverflow and Google gives me many results about ColdFusion and MVC (example What's the best way to share data between components in Flex?), but I'm still confused. Can anyone here point me to a basic example (even sample MVC) and source code of an app that uses Zend AMF and allows different components to call common web services?
I'm using a viewStack which have is property resizeToContent set to true. When I'm selecting a child higher than the viewStack, it's correctly resized, but when I'm selecting another child which is smaller, the viewStack isn't resized! What I want is that my viewStack get the height of the selectedChild each time.
though, the Adobe doc say :
If true, the ViewStack container automatically resizes to the size of its current child.
I've got a Flex 3 project.Does deep linking only work on viewStacks? (My project doesn't have any viewStacks). I'd like to use deeplinking based on what was selected in a comboBox. I'd like the user to be able to bookmark or use the back button based on what was selected in the comboBox.The comboBox selection determines which data is pulled from the database.Is this possible? I set-up deeplinking in another project, but it had viewStacks. And all of the deep linking examples that I've seen use viewStacks.
View 1 Repliesin main.mxml :
public function init():void
{
PopUpManager.createPopUp(this,login,true);
}
[Code]....
How can i selectchild of main.mxml's Viewstack from login.mxml ?
I have as good as finished a new project I'm working on now for a while, and I have this small problem coming up at the fine tuning.The area of concern is so I believe the ViewStack I'm using, but I'm not sure so here the details.I have several check boxes (4), and only one at all times can be selected to show off associated Radio Buttons as a Group of (6). No RBtn pre selected.With the selection of a check box I also make visible a new Radio Button Group of (4). No RBtn pre selected here either.Now if I select one of the RBtn (6 - each has a different Paper size measurement showing) then I can view through a external Xml data file details as Size, basePrice and the totalPrice which is in this case the same as the basePrice!
This totalPrice is located on the first Canvas/Label in the VStack!Selecting any of the first three (3) of the second RBtn Group (4) No RBtn pre selected either! - it will show me a Paper type description, and by selecting the fourth RBtn it will show me as well a field with the extra costs for a Canvas type, and it should select the second Canvas of the VStack with the totalPrice which is basePrice plus the extrasCost Canvas Price.Now the problem is that my second VStack Canvas/Label = totalPrice (basePrice +extraCost) is not showing up immediately! (It just shows blank canceling the basePrice out), and only if I select another of the six (6) RBtn! then it is showing the second vStack with the totalPrice (basePrice +extraCost). From here on everything works perfectly!I think that I have to mention that my RBtn Group are working in a function If / Else / If /Else configuration where both the Labels on both VStack Canvases are called up at the same time. So therefore both Labels should have data available which than should be viewed when the VStack changes?
I'm trying to figure out how to in as3 (not mxml) add views to a view stack.For example I have a view component like so[code]I've being trying to add it to a viewstack in the following way.[code]I'm aware I have to assign ID's but for now I just want to get the view in there
View 2 RepliesI want to know if I can use a tree and when and item in the tree is clicked the viewstack changes to that certain item?
View 1 RepliesI have a ViewStack with 2 panels:
<mx:ViewStack id="viewstack1" height="243">
<mx:Panel id="gridPanel">
<mx:DataGrid id="grid" right="10" left="10" top="10" bottom="10" width="300" height="150" itemClick="showDetails(event)">
[Code]....
I want to have the user click a grid item in the first panel and then load the data in a panel in the second panel. I can grab the value of the index for the clicked item in the itemClicked handler, but how do I access the detailsPanel to set the values based on the row info from the Grid?
I want to add a component into a Viewstack dynamically in flex4. Like code below
[Code]....
But the code in comment doesn't play the effect. How can I implement it? Does the canvas have any hideffect or showeffect to Bind
I'm having problems creating dynamic tabs here's my code:
mxml:
<s:TabBar x="1" y="1" height="32" width="100%" dataProvider="{tabHolder}" chromeColor="#EF8B01"/>
<mx:ViewStack x="2" y="34" id="tabHolder" width="100%" height="214" creationPolicy="all">
<s:NavigatorContent label="Home" width="100%" height="100%">
<mx:Image x="6" y="8" height="181" width="402"/>
[code]....
tab wasn't added, what is wrong?
In my flex project i used one option like Link button . If i like it will be open new page contain more information and components . Which container is suitable one ? Where is used viewstack and stages ?
View 2 RepliesWhat is the main difference Between ViewStack Container and Canvas?
View 1 RepliesSuppose I have a ViewStack like this:
<mx:ViewStack id="s" left="5" right="5" bottom="5" top="0" width="100%" height="100%" creationPolicy="all" minHeight="0">
<mx:Repeater id="repeater" dataProvider="{dp}" height="100%" width="100%" minHeight="0">
<mx:Box id="bx" label="{repeater.currentItem.label}" width="100%" height="100%" minHeight="0">
<mx:Label minHeight="0" width="100%" height="100%" label="bob" />
</mx:Box></mx:Repeater></mx:ViewStack>
With a large number of items in the stack (each having a large number of panels, databinding, etc), this gets extremely slow. The Repeater seems to trigger creation of all children regardless of the creationPolicy of the viewStack itself.
I have a piece of software I'm working on that is using a viewstack with 3 canvases. With the change event I need to look for index 2 which is the last canvas when it changes to this canvas I need it to grab data from inputs from the previous two canvases.Within the viewstack events I've assigned the function change() to the event childIndexChange.
Here is the method:
private function change():void
{
[code].....
I have a viewstack with 3 items in it. Now my problem is that I want all these components to be of the same size. Its simply enough to do this manually but is there any other way of setting the size for all the components at once?
View 2 RepliesI'm trying to create a wizard that will guide a user through a lot of individual containers I have built. I have a main page that has many checkboxes for the user, each checkbox ties to a container. What I would like to have happen is once a checkbox is clicked it makes that container visible, then the next and back buttons when clicked only go to the next visible container; thereby leaving off any containers from the wizard that were not checked on the main page.
View 1 RepliesI'm having problems creating dynamic tabs here's my code:
[Code]...
I have a viewstack with two tabs.In one of them there is a data grid shows a list of notes. The other one is includes a form that can edit notes or crates new note. I want the user to be able to add new note or edit existing note when clicks an item in data grid. I mean when user clicks an item the viewstack must become editor.
View 1 Replieshow I would pass a value to "SelectedChild" in ViewStack:
In the example below, I am trying to set a public property in a form called "register" after I have navigated there from another form called "login".
The result I get seems to be a compilation error:
Error: Access of possibly undefined property pagename through a reference
with static type mx.core:INavigatorContent.
vsMain.selectedChild.pagename = "register page";
[Code]....
I have a ViewStack, with a bunch of NavigatorContainers in. Each NavigatorContainer contains a different category of settings for the application.
I would like to be able to display a popup prompting the user if they try to leave the current NavigatorContainer without saving the changes they have made to the container's settings.
What would be ideal is something like the 'changing' event in the List component, whereby you are able to cancel or defer the event. Calling preventDefault() on the change event in ViewStack doesn't prevent the index change from happening.
In my example below, when I click "Add Content", new stack content is loaded into the ViewStack as expected. But when I then click "Close Content", I'm expecting it to close the newly created content inside the ViewStack and switch to the "defaultContent" content.
[Code]...
I have created a Viewstack and using a Tile component and repeating LinkButtons I was able to make a multi column navigation with the viewstack as the dataprovider. My question is can this be done better? My code is below and I am wondering if I took the long way around this approach.
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
[Code].....
When I remove an element from a viewstack then the body is removed but the tabbar header is still displayed
I would like them both to be displayed.
I got a question about event dispatching and dispatching in flex.
My goal is to pass an email address captured in one component (Comp1) and be passed to another (Comp2). These two components are navigator content of a viewstack. The custom event dispatched the email correctly from Comp1 but somehow could not reach Comp2. The application (Main) looks like :
<fx:Script>
<![CDATA[
import events.LoginEventComplete;
[Code].....
In my application I have a viewstack which I am changing via actionscript using the selectedChild attribute. The problem I run into is that I want to call a method in the component that is now the selected child in the viewstack, right after I assign it to be the child it gives me a "Cannot access a property or method of a null object reference." Is there some way that I can make this work without changing the creationPolicy to all?
Actionscript:
public function displayTaskDashboard(evt:Event):void
{
pm_viewstack.selectedChild = nc_taskDashboard;
taskDashboard.populateTasks(Globals.currentProject.Project_ID);
[Code]....
I've got an flex application where I have a left side TREE control and a viewstack on the right and when someone selects the tree it loads the named viewstack based on the hidden node value of the XML of the tree. But it's throwing a error 1065 variable not defined on a viewstack which worked on the last browser refresh/reload. It's not related to a particular viewstack from what I can tell it just seems to throw the error on certain render events. I've tried to use creationpolicy="all" on the viewstack but it seems to not be of.
[Code]...
I'm very sleepy right now, so this is just an example of what I want (obviously this code is wrong):
<?xml version="1.0" encoding="utf-8"?>
<s:Application
xmlns:fx="http://ns.adobe.com/mxml/2009"
[code].....
I have a viewstack with childrens which I want to show/hide depending on the state the application is
[Code]...
AS you can see I inlude the retail customer view in the retail state and the wholesale customer view in the wholesale state. The problem is that when I run my app they don't appear on neither state.