Flex :: Handling Multiple Views Of The Same ArrayCollection
Feb 22, 2010
I have an ArrayCollection bound to a view, I use a filterFunction on this view to only display parts of the contents. Additionally I have another component where I want to display other parts of the ArrayCollection.
What I would like to do is wrap ArrayCollections around each other, meaning I could have one ArrayCollection containing the model data, and then two separate outer ones where I can set the filterFunction property (setting this in the model seems inappropriate in all cases). Is this possible somehow? If not, how else can this be solved, preferably without forcing model logic to end up in my view?
View 2 Replies
Similar Posts:
Sep 15, 2010
Often multiple instances of the view component would be used in multiple places in an application. Each time I do this, I register the same mediator with a different name. When a notification is dispatched, I attach the name of the mediator to the body of the notification, like so:
[Code]...
View 1 Replies
May 17, 2010
I have data model (dataProvider as ArrayCollection) i want to display in few views , each view should show filtered data. As you probably know, filterFunction is property of ArrayCollection,so I can't use this solution (unless creating new instance of ArrayCollection for each view on top original and impementing filterFunction).
View 2 Replies
Aug 10, 2011
I have a list of txt files and when one is selected it is read and assigned to a string variable. this string is then pushed to a view : pushView(viewer, string), where the string is displayed in a textarea. I want to also pass the relative path of the file also. Is this possible to pass two strings?
[Code]...
View 1 Replies
Jul 11, 2009
I have a couple of remote object methods that I want to respond to in different ways depending on the context, but I'd rather not set up a bunch of different RemoteObject aliases.Some background: Let's say I have an admin application that displays sales stats in different ways. The remote method looks like:
<mx:RemoteObject id="rpt" destination="AMFServer">
<mx:method name="getSalesStats" fault="getSalesStatsFault(event)"
result = "getSalesStatsSuccess(event)" />[code]........
The getSalesStats method takes an employee ID and a sales type as its arguments. You'd call it like:
rpt.getSalesStats(120, "peanuts");
public function getSalesStatsSuccess(e:ResultEvent):void {
salesdata:ArrayCollection = e.result.rows as ArrayCollection;[code]......
I'd like to pass something through the remote method to the responding function, like:
rpt.getSalesStats(120, "peanuts", "clicked button one");
but that of course throws an error because the server doesn't want that last argument.
View 6 Replies
Oct 12, 2010
I have a maven project that produces many artifacts. Of course it is kind of against maven best practice (one pom one artifact), but it is Adobe Flex project that produces many *swf modules and it is really makes no sence to create a separate project for each module.
For me it would be very convinient to handle all swf modules as a single zip archive eg. zip archive would be my artifact.
So I am looking for the way to pack and unpack my zip artifact with maven.
View 1 Replies
Aug 4, 2011
I have created a simple mxml file with code as follows:
<s:application..........>
<s:BorderContainer>
<s:SkinnableContainer id="firstRow"/>
<s:SkinnableContainer id="secondRow"/>
<s:SkinnableContainer id="thirdRow"/>
</s:BorderContainer>
</s:application>
Now I want to apply different font size, font color and font type and background color on each row i.e each of the three skinnableContainers.Currently I have defined 3 different skin classes for each of row but I think this is a bad programing. I should create a single skin class for outermost container i.e BorderContainer and any how provide different fonts and background color to all the 3 child containers through that skin class. So, is it possible that I can create single skin class that can provide different decorations to each of the child container.
View 1 Replies
Oct 27, 2009
I'm new to Flex and am using TileList bound to an ArrayCollection. The array collection is empty at load time, and then updates with the results from am HTTPService call. The problem is that the item renderers aren't being rendered as expected, I'm guessing because there was no data when they were first rendered at load time. Here's simplified example:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" >
<mx:Script>
[code].....
View 2 Replies
Mar 30, 2011
Ive read a ton of online tutorials about this and cant seem to get a definite answer...
View1.mxml
navigator.pushView(views.view2, {response:"BLAH"});
View2.mxml
[code].....
View 2 Replies
Aug 22, 2009
I have a bit of code listens for a user to click a navigation item, however if they click another nav item then my code loads both of them and puts the content pages on top of each other.I am having loads of problems with this bit of code.
PHP Code:
private function _menuSelectHandler (event : MenuEvent):void {
if (! event.abstract) {
[code].......
View 7 Replies
May 17, 2010
I have a problem with event handling. I'm working on a calendar, on which events can be listed. With actionscript i loop through an XML file with the days (and if there, the events for that day). So far so good. Where it goes wrong is this: I only want to display blocks with the day numbers on it. When you click on a day, a box pops up and shows the event's for that day.
This is what i did: created a movieclip with classname mc. loop trough the xml file and for each day create a new instance of mc with the day number as text on it. This al works, but now i want to add an eventhandler for each day. How to do this?
View 1 Replies
Jun 10, 2010
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 Replies
Jul 1, 2010
I have a Flex application with three different views. Only one view is shown at a time, and the choice of view depends on what part of the application the user is working with. If it had been an ordinary HTML webapp I would have created three different HTML-templates/pages for each view.
What is the recommended way to handle such application views in Flex?
View 1 Replies
Sep 13, 2011
I'd like to make an application for PlayBook (using Flex) that has the UI similar to the PlayBook web browser. By similar I mean I want to implement a menu that is shown when the user swipes down from the top bezel of the tablet. I like this feature because I can draw on it, place tons of other objects and handle all kind of events without using screen space when not needed. Plus the PlayBook does not have a "Menu" button like some phones have.Depending on configurations chosen from the first view a number of other views will be pushed onto the the stack view. When the user will access the pull down menu I'd like to show in form of thumbnail snapshot my main (configuration view) and the rest of the views that are on the view stack. This will basically show the user what is going on in different view and let him choose to which one to switch.[code]The menu is accessible from any view, but the code for event handler is in my main MXML file (project.MXML), I found this to be the only way of having one menu for all the views. I managed to pull down the menu from any view and displaying a thumbnail of the current view.
How to get access to all the views. I've been trying all day and all my trials give me access to the active view and my menu object. Here is some code to show what is going on:[code]As I mentioned above this for loop will successfully do the job for the current view then it will crash.Does anyone know how to loop through all the views? This is my first application with flex so if there are any alternatives to my approach I'll be glad to try them. Although I'd like to stick with a single ViewNavigator as opposed to tabbed navigator and multiple views instead of states.
View 1 Replies
Jul 18, 2010
Below is simplified version of a game I am creating. Basically, the game have some circles. Each circle shoot bullets that is dispatched with timerEvent. When the circle is clicked it is removed from the stage. However, the bullet still keeps on dispatching. I couldn't figure out how to stop timerEvent of each individual circle when it is clicked.
var _timer:Timer = new Timer(1000);
var speed:int = 20;
for(var i:int=0; i<= 3; i++) {
var _shape:MovieClip = new MovieClip();
_shape.graphics.beginFill(0x999999);
[Code] .....
View 1 Replies
Aug 18, 2011
I want to have a single event listener for multiple events and depending on the type of event i want to handle them separately.Something similar to Swiz framework see: 'Handling Multiple Events from a Single Method'.i have a piece of code like
var toolOptions:UIComponent=ToolOptions.createToolOptions(type);
if (options != null)
{[code]....
In above toolOptions is a mxml component which get dynamically created based on 'type'.Also which type of event should be dispatch the event from the component? eg: Event.SELECT. To be more precise the above is basically required for a toolbar.When user selects a tool,he is shown options for a tool and when he selects options,tool should apply them to object on the view.
View 2 Replies
Mar 19, 2011
how 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]....
View 2 Replies
Apr 18, 2011
I have a project that has 4 views where I'm using the tabBar with viewStack/NavigatorContent. I have a couple HTTPServices set up gathering the XML and converting to Bindable ArrayCollections. When and how is the best way to pass that data to such things as charts, dataGrids, etc. that aren't seen until the user clicks a tab? Right now I have each item set up with creationComplete functions that pass it then. Although it seems to be working, is this the best way, or is there something better and maybe even quicker?
View 2 Replies
Nov 20, 2011
How do you define a global variable that is accessible across all views on Flex mobile / Flex 4.5/4.6
(Edited for clarification)
Is it still necessary to have to use a separate global class?
(additional) There is a new PersistanceManager in Flex 4.5, is there something like a GlobalObjectsManager that can be used to just set/get stuff in memory?
View 2 Replies
Nov 21, 2011
What are the criteria for decomposing a Flex applicaiton to views? I find quite difficult to apply the Single Responsibility Principle in this context.I've come to the following conclusions through my experience:More monolithic approach(e.g. one view per tab, lots of panels in the same tab)Very easy communication between components as only one Presentation Model is used Cannot use multiple States, only on the top level component.More modular approach (e.g. one view per panel)(the opposite to the monolithic one)
View 1 Replies
Jul 14, 2009
I was wondering best practices for views of inherited classes in PureMVC in this situation: Multiple classes inherit a BaseClass (lets say InheritedClass1 and InheritedClass2) Each InheritedClass has a respective view (derived from a base view class, but each unique) With a given dataset (lets say ArrayCollection of InheritedClass1/2 Objects), the respective views need to be dynamically loaded. The dataset is relatively large, so a TileList would be nice (since it only instantiates objects which are currently displayed) I can think of a couple solutions, but I find them to be too "hackish" to be the best solution:
In View: Repeater over a BaseClassView which attributes a view to a State (set to the "InheritedClass1" state to add a InheritedClass1 object) Pros: No unneeded memory increase (States' objects are instantiated when needed) Cons: View is dependent on the data types, so adds coupling In Mediator: Loop over the ArrayCollection and addChild() the views based on data type Pros: Works. Cons: Mediator is adding things to the View, which defeats the point of the separation of Mediator and View. Slower than a Repeater.
View 4 Replies
Dec 14, 2010
I'm looking to create a flashBuilder document which uses seperate MXML files as "views" which are controlled by states - I believe it's a design pattern of sorts but I'm relatively new to FlashBuilder. I was wondering if anyone knew what design pattern it was and if I can be pointed in the direction of some good references! FYI I'm looking into using FlashBuilder to design Android apps
View 1 Replies
Apr 10, 2009
I've decided to make a start on a new platformer and I was wondering specifically how each of you programmers would go about handling multiple frequent collisions between the player and level/environment. At the moment I'm quite proud of this [URL] Here the player is using a single if statement as follows to check for hit detection.
[COde]...
View 1 Replies
Mar 17, 2011
handling multiple frequent collisions between the player and level/environment. At the moment I'm quite proud of this [URL]. Here the player is using a single if statement as follows to check for hit detection.
Code:
if(player.area.hitTestObject(g1) || player.area.hitTestObject(g2) || player.area.hitTestObject(g3)){
player.y = g1.y;
YS = IYS
[code]....
(This has a slight problem as the player can only be touching one ground at any time and this loops through all of them it ends up making the player fall through the ground anyway.)
View 2 Replies
Dec 5, 2011
I have an ArrayCollection that is the dataProvider for a spark.components.List, which has allowMultipleSelection="true". There is a "Remove Selected Items" button which initiates the removal of all the selected items from the ArrayCollection upon being clicked.
I currently use the following method:
myList.selectedIndices.sort(ascendingSort);
// remove items, counting backwards
for (var i:uint = myList.selectedIndices.length; i > 0; i--) {
myArrayCollection.removeItemAt(myList.selectedIndices[i-1]);
}
where ascendingSort does what you expect ;). It works fine, and I know that it will always work.
However, I did take note that if I neglected the sort altogether, to my surprise the removal still worked. The reason for this turned out to be that, when the removeItemAt is called, the selectedIndices are correspondingly updated.
So my question is: Can one rely upon a removeItemAt call updating the values in the selectedIndices? or might that turn out to be different between runtimes and/or Flex SDK versions?
View 2 Replies
Oct 6, 2009
I'm used to building applications using pure AS3. I always pass dependencies into the constructor of classes I make, but this method seems to not work out well for Flex MXML views. It seems like I should define setters on the MXML class, which map to attributes in the tag/class instantiation. But using this method I cannot specify which properties are required and in what order I expect them etc. What is the preferred method to give a Flex view it's dependencies?
View 3 Replies
Feb 22, 2012
I have a SplitViewNavigator with two split views. In one of the views I have a list and in another one I have questions. User must solve the question and when user click send button, he will see another question.
But when user click to send button in one view, how can i know this in the other view? I'm a newbie in Flash Builder and I'm searching for this for hours.
View 1 Replies
Jan 11, 2010
I have application with a viewstack witch load 5 modules. each module is loaded via the moduleLoader tag and they all have an id.
Every loaded module has a context menu. the context menu has 5 menuItems. one menuItem for each view for the viewstack.
The context menu is loaded via xml.
this is my application file.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute"
backgroundColor="#b1b1b1"
[Code].....
the xml of the context menu is in the module but, the context menu is in a as file that extensiate a button.
View 1 Replies
Nov 14, 2011
I am using a service that returns JSON (geonames.org) and I'm putting the result in an array and dumping it to a datagrid. Now that works fine for one city like this [URL].. However, I want to call this service multiple times with different city names, so I created an XML list ad figured I would iterate over the city list and get the results.
My question is how do I do this such that 1) all the lists are combined into one arraycollection and 2) this seems like I will have to chain the calls and wait for results which may or may not come back, so I thought I would ask the group about the best practice, and or resources to read and examples to build from.
View 1 Replies
Oct 7, 2011
I have a advanced datagrid and populating some data by using arraycollection. And i am filtering the arraycollection, the arraycollection index got changed.
Arraycollection:- [0] - name: abc
[1] - name: hello
[2] - name: hello1
[3] - name:hai
after filtering the arraycollection as 'hell' , the array collection is displaying like the below:
Arraycollection:-
[0] - name: hello1
[1] - name: hello
Can i know the reason why the index got changed after filter it?
* no server side code for filtering. it is only flex side filtering.
View 2 Replies