Flex 4 Tree Lazy Loading?
Aug 20, 2010I have to create a tree in Flex 4, which will populate the nodes from the remote object. My tree structure would be something like this
[Code]...
I have to create a tree in Flex 4, which will populate the nodes from the remote object. My tree structure would be something like this
[Code]...
So I've got a simple web application using Spring MVC + Hibernate and am using the OpenSessionInViewFilter. I've recently been thinking of replacing the UI with something like Flex or GWT.At first I thought it would be easy, in that I can just hit my service layer from the new front end. But as I consider this a bit more, I'm a little bit nervous about the issues surrounding lazy loading. Using a traditional web front end it's no problem because I'm using open session in view...everything that needs to get loaded for the view gets loaded as the view is constructed.
So Let's say I've got a method to return a Customer, and a Customer has a bunch of Contacts, and Contacts have a bunch of Addresses, and so on. If I call getCustomer() from my new "RIA" controller, it's going to get a Customer, but the Customer's collection of Contacts is just going to be a proxy or null.
The project I'm working on has a massive background image (800px wide by 2585px tall) that slowly scrolls upwards. Before, I was using the code [URL].. I modified the code to scroll upwards, but in addition to having a weird intermittent bug that occasionally displays a pixel-tall blank line after the image and before looping the next, it really doesn't seem to handle dynamic loading well (I've tried using several different preloader scripts and it breaks all of them), something that may not have been an issue with the initial implementation but is now that I'm using a monstrously huge image.
Thus, my question: a. Is there another bit of free, Flash-based infinite scroll code floating around that has support for lazy-loading background objects (Say, the existing background chopped in 6)?
[Code]...
I'm trying to make a Flex Tree Component display the children of a sprite in a hierarchical way. Moreover, dragging the items on the FlexTree would resort and reparent the items. I have special Elements set as Folders. This would allow other elements to be added there as a children by dragging an element on the tree and dropping it there. I have a failed attempt which works, but breaks when I try to add folders. Basically, it fails at reparenting the items by dragging and resorting folders and that Does anyone know of a component or something which can do this, has anyone have created any of this or could anyone give me a clue?
View 1 RepliesI am working on Air application,i had a problem on Tree control.Iam adding nodes for the tree dynamically, while adding nodes to the tree i am setting Tree.selectedItem as present added node. after that i need to fire Tree.itemClick event handler method also.how can i call event handler method as a common method. in Flex3
View 1 RepliesI am converting all embed statements in my site with lazy loading. The code which was previously like this:
[Embed(source="/newswf.swf", symbol="kungfu")]
public static var Kungfu:Class;
has now been converted to this form:
private var _loader:Loader = new Loader();
public static var abcd:Class = null;
_loader.contentLoaderInfo.addEventListener(Event.COMPLETE,onLoadComplete);
[code].....
I am trying to use a tree menu to load SWF files into another SWF file. Its not Astra but its very similar. If I could simply get one node linking in an SWF I think I could get the rest. All I could find was how to bring in a movie clip. I have the menu set up and ready to populate but need a bit of help getting it to function how I need it.
I am using AS3, code so far:
stop();
import com.microwebber.tree.*;
import Print2Flash.*
import flash.display.Loader;
[Code].....
I have a intro to a picture of a tree which has buttons on it. The intro is an embedded flv video (not using the FLV component). The video starts on frame one and runs to frame 2. The tree is on frame 3.When I click a button on the tree, it runs the respective frames then returns to the tree. When the tree appears, the sound of the video is playing in the background.How can I make this stop?
Code:
stop();
MovieClip(lion_mov).stop();
//video Mouse Click[code].....
Frame 3 just includes all the mouse clicks for the tree.
I have a tree with nodes , and a delete button , first user select the node and click this delete button , I want this node to be removed from the tree , Its not XML , every node in tree is of type Object
{label:'folder',children:[{label:'file1'}]}
I tried delete myTree.selectedItem (but compiler wont let me do it) also tried myTree.selectedItem = null (just unselects the item)and also how can I access reference to parent object of myTree.selectedItem ?
I am currently developing a dynamic LineChart in FLEX 4.I am implementing a Tree control next to my LineChart, which will filter the LineChart dataprovider and lineseries. The tree control has several branches and ultimately 5 children (leaf nodes) at the bottom of the last branch.I need the leaf node/children to be displayed as checkboxes inside the tree control.As I understand,this will require overrides in the TreeItemRenderer class.This is where I am a little confused on how to implement that.Currently I can distinguish between leaf and branches using this code, in my main MXML component.I added this because it may be helpful to some beginning FLEXdevelopers, such as myself, who cannot easily find this functionality documented well:
private function treeClick(e:ListEvent):void {
_selectedItem = Tree(e.currentTarget).selectedItem;
if(mainTree.dataDescriptor.isBranch(_selectedItem)) {[code].....
I am looking at the TreeItemRenderer override class from the following example here: In the example, they override the "createChildden" super function to add checkboxes to the tree control.My question is, can I override the createChildren function directly in my MXML component, and not have to use an entire class file to override this functionality? Must I re-invent the wheel to do this?Also, how can I distinguish that my treeItem is a leaf node and not a parent, in the override function? I only want to add checkboxes to the leaf nodes, how can I differentiate? The following example adds checkboxes to all branches and leaf nodes, but I want to add checkboxes only to leaf node/children. How would you approach that?
override protected function createChildren( ): void
{
super.createChildren( );[code]............
Here is my tree tag:
<mx:Tree id="mainTree" dataProvider="{treeData}" itemRenderer="TreeCheckBoxItemRenderer" labelField="@label" showRoot="false" width="100%" height="100%" itemClick="treeClick(event)" />
Anyone know how to change a single instance of an item renderer for a Flex tree item at runtime? To reiterate, I'm not trying to change the entire tree's item renderer like this:tree.itemRenderer = new ClassFactory(ItemRenderer2);I'm trying to change the item renderer of a single tree item like this (the following code does not work):tree.selectedItem.itemRenderer = new ClassFactory(ItemRenderer2);To put it more simply, does anyone know how to reference an instance of an item renderer and set it to a new item renderer class? I've tried using the Tree's itemToItemRenderer() method with no success.
View 1 RepliesI have a Flex Tree component in my app. I set the icons for open and close.
BUT I can't find something about changing the default background-color from white to something different.
obviously there is no background-color setable in css...
I'm trying to use the tree component in conjunction with a php page I have that produces xml. But I am literally struggling so much its ridiculous*. My php page is printing out this:
Code:
<?xml version='1.0' encoding='utf-8'?>
<folders>
[code].....
[Bindable]
private var company:XML =
<list>
[Code]....
The Particular code adds a new node to the operations, but i want to add a node any item i select.
public function fileBrowse():void {
var success:Boolean = fileRef.browse();
}
[code].....
I have created a tree with a custom treeitemrenderer where I have added a textinput box next to each label. My data provider is an ArrayCollection. When I enter value in the input box, I can see the value fine as I expand or collapse the tree using the disclousure arrow. There is a strange issue when I try to expand and collapse tree from the mxml page with a button click to expand and collapse tree using the following code.
The problem is as I expand or collapse tree, the values I entered in the input boxes appear to be moving.
For example, I have entered 15 in input box 1. When I expand and collapse tree, 15 moves to another input box, and moves to another, and then it moves back to where it was entered as I keep expanding and collapsing the tree. I am still learning Flex. I am not sure what is happening, it is something to do with arraycollection.
[Code]...
I just read a comment at FlexExamples: One thing to note about the tree is that it is really just a list in which items are displayed. What that means is, you can't really drop somthing "into" folder unless the folder is open. Even in that case the user experience isn't quite right. So try moving everything out of one of the folders and then collapse that empty folder. If you drop something "on" the folder, it actually winds up between the target folder and the one below or above. This is indicated by the black line showing up as you move the mouse over the folders. If you "open" the folder (the only way to tell it is open is by the arrow) and then try it, you end up with an additional drop zone that is basically the bottom half of the opened, empty folder. This is also indicated by the black lines position.
It would be better if the middle section of any item could always be the drop zone for "add to this folder" and the top and bottom edges could be for dropping above or below respectively.I've just come to the same problem. Has somebody already managed this problem? In my case, I have dragMoveEnabled in the tree and offer the ability of dragging the tree items. But it is impossible to drag an item into another item that is empty. You can only drop the dragged item above or underneath an empty item.
How can I use multiple item renderers in mx:Tree depending on item's depth/level in tree?For example. For the first level items I want to use label with button and for second level items combobox
View 2 Repliesi have a tree of nodes that i dont want some type of nodes to appear in the tree, i can check the data on tree item renderer for each specific node type, so i have one type that i dont want it to be shown as tree node, like it doesn't exist.
if(this.data.type == TypeEnum.id){
this.visible=false;
this.height = 0;
}
else {
my required tree structure is as follows
[Code]...
where the component before / represents parent and the children of the corresponding parent are separated by , Can anyone provide me the logic to create a array collection for this hierarchy to set as dataprovider to my tree.
hi i have to create Hierarchical tree in flex through json. Please let me know if there is any type of help
View 1 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 am using mx:Tree (in Flex 4), and assigned a customised MXTreeItemRenderer for every items. As the TreeItemRenderer contains a list with tileLayout, which means the height of every row is variable. So I have to set the tree's "variableRowHeight to true. When I was testing the tree, everything went well. But when I was using the vertical scroller, I met some problems:
The scroll bar did not move to the position I want. When I was scrolling the content, the scroll bar sometimes scrolled to a unwanted position (e.g. the head of the tree). When there are more rows, the problem is more obvious.When I was scrolling the tree, the images were flicking all the time.
<mx:Script>
<![CDATA[
private function openAllNodes():void {
tree.openItems = dp..node;
}
private function closeAllNodes():void {
[Code]...
Unless or other wise i click my parent list, the child or the next list must be in a disabled state.
I click on Child 1, then only Child 2 Must be able to select.
I have a Tree object in my Flex code. It's width is 100%, and it is contained by a Panel with width=200. I am using a custom itemrenderer that extends TreeItemRenderer.I need the text in each node to word wrap if it's too big (as happens often). I have triedlabel.wordWrap = true;
View 5 RepliesI have a flex tree and every time it loads it only shows the one root folder, and i'd like it to show its full contents. I've seen loads of examples of people doing this, but just can't get it to work on mine. I think its because my tree is loading from an HTTPService, so whenever I try something it tries to do it before the tree has loaded, or something!
PHP Code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="initVars()" height="400" width="150"
[Code].....
Im trying to populate a tree control with an external xml file brought in via arraycollection but i need to group the xml data to display in the tree Okay my external xml file is called parts.xml and it looks like this:
[Code]...
additionally what i intend is for the user to have huge tree of parts and they select a node at the partnumber level and drag an drop it on to a datagrid where all the other tags of the part gets displayed.
Ive tried and tried many things without any luck. even now im thinking maybe if i looped through the array-collection and created a new array just for the tree to get it to display the way i need it, then when the user dragged and drop a part onto the grid i would have code that would look for that part number in the original arraycollection and add it to a new array just for the datagrid... i still dont know how i would create that new array for the tree!! cause the xml data is grouped by partgroup and then grouped again by parttype before you get the individual part numbers
I'd like to implement a custom drag on an AdvancedDataGrid tree structure, which only allows the drag on the branches (not leaves).I'm having much difficultly with this, trying to use the MouseDown event, but not having luck! I think I've got the mousedown able to figure out if the item is a branch of leaf. Any help on how to perform the custom drag with an advanceddatagrid?? [code]
View 2 RepliesI need the Flex tree control by default open... where all nodes are visible.[code]...
View 3 RepliesHow do I get a Flex tree to display only specific XML nodes?
A sample of the XML data is below. Only the Grouper and Product elements should be displayed as branch and leaf nodes respectively; the Name elements should not be displayed. I can't use XSL or e4x to modify the XML as the Name elements' text is used as the label for the Grouper and Product tree nodes. Also, I cannot move the Name element to be an attribute as it needs to include a CDATA section.
It looks like using a custom TreeDataDescriptor is the way forward but I cannot find any examples of using one with XML.
<Grouper Type="ProductHeading" Id="" icon="drugIcon">
<Name>ASPAV</Name>
<Product Id="1002081" icon="genericIcon">
[Code].....