Flex :: Intercept Value Passed To Item Editor?

Dec 28, 2011

I'm trying to intercept the value that is taken from a DataGrid's GridColumn's itemRenderer and applied to the itemEditor, and vice-versa. I need to be able to format this value. However, my project is complex, so I may be focusing on the wrong idea in what I'm trying to accomplish.

I have a Spark DataGrid component (with ID dg) that I am dynamically populating from XML. I create an ArrayCollection from some nodes, and a regular Array from sub-nodes that is added as a property of the ArrayCollection. That ArrayCollection is then used as the dataProvider for the DataGrid.

Here is an example segment of a typical XML node and it's sub-nodes:

<item name="physOrderTable" text="" type="notes">
<cols>
<col id="0" text="Day/Time" />

[Code].....

This is the only method I've been able to use to achieve the desired result. This all works fine, if all I want to do is merely display information. But I need to be able to edit the values in each cell, and apply this back to the dataProvider, as I need to rebuild XML with the updated values later.

I have tried everything I can possibly think of to be able to do this. I built my own itemRenderer, then my own itemEditor, then scrapped them because it felt like I was re-inventing the wheel. But was I? I tried reading through the code for the DataGrid, GridColumn, and related classes, but I couldn't find any reference to the itemEditor beyond it being an IFactory. I have no idea where or how it tells that IFactory to be a text input or whatever it is.

Here is my issue:

When I turn on the DataGrid's editing, and double-click a cell, it takes the entire array of the col dataField for that column's cell, converts that array to a string, and displays the entire string in the edit text box. If I cancel the editing, or save the editing, it sets the string to the .col property. Then the labelFunction tries reading that string as an array, and it crashes. I was able to get the typeof the col dataField and converting it to an array if it's a string, but I shouldn't have to.

I need to have it display just the value of the cell for that particular row and column when the instance of the itemEditor is created. When that value is changed, I need it to apply back to that column's index in the .col array of the dataProvider. So, similarly to how it displays information in the labelFunction, I need to edit the information and send it back.

I've seen lots of custom itemEditors and itemRenderers for GridColumns, but these are hard-coded in the MXML. My grid is almost entirely dynamically created, so that's unfortunately not an option for me, as I won't even know how many columns or rows there will be when the DataGrid is created. I tried using rendererIsEditor, but that only seems to be on the MXML instantiation of the GridColumn, as there's only rendererIsEditable in the ActionScript, and it doesn't seem to work (or I don't know how to use it as intended).

View 1 Replies


Similar Posts:


Flex :: Keep Item Editor While The Focus Is On The Layer

Jul 19, 2011

I am using a combo-box as a Datagrid ItemEditor (Not just Renderer, my Renderer is a Label, double clicking on a cell makes the combo-box visible, as is the case with all item editors) Now, selecting one of the entries in the combo-box is no problem. But my problem is only when i select the "Fruit", which in turn pops open another layer called "Select Fruit" dialog

Questions: How do i keep item editor, while the focus is on the layer; right now as soon as i click on the fruit, my handler popsup the "Select Fruit" dialog and the focus is on the layer. Once the focus goes out of the editor, the ItemEditor goes away and ItemRenderer label comes back. I want to keep the ItemEditor alive! where do I hook up interms of events like begin/end ItemEdit etc?

View 1 Replies

Flex :: Inline Item Editor Wiping Out Data?

Jan 16, 2011

In this app that has an inline item editor, if you click on a location cell then press tab, the value in the location cell is wiped out.

focusOut doesn't work, nor could I get this to work in DataGrid itemEditEnding etc.

See this Flex forums post, because posting code here rots:[URL]

View 1 Replies

Flex :: Datagrid As Item Editor Gets 'itemEditEnd' Prematurely?

Apr 18, 2011

My application has a tree with a custom item renderer, which depending on the type of data at a leaf uses different components as editors. In one case I am trying to use a datagrid so that the user can choose a row that meets his needs (several columns need to be displayed), ie. similar in concept to a ComboBox.To do this I have a function assigned to be the handler for 'itemEditBegin' (for the tree) in which I'm dynamically creating the datagrid, and then using the popup manager to display it as a (modal) popup. So far so good.

However, if you click anywhere (eg. scroll down button in the datagrid) the popup disappears because the itemEditEnd event is fired - why ?In another scenario, I have a DateField setup as the editor, and the user can click on the icon to bring up a DateChooser, scroll through the months, etc. I looked at the code behind this, and it is using a popup, seemingly in exactly the same way as my code !Here is the 'itemEditBegin' code:

dataGrid = new DataGrid();
dataGrid.dataProvider = mddTable.dataCollection;
dataGrid.editable = false;

[code]......

View 2 Replies

Flex :: Labelfunction Interferes With Combobox Item Editor

Jun 27, 2011

issue is that when a user clicks a datagrid cell that has a combobox editor and then immediately clicks away from the cell, the text value in that cell disappears. I have an itemEditEnd handler on the datagrid and it shows the value of the property I use as the editorDataField just fine. But the labelFunction (which gets called after the itemEditEnd handler) on that grid column sees it as zero. Why aren't the labelFunction and item editor playing together nicely? Here is the DataGridColumn:

[Code]...

View 1 Replies

Make An Item Editor In Flex List Component Commit It's Changes?

May 19, 2009

I have a list component and I have an item editor for the items in the list. I would like to have a button that the user clicks once they are done with their changes because I am having them edit multiple pieces of data in the editor and I would also like to validate the data before closing the editor as well. I just don't know what to do on the button's click event to make the item editor close and commit it's changes to the data provider.

View 3 Replies

Flex :: DataGrid Item Editor - DropDownList Fires Focus Out On Scroll

Feb 24, 2011

I have a data grid with a custom item editor that displays a DropDownList component. When I click the scroll bar in the component, it is firing a focus out event on the list, which is causing itemEditEnd to fire. Why the list is not keeping focus, or how to make it keep focus. I'm using Flex 4.

View 2 Replies

ActionScript 2.0 :: How Many Xml Node Attributes Can Be Passed To A Combobox Item

Mar 9, 2007

How many xml node attributes can be passed to a Combobox item? scenario:

[Code]...

I need the first one to label the item, the second to access the video and the third to access the caption xml.

View 2 Replies

Flex :: Treeview - Intercept Last Opened/expanded Node Of A Tree

Jun 24, 2009

I have a partially populated Tree component and I have to invoke a remote service when User expand (not when he select) a node to retrieve it's leafs. How I know witch node have bee selected.

I'm using Flex 3.3.

View 1 Replies

Flex :: Intercept Service Method Calls Using Metaprogramming In Groovy/grails?

Feb 11, 2010

I have a several Grails services that are invoked from Flex code using Spring BlazeDS integration. I wanted to add some general debug logging using the groovy metaClass. I have the following in a bootstrap class:

class MyBootStrap {
def grailsApplication
def init = { servletContext ->

[code]....

View 3 Replies

ActionScript 2.0 :: Create A Flash Xml Editor Based On Senocular's News Editor?

Oct 5, 2006

I'm trying to create a flash xml editor based on senocular's news editor but I am having some trouble getting the xml file to load. My xml file is structured as below[code]...

View 2 Replies

ActionScript 3.0 :: Call Getters And Setters From The Editor Without Using Static On The Editor?

Jan 13, 2011

my main class is Editor my sub class is a CustomTextField i need my Editor to keep track of what the active CustomTextField is, since there can be more than one. i want to have a variable, activeTextField:String to keep track of the active CustomTextField. i created getters and setters on editor to keep track of activeTextField. how do i call these getters and setters from the editor w/out using static getters and setters on the editor? this has to be confusing to read because i am utterly confused writing it...

View 1 Replies

Flex :: Select Item In Details Form Dropdown When Datagrid Item Is Selected

Feb 15, 2011

I have this datagrid:

<mx:DataGrid id="dgCompetenteN" includeIn="Test" left="10" right="472" top="69" bottom="149"
dataProvider="{colCompetente}" editable="false">
<mx:columns>

[Code]....

What I want to do is, when I select an item in the datagrid, the selected item of the dropdown should be the correct one (the one which has the field idCompSuperioara equal to the third element in the selected datagrid row).

View 1 Replies

Flex :: Get List Item Selection Working When Using A Png Mask In An Item Renderer In A 4.5 Mobile App?

Jun 10, 2011

I'm creating a mobile app in which I need to show a calendar with months at the top. The months are part of a component that extends from SkinnableDataContainer (and has some custom scrolling/behaviour - which is why I did'nt use a spark list). I need the months to be shown as a 'trapezium' shaped tab and so I'm using a png image as a mask in the item renderer for the component.

When the mask is not applied, it all works well - the months render, the list/data container selection works when I click on a month and so on.When the mask is applied, it renders well, scrolling and everything else seems to work well - but when I click on a month, nothing happens visually. And from the trace statements in my code, it appears list item selection is not changing. Looks like mouse clicks are not working.

Code:

public class TopCalendarMonthRenderer extends LabelItemRenderer {
[Embed(source="/assets/trapezium_alpha.png")]
private static var TrapeziumMask:Class;
private static var trapeziumMaskInstance:BitmapAsset;

[code]...

View 1 Replies

ActionScript 2.0 :: Using External Editor - Why Better Than The Native Editor In Flash

Apr 24, 2007

Does anyone have any experience using external actionscript editors? I've given a brief look at SE|PY, but not sure why it's any better than the native editor in Flash.

View 1 Replies

Flex :: Access TileList Item Index In A Custom Item Renderer?

Mar 4, 2011

<mx:itemRenderer>
<mx:Component>
<mx:Canvas>

[code]......

View 2 Replies

Flex :: Toggling States - When Other Item Is Selected The First Item Does Not Change Its State?

Apr 26, 2011

I have used states in my application.The thing is I have made the first item in my list to be selected. so I gave like this,

if(itemIndex == 0)
this.currentState="selected";

this works fine.The problem is when other item is selected the first item does not change its state,it remains in the selected state until its clicked.My code looks like this,

<s:BorderContainer id="outerCont" width="275" height="100" borderVisible="false"
backgroundColor.normal="#3D3C3C" backgroundAlpha.selected="0.1"
backgroundColor.selected="{data.color}">

My states are like this,

<s:states>
<s:State name="normal" />
<s:State name="hovered" />[code]........

View 1 Replies

Actionscript 3 :: Trigger Flex Piechart Item Click Event When A Datagrid Item Is Clicked?

Nov 4, 2011

Is it possible to trigger Flex Piechart Item click event when a Datagrid Item is clicked.If so can anyone give some example.

View 3 Replies

XML Editor UI In Flex?

Apr 27, 2011

I want to create an xml editor UI in flex.Basically I want to present the xml in a textarea.Users can then edit the xml and save it in database.Also,based on logged in user's privilege,the level of editing allowed varies.A normal user can edit the attribute values as well as node values,but not attribute names and node names.

[Code]...

Normal user can only edit id values('1','2','3'),country values('aaaa','aaaa6','aaaa4') and user names('XASD','XASQWED','XASDRQQ').But not node names('users','user') and attribute names('id','country').

I prefer to present the XML to the user as in an editor like interface and restrict editing there,rather than using a grid interface in which attribute names and values are listed in separate columns and enable editing for value column only.

View 2 Replies

Xml :: Hyperlink Cell Elements Passed In A Flex Datagrid?

Jul 30, 2009

I'm trying to render a Flex datagrid using an external XML datasource. Is there a way I can specify in the XML that a cell element should appear as a hyperlink?

View 1 Replies

Flex :: Custom ItemRenderer And Editor?

Feb 15, 2010

I've created a custom ItemRenderer extending UIComponent and implementing IListItemRenderer. This renderer contains a Text-Object to display the value.

For editing I'm using the standard ItemEditor (TextInput).

Now, when I want to edit a value, I click on a cell and the editor is created. But instead of displaying the value which was displayed in the renderer, "[object Object]" is displayed.

View 1 Replies

Flex :: AIR: <img> Tag In Rich Text Editor?

Mar 11, 2011

Is there is there a way(may be very complicated) to display images in the text area from htmlText property in AIR2?P.S. I know that AIR ignores img tags in HTML content due prevent possible phishing attacks.

View 1 Replies

Flex :: Where In Framework Graphics Object Passed Around To Achieve Drawing

Oct 23, 2009

I'm trying to understand how the Flex framework draws objects (Button, Label, Image, etc.). The Button class seems to draw itself by addChild()ing its ProgrammaticSkin. However, where in the framework is the Graphics object being passed around in the hierarchy to achieve the drawing. I want to get to the level of 2D API.

View 1 Replies

Flex :: Character Getting Replaced By Blank When Passed As Application Param?

Feb 22, 2011

I am passing a string param into flex application as FlashVars.The param sometime contains special characters, everything shows fine except + sign which gets replaced by blank when it reaches flex.Here is the scenario for eg.I have a local variable in JS that gets some values and for this example it can be taken as following

var testVar = "some_test_string_that_contains_+_character";

Then to my Flex object AC_FL_RunContent I pass "FlashVars","test="+testVar

In the flex code on Init of application I have written

var testValue:String = application.parameters["testVar"].toString();
Alert.show(testValue);

Now this shows fine except the + character gets replaced by blank. It doesnt happens with other characters like /,@$-_ but the + character.

View 1 Replies

Flex :: Check For Nil 'true' Value On XML That Is Passed Back From Webservice Call?

Sep 27, 2011

I am receiving xml from a webservice call that contains a nil="true":[code]I used the Flex DataService (webservice) wizard to create the service objects for the cacheEntry component. This object will be serialized later on a different webservice call and stored in a database.I set a breakpoint on the set SystemFK method in the service object. It appears that the value passed in was an empty string!Allowing this value to be an empty string will cause problems in the webservice implementation in Java on the other side. Since the database value was null it is expecting a null in return, If I avoid setting this value, the serviceObject should send back a null which will make the database happy.How can I detect that a nil = true is present in the XML in order to avoid setting this value?

View 1 Replies

Javascript :: Image Editor Component In Flex?

Sep 12, 2009

I'm looking for a simple Flex or JavaScript based image editing component which can be embedded in a web application. It shouldn't be a web service but rather a component that I can download and customize (i18n etc.).I only need some basic features: most important is cropping, optional features would be rotating and adjusting brightness/contrast

View 4 Replies

Flex :: Could Not Open The Editor : Assertion Failed?

Dec 3, 2009

when i open .mxml flex file in eclipse it gives error, Could not open the editor: Assertion failed:

View 7 Replies

Flex :: Good (wysiwyg) HTML Editor In It?

Oct 1, 2010

Anyone knows a good (wysiwyg) HTML editor in Flex?

View 1 Replies

Flex :: Rich Text Editor That Provides Link?

Nov 25, 2010

I have built a rich Text Editor for Flex 4 using the instruction in the following link: [URL]

it works great. I want to be able to add link to it (user selecting text to link it to external web page). How do I do that?

implement Rich Text Editor with link support if you have any.

View 1 Replies

Flex - Spark Datagrid Editor - Numbers Only?

Jan 14, 2012

I want a spark datagrid that allow a user to input numbers only. They can only input number with up to 5 decimal places. I am struggling with this in Spark. I can do it in Flex by using the itemEditEnd parameter of the MX DataGrid.

How do I do this is Spark? Any pointers would be great.

View 1 Replies







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