Flex :: Cancel A Change Event On A Tree?

Jun 30, 2010

I have a Tree component that's used as a navigation menu between different 'pages'. When the user clicks a certain option in the menu, I switch the 'page' by switching between State components in my application. The thing is that when the user indeed clicks an option in the menu, I want to perform a validation of some of the information in a certain component. If the validation fails, I show an alert, and I'd like to prevent the navigation to the other page. One part of this is simply not changing the currentState of the document, but the tree component still goes on with the change event, and the result is page A still being shown on the screen, whereas the selected option in the tree is page B (to which the user wanted to navigate, but failed since some of the information wasn't valid).

I tried to figure out how I can cancel the change event on the tree component itself. The thoughts I had didn't quite fit nicely:

I searched for a slightly different event (such as 'changing' or 'startChange') on which I can call the stopPropagation() method (since the regular 'change' event is not cancelable), but none exists for the Tree component.

I also thought about always saving the current option that's selected in the Tree component by myself, and when the validation fails, I will set the Tree's selectedItem to that saved option. That's also ugly because such an action will raise another change event on the Tree, thus another change to the States components, and another population of the page in which I'm already at. That's something I really don't want to do.

I also though about using a different component, such as Menu (and I also found an implementation of a vertical Menu), but that doesn't even seem to help. The same problem will exist there.

There must be a best-practice for preventing a change process to commit!

View 3 Replies


Similar Posts:


Flex :: Fire Tree ItemClick Event On Setting Tree.selectedItem In Air?

Oct 30, 2009

I 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 Replies

Flex :: URLLoader Cancel Load On Any Browser Event?

Feb 23, 2010

I have a flash element in a page that load a chart based on some complex queries that can take up to a minute to load. I call the query with this code :

var chartData:URLLoader = new URLLoader();
chartData.addEventListener(Event.COMPLETE, onLoaded);
chartData.addEventListener("httpStatus", onHttpStatus);

[code]......

View 1 Replies

Flex :: Capture And Optionally Cancel A Row Selection Event In A DataGrid?

Sep 16, 2011

I have a DataGrid, and what I would like to do, is when a user clicks on a row to select it, check a certain condition, and if it's met prevent the row from getting selected and keep the old selection intact.

View 1 Replies

Flex :: Change Icon Of Alert Buttons Like "OK - CANCEL"?

Aug 17, 2010

How do I change the icons to Alert buttons like OK, CANCEL etc?

View 3 Replies

Flex :: Tree Space Default Event Listener?

Oct 7, 2010

I have noticed that when I select tree node if space is clicked the selected node gets opened... how could I remove this event?

View 1 Replies

Flex - Tree DataTipFunction Tooltip Change Position?

Nov 30, 2009

I am doing dataTipFunction on Tree in Flex3 Air,

At present the tooltip hides the present node, i need to reposition the tooltip above the node, how can change the x,y position of the tooltip.

View 2 Replies

Actionscript 3 :: Flex Tree Itemclick Event Doesn't Work

Oct 19, 2010

i'm creating a reusable flex tree component. And i would like to stick in the itemclick funtion. So that when a user clicks anywhere on one of the tree's Branches. the branch expands.My problem is that i don't know how i can get the listener function to fire.What i would like to do is create the tree completely in as3. (no mxml). Normaly i set the itemClick on tree in the mxml. but i want to do this in as3. My component has alot more functions in it but i have deleted them so that it becomes easier to read. I Thought if i override the createChilderen function and add the eventlistener in there, that i would work. But no luck.

this is my code;

package
{
import mx.controls.Tree;
import mx.controls.listClasses.IListItemRenderer;

[code]...

View 1 Replies

Flex :: Knowing The Exact Index Clicked In A Tree Event?

Jul 18, 2011

i have a tree component that dispatches an itemOpen event. When the black triangle next to the yellow folder is clicked, that folder opens to expose its children.

Is there anyway to know the index of the open folder? there is a rowIndex property in the target property of the openItem event that stores the index but it is not accessible.

View 2 Replies

Flex :: Dynamically Change Tree RowCount If A Node Is Expanded?

Dec 27, 2010

The tree should have a minimum row count of 4 and a maximum of 10 (beyond which it should display the scroll bars). So, I have a tree with rowCount="4" and I want rowCount to change up to "10" depending on the currently expanded nodes. In debug I can see two of the tree's properties which I could use[code]...

But these are not accessible from outside so I can't find a way to understand if the tree is expanded or not.

View 1 Replies

Flash :: Flex 4.5: Tree - Make A Flex Tree Component Display The Children Of A Sprite In A Hierarchical Way

Nov 19, 2011

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 Replies

Flex :: Change The Appearance Of Nodes In A Tree Control Using An Extended TreeItemRenderer?

Nov 4, 2009

I'm using a tree control that I want to customize. The data items in the tree's dataProvider have a property name that should be used for labeling the node, and a property type that should be used to select one of several embedded images for use as an icon. The simplest way to do this is by using the labelField and iconFunction properties.

However, I wanted to get started with item renderers and open the door for adding more complex customization later, so I tried making my own item renderer. I extended the TreeItemRenderer class as follows and used it in my tree control:

class DirectoryItemRenderer extends TreeItemRenderer
{
[Embed("assets/directory/DefaultIcon.png")]
private static var _DEFAULT_ICON:Class;

[Code]....

This code has no effect whatsoever, icon and label in the tree control remain at their defaults. Using trace(), I verified that my code is actually executed.

View 2 Replies

Actionscript 3 :: Which Event Or Function Is Triggered When Tree Node Is Expanded/collapsed ( Flex 4.5 )

May 28, 2011

I am looking for the function or event, which is called when tree node is expanded/colapsed inside Tree object in Flex 4.5.

View 1 Replies

ActionScript 3.0 :: How To Cancel Timer Event

Aug 24, 2009

How to use "cancelable" in TweenEvent properties..?

View 2 Replies

Flex :: Catch A ComboBoxes Value Before Change With A Change Event?

Feb 3, 2010

I am displaying a combo box in something of a WYSIWYG preview. I want the user to be able to click on the combo box and see the options inside, but I don't want them to be able to change the value. I tried using preventDefault() on the change event but it doesn't work. I don't want to disable it because I do want the user to be able to "look inside" the dropdown.

So I'm trying to block the change, but can't. My next resort is to change the selected index back to what it was before the change, Is there any way to do this within the scope of a ListEvent.CHANGE event listener?

Current Workaround is to basically re-assign the controls selected item the same way I am defining the selected item when I originally build it (a default selection). So a user sees their change then it immediately changes back to the default selection.

View 1 Replies

Flex :: Mx:Tree Not Dispatching "itemClick" Event When Click On Icon

Jun 16, 2010

I have a flex tree that worked perfectly fine when we set the defaultLeafIcon={null} and the folderClosedIcon and folderOpenIcon to {null}. We decided to put the icons back in and took out the nulls. Now they show up fine, but if you click on the icon instead of the label or the rest of the row, it seems to change the selected item, shows the highlight around the new item, but doesn't dispatch the ItemClick event. This makes it really hard to know that the tree's selected item has changed!

The weird part is that once you have clicked on the icon once and it looked like the selectedItem changed (or at least it applied that style), if you click the same icon again, it will actually fire the itemClick event. if you click any other icon, it does the same thing again, switching the selectedItem and styling that row, but not firing the itemClick event.

View 2 Replies

Flex :: Cancel A RPC Call?

Apr 3, 2012

Is it possible to cancel an RPC call that is assigned to an AsyncToken with responders?

View 1 Replies

Flex Visual Change Event

Oct 10, 2009

Is there not an event that occurs only when there has been some sort of visual change to an object. So for example if it were a video or animated object it would be firing as often as EnterFrame. However, if it were some sort of input control just sitting there doing nothing visually, then the event wouldn't fire until the visual state changed as a result of some sort of user input for example.

View 3 Replies

Flex :: Get Old Text From Change Event?

May 25, 2010

What was the change in the textfield? I would want to compare the old text with the new text.the problem is, that I have multiple textAreas in a tab-editor, and all the textAreas are watched by one eventListener. I want to get a value calculated by the next formula[code]...

View 3 Replies

Flex :: Air - Popup Window - Get [ok] Or [cancel]

May 23, 2009

I've done a lot of C# programming with both Winforms and WPF. I'm working on a Flex/Air app now for cross platform support. But this is my first flex project, so I'm learning as I go. I've got a window that I want to popup, that the user will fill out a form, then hit OK or CANCEL. I set it up the same way I would've in C#, but it doesn't work, and I can't really see a way to make it do what I want.

[Code]...

View 3 Replies

ActionScript 3.0 :: Cancel Roll Out Event Upon Roll Over Of Different Clip?

Aug 17, 2009

I have MovieClip A on stage, that when the user rolls over it another MovieClip (B) is added above it to the stage (it's not added as a child of Movieclip A). Now, when the user rolls over this newly added clip, it triggers the roll out event of the clip 'below' it. So, how can I prevent this from happening ?Basically, it's a movieclip that displays a button when rolled over and hides it when rolled out. I need the roll out NOT to be triggered when the user rolls over movieclip B.

View 6 Replies

Flex :: Listening For Viewstack Change Event?

Jan 28, 2010

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].....

View 1 Replies

Actionscript 3 :: Flex Text Change Event?

Apr 8, 2010

I'm tracking how fast does the text of a textArea change. If it changes faster than 500 ms then i don't want to do anything, but if it doesn't change in 500 ms, i want to call a method.I tried like this:

public function textchangeListener(e : Event):void
{
if(((new Date).getTime() - changeTime)>500)[code].....

This method is the event handler for text change.But the problem is, if it changes only under 500 ms and after that it doesn't change, then my method won't be called. I make this for a better performance, so the prepareText() is called only when the user stops typing for 500 ms.

View 3 Replies

Flex :: Components Property Change Event

Sep 28, 2010

I have a custom component on which I have bound an array collection to one of its proeprties: <comp:MyComp id="comp" prop="{images}" /> images is an arraycollection In the components' code I would like to know which event to listen on everytime images updates props. I tried a setter on props but the setter only gets called once when props is first set. I tried the collection event but I get "Update" events sent on top of 'add' and 'remove' events and I would rather not have to manage those. So is there an event(flex or otherwise) that is fired every time a component property is updated by a bindable property?

View 1 Replies

Flex :: Actionscript - Cancel A Net Stream To Fms Server?

Jan 4, 2010

Is there a way to cancel a netstream publish from flex to a flash media server?

The issue is I have code where I can Start/Stop a recording to my Flash media server. However in my front end I have a cancel button which allows the user to cancel the current recording and all this code essentially does it close the netstream. But the issue is it still creates the file on my flash media server even though the user has canceled the stream. Is there a function that I can call that will clear up the stream and remove the file that was created?

View 1 Replies

Flex :: Cancel Text Selection On Textinput?

Jun 9, 2010

So the real problem is the lack of an onReleaseOutside function. I found some examples of how to bypass this during a drag function but it was not applicable for a text input.The problem is that when a user selects some text in textinput and mouses off the application area and then mouses up, I'm getting a problem that the textinput keeps thinking that the mouse down is actively selecting text in the textinput and continually overwrites the characters being entered in the textinput. in the search bar of the live store on the page, type some text, then highlight it all and don't let up on the mouse until you are outside the store.I finally hacked some junk together so I can tell if the mouse goes off the stage using some code like.

var x = stage.mouseX;var y = stage.mouseY;if(x < 0 || y <0 || x >stage.stageWidth || y > stage.stageHeight)I'd like to just make the textinput stop thinking it should be highlighting text so that even if the user scrolls out of the applet and mouses up that the text input still overwrites what is in the search bar and functions as normal.

View 1 Replies

As3 :: Flex - Printing - Blanks Swf After Print Or Cancel

Jun 11, 2010

ok back at another issues in as3 printing

[Code]...

When i click cancel on the print dialog box, i get error below and it blanks out my swf. The error consists, that whenever i try to print and cancel it, or even when i do succesfully print, swf goes blank.

View 1 Replies

Flex :: How To Cancel Effect During Start Delay In AS3

May 5, 2011

I've got a Glow effect (glowIn) being applied to an object on the roll over which has a startDelay applied. I have another glow effect (glowOut) on roll out. If the user mouses out of the control during the startDelay of glowIn, I want to cancel the effect. How do I do this? In this instance, I'm using a glow effect with a startDelay of 300ms. I want a short pause before the item actually shows the effect, but I don't want the effect playing if the user mouses out during this time. I'm setting the properties as follows:

component.setStyle("rollOverEffect", glowIn);
component.setStyle("rollOutEffect", glowOut);

I don't think it matters much, but the component in question is a Series within a chart that gets created at runtime so I would prefer a solution in actionscript rather than mxml if possible.

View 1 Replies

Flex :: Manually Dispatch A Collection Change Event?

Mar 14, 2011

I have a standard combobox that dispatches a collection event when the dataprovider finishes initializing:

my_cb.addEventListener( CollectionEvent.COLLECTION_CHANGE, getMyStuff );

Then I have a custom component that also has a dataProvider. How do I get it to dispatch a collection change event when its dataprovider finishes loading?From what I've read, I can't do it. Will dispatching a propertychangeevent work?

UPDATE:I have a custom component that I call 'SortingComboBox' but it is not a ComboBox at all; it extends Button and I set is dataProvider property to my arraycollection, model.product (which is an arraycollection). how I use the dataProvider in that component:

code

[Bindable]
private var _dataProvider : Object;
public function get dataProvider() : Object
{[code]..........

In the createChildren() method of this component, I use this:

BindingUtils.bindProperty(dropDown, "dataProvider", this, "dataProvider");

The dropDown is a custom VBox that I use to display labels.

View 5 Replies

Actionscript 3 :: Bindable Property Change Event In Flex?

Sep 20, 2011

I've got a component called Box.as that has following two properties, and have their getters & setters defined:

private var _busy:Boolean;
private var _errorMessage:String;

In MXML that uses this component I define it like this:

<components:Box skinClass="skins.components.BoxSkin"
busy="{presenter.boxBusy}"
errorMessage="{presenter.boxErrorMessage}"/>

Where presenter variable is defined here in MXML and a Presenter class has boxBusy and boxErrorMessage variables defined as bindable property change events:

[Bindable(event="propertyChange")]
function get boxBusy():Boolean;
function set boxBusy(value:Boolean):void;

[Code]....

PROBLEM is that whenever I change boxErrorMessage for the presenter, I see the affect in MXML but nothing happens at all when I change boxBusy. Is there something extra I need to do with boolean variable?

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved