Bind to ArrayCollection outside of item editor

I have something like:
<mx:Panel>
<mx:Array id="fields">
<mx:String>A</mx:String>
<mx:String>B</mx:String>
<mx:String>C</mx:String>
</mx:Array>
<mx:DataGrid ...>
<mx:DataGridColumn ...>
<mx:itemEditor>
<mx:Component>
<mx:ComboBox dataProvider="{fields}" />
</mx:Component>
</mx:itemEditor>
</mx:DataGridColumn>
</mx:DataGrid>
I can't bind the combobox to "fields" because it can't see
it, how can I do this without replicating the array "fields"? I use
"fields" elsewhere in this component so I can't just move it into
the combobox area.

I see now:
<mx:Component id="comboFields">
<mx:ComboBox dataProvider="{outerDocument.fields}" />
</mx:Component>
ref:
http://livedocs.adobe.com/flex/201/langref/mxml/component.html

Similar Messages

  • Funny behavior with Item Editors

    I have a DataGrid which has a column with CheckBoxes (item
    editors), initially they are all unselected (suppose there are 5
    rows), if i click on the 5 of them quickly to change them to
    selected then something funny happens, some of them change to
    selected and then to unselected again. If i do this slowly, then it
    works fine. And the same happens if they are all selected and then
    i quickly click on the 5 of them to unselect them, some of them
    became selected again.
    It is as if Flex wasn't able to process the changes so fast,
    so by the time it is processing a CheckBox's change another one
    changes too and it reverts the first one to its previous state.
    Any idea why this happens? is it a bug, a mistake in my code,
    a normal behavior? what is it?

    Code:
    <mx:DataGrid id="dgcatalogo" width="100%" editable="true"
    height="236" dataProvider="{arrCCostoDisplay}" >
    <mx:columns>
    <mx:DataGridColumn dataField="ccoEstatus"
    headerText="{resource.getString('incluir')}" width="50"
    editable="true" rendererIsEditor="true"
    itemRenderer="renderer.CheckRenderer"
    editorDataField="result"/>
    <mx:DataGridColumn dataField="ccoDescripcion"
    headerText="{resource.getString('descripcion')}" editable="false"
    width="200"/>
    </mx2:columns>
    </mx:DataGrid>
    where CheckRender is:
    <mx:VBox xmlns:mx="
    http://www.adobe.com/2006/mxml"
    horizontalAlign="center">
    <mx:Script>
    <![CDATA[
    // Define a property for returning the new value to the
    cell.
    public var result : Boolean = false;
    ]]>
    </mx:Script>
    <mx:Binding source="editor.selected" destination="result"
    />
    <mx:CheckBox id="editor"
    selected="{data.ccoEstatus}"/>
    </mx:VBox>
    That's the code, and like i said, it behaves funny when you
    select/unselect the checkboxes quickly

  • Intercept value passed to item editor?

    Hello! 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. Please have a look and let me know if there's something else I could try.
    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" />
                <col id="1" text="Order Type" />
                <col id="2" text="Physician's Orders" />
                <col id="3" text="Physician's Signature" />
            </cols>
            <rows>
                <row id="r0" name="" text="">
                    <col id="0"><![CDATA[Tues 15:24]]></col>
                    <col id="1"><![CDATA[General]]></col>
                    <col id="2"><![CDATA[BMP, CBC, Cardiac Enzymes, ABG, EKG STAT, NS@ 125 mL/hr, Blood Sugar AC & HS, 02 via NC to keep oxygen saturation above 97%]]></col>
                    <col id="3"><![CDATA[J. Nelms]]></col>
                </row>
            </rows>
        </item>
    Here is the code that reads through the XML and utilizes it:
        protected function sparkDG_creationCompleteHandler(event:FlexEvent):void
            trace("grid created");
            var colsList:XMLList = xml.cols.col;
            var rowsList:XMLList = xml.rows.row;
            colAL = new ArrayList();
            for(var i:Number = 0; i < colsList.length(); i++)
                var gc:GridColumn = new GridColumn();
                gc.maxWidth = 500;
                gc.resizable = false;
                gc.headerText = String(colsList[i].@text);
                gc.dataField = "col";
                gc.labelFunction = labelFunc;
                colAL.addItem(gc);
            for each(var row:XML in XML(value).rows.children())
                var rowArr:Array = new Array();
                for each(var col:XML in row.children())
                    if(col == "")
                        rowArr[Number(col.@id)] = "_";
                    }else{
                        rowArr[Number(col.@id)] = col;
                colAC.addItem({
                    rowID: row.@id,
                    rowName: row.@name,
                    rowText: row.@text,
                    col: rowArr
            dg.columns = colAL;
            dg.dataProvider = colAC;
    So I build the header for the DataGrid first, telling it to use the "col" dataField, which corresponds to the .col property of the colAC ArrayCollection. That .col property is the array of values for each cell of that row.
    Now this part of code is important, as it displays the relevant index of the .col array by using the .columnIndex:
        private function labelFunc(item:Object, column:GridColumn):String
            var displayText:String;
            var valArr:Array = new Array();
            if(column.dataField == "col")
                valArr = item[column.dataField];
                displayText = String(valArr[column.columnIndex]);
            return displayText;
    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).
    If anyone knows of a way to accomplish this, even just something else I should look at, I would greatly appreciate it!

    Thanks for your response! I had seen that function before, but as there was nothing in it, I couldn't figure out if it was useful. Going back, I looked at the comments. I also found this website about item editors: The Item Editing Process
    So, according to that, the data variable will contain the .col property of the dataProvider, right? I can trace data out as an object, but when trying to reference it as an array, it doesn't work.
    Also according to that website, data is applied to value before prepare() is called, at which point data becomes a string. Doing this test in prepare(), I find that value is already a string. I can do a split() on the string or whatever to set the value how I need it (I think), but my life would be a lot easier if I could reference the cell's data directly and set value based on that.
    <?xml version="1.0" encoding="utf-8"?>
    <s:GridItemEditor xmlns:fx="http://ns.adobe.com/mxml/2009"
                      xmlns:s="library://ns.adobe.com/flex/spark"
                      xmlns:mx="library://ns.adobe.com/flex/mx">
        <fx:Script>
            <![CDATA[
                private var valueArr:Array;
                override public function prepare():void
                    trace("prepare called");
                    valueArr = new Array(value);
                    trace("\tdata["+0+"]: "+data[0]);
                    trace("\tdata["+columnIndex+"]: "+data[columnIndex]);
                    trace("\tvalue: "+value);
                    trace("\tvalueArr.length: "+valueArr.length);
                    value = String(valueArr[columnIndex]);
                override public function discard():void
                    trace("discard called");
                    valueArr[columnIndex] = value;
                    value = valueArr;
            ]]>
        </fx:Script>
    </s:GridItemEditor>
    And once that's accomplished, I believe what I did for discard() there should work correctly. What do you think?

  • Spark datagrid item editor font see through

    I am using a default item editor on a spark datagrid.
    When the user attempts to edit the field the old value shows through.
    How do I get rid of this?
    I am using out of the box stuff? Is this a listed bug?
    Code is...
    <s:GridColumn dataField="Actual" headerText="Actual" width="75" editable="true">
                        <s:itemRenderer>
                            <fx:Component>
                                <s:DefaultGridItemRenderer textAlign="right"   background="true" backgroundColor="#FFFFFF" alpha="1.0" color="#000000" />
                            </fx:Component>
                        </s:itemRenderer>
        </s:GridColumn>
    Thanks
    Dan Pride

    Try <s:DefaultGridItemEditor if you are wanting to make it editable.
    here is an example of combobox, but it is similiar ....
    <s:itemEditor>
    <fx:Component>
    <s:ComboBoxGridItemEditor  >
    <s:dataProvider>
    <s:ArrayList>
    <fx:String>Edit</fx:String>
    <fx:String>Read</fx:String>
    </s:ArrayList>
    </s:dataProvider>
    </s:ComboBoxGridItemEditor>
    </fx:Component>
    </s:itemEditor>
    Don

  • 10g Text Item Editor Not Working Correctly

    We're having problems with the Text Item Editor in both Add and Edit modes, but esp. in Edit mode. The problems range from getting a gray text screen (no toolbar); getting a white editor screen (no toolbar); tools that do not load (e.g. font color); and tools that do not work even though everything else seems fine. Sometimes refreshing the screen works but not always. Our users are getting very frustrated continually refreshing and logging out/in. It's become worse in the past few weeks such that it occurs in nearly every instance when editing a text item.
    Can anyone point us in a possilbe direction? We are using IE 6.0 and above as the browser.

    Kristin -
    This sounds like a bug that should be handled through Oracle Support.
    Regards,
    Candace

  • ORA-20001: Unable to bind :MI verify length of item is 30 bytes or less.

    Hi,
    I am trying to build a dynamic SQL statement with a date format including HH:MI
    and get the following error:
    1 error has occurred
    Function returning SQL query: Query cannot be parsed within the Builder. If you believe your query is syntactically correct, check the generic columns checkbox below the region source to proceed without parsing.
    (ORA-20001: Unable to bind :MI verify length of item is 30 bytes or less. Use v() syntax to reference items longer than 30 bytes. ORA-01006: bind variable does not exist)
    Code:
    if v('P46_DATE_SEARCH1') IS NOT NULL
    then
    w:=w ||' AND (to_date(I.DATE_BILLED,'''DD-MON-YY HH:MI''')'||
    ' BETWEEN trunc(to_date('''||
              v('P46_DATE_SEARCH1')||''')) AND trunc(to_date('''||
              v('P46_DATE_SEARCH2')||''')) )';
    --          :P46_DATE_SEARCH1||''')) AND trunc(to_date('''||
    --          :P46_DATE_SEARCH2||''')) )';
    end if;
    Any help would be appreciated...
    Bill

    Try
    if v('P46_DATE_SEARCH1') IS NOT NULL
    then
    w := w || q'!AND (to_date(I.DATE_BILLED,'DD-MON-YY HH!'||':'||q'!MI')
                 BETWEEN trunc(to_date(
                 v('P46_DATE_SEARCH1'))) AND trunc(to_date(
                 v('P46_DATE_SEARCH2'))))!';
    -- :P46_DATE_SEARCH1||''')) AND trunc(to_date('''||
    -- :P46_DATE_SEARCH2||''')) )';
    end if;ops, Scott was faster than I. :C)
    Message was edited by:
    Felipe Bertaglia

  • Double Click to Activate Tree Item Editor

    Hi, I have an mx:Tree that uses an MXML component as an item
    editor. I only want to activate the editor when the user double
    clicks on a tree's node. As a default, a single click will open the
    the item editor on the Tree list. Can anyone help me with
    this?

    I am pretty sure it is possible, but I have not done it. You
    will probably need to cancel the default behavior of click event.
    Tracy

  • Binding from workflow to work item aborted

    Hi,
    In my workflow  the first two steps are  multi condition.
    after my second condition  i have created activity   step   - Task   and  binding the  bapi attribute value.
    i checked binding  no error.
    I am getting error in this part.
    The error is
    Workflow 'TEST' step number 1039: work item could not be created                          
    Source (expression '&PurchaseRequisition.Zvalue&') of binding assignment is not available   
    Error in the evaluation of expression '&PurchaseRequisition<???>.Zvalue&' for item '20'     
    Step 15 of WS23000111: Binding from workflow to work item aborted                               
    Error when determining attribute 'Zvalue' of object instance '[BO.BUS2105.001039]'   
    Step 15 of WS23000111: Binding from workflow to work item aborted
    Message no. WFEA031
    Diagnosis
    Serious errors have occurred in the binding from workflow to work item in step 15 of multistep task WS23000111. As a consequence, workflow 1039 has been forced into error status.
    Procedure
    "Change Workflow Container" then "Restart After Error" may suffice. It is probable, however, that the binding definition in WS23000111, step 15will have to be changed.
    pl help me to proceed further.
    Thnks in advance.
    sharma

    Hi,
    Seems that your custom BOR is not delegated to the supertype, please do the same in SWO6 and
    also check the binding from event to workflow.
    Thanks and Regards,
    Swaminathan

  • DataGrid item editor in Flash CS3

    Does anyone have a good example of how to define custom item
    editors and custom cell renderers for the DataGrid in Flash CS3
    with Action Script 3.0?
    I'm trying to put things like combo boxes and numeric
    steppers in certain columns.

    Found an example.
    Click
    Here

  • Forms (V10G) - RunTime Text  Item -- Editor

    Hello:
    What are the available options to enhance forms runtime SYSTEM/DEFAULT editor for Text Items? We like to add spell checker, text format features in to field editor.
    I am sure there are Java based editors out there that Forms could invoke. I am hoping I am not the fist one with this requirement and someone may have done this. Perhaps could provide some input.
    Forms V 10G. (This posting is NOT about PL/SQL editor in Developer)
    Thanks

    Hello,
    You can use Webutil.You can call MS Word checkspell function.
    Check this:
    http://sheikyerbouti.developpez.com/webutil-docs/fichiers/Webutil_store_edit_docs.pdf
    Cheers,
    Suresh

  • How to bind a checkbox to an item

    I started a small program to add a feature to the item master data. I just add a checkbox to the form but I don't know how to link that checkbox to the Item master data. What would be the best solution considering my source code:
    If pVal.EventType = et_FORM_LOAD And pVal.Before_Action = False And pVal.FormType = 150 Then
            Set oForm = SBO_Application.Forms(FormUID)
            Set oItem = oForm.Items.Add("EVOSS_Cut", it_STATIC)
            oItem.Top = 68
            oItem.Width = 80
            oItem.Left = 448
            Dim oTextField As SAPbouiCOM.StaticText
            Set oTextField = oItem.Specific
            oTextField.Caption = "Cut Item"
            Set oItem = oForm.Items.Add("EVOSS_Cut2", it_CHECK_BOX)
            oItem.Top = 68
            oItem.Left = 430
            oItem.Width = 20
            Dim oCheckbox As SAPbouiCOM.CheckBox
            Set oCheckbox = oItem.Specific
        End If
    Thanks a lot

    Vicent,
    add a userdatasource to the userdatasources collection of the form. Then bind your checkbox to the userdatasource.
    Generally, you might consider not creating controls via code (unless necessary for dynamic control creation). Use srf files in order to update an existing form. This way is much faster. It also is a lot easier to adapt to changes - no need to touch the source code.
    See the SAP samples or the TechDemo AddOn (/people/lutz.morrien3/blog/2004/09/21/sap-business-one-techdemo-addon-beta-out-now-and-it-is-free) for sample code.
    HTH Lutz Morrien

  • OndataChange event from item editor?

    Hi. The docs are a bit confusing on this, so maybe someone
    can help.
    I've got a numeric stepper in a datagrid as an itemEditor:
    <mx:DataGridColumn dataField="@qty" headerText="Quantity"
    itemEditor="myComponents.NSEditor_max3"
    editorDataField="newTotal"/>
    I have a function that adds up all the data in this column. I
    would like to call that function every time the user changes the
    data, with the stepper arrows or by typing. Most of my users will
    click the arrows.
    I already can easily call the function if the user chooses a
    different row, or otherwise commits the data. However, I can't
    count on my users doing that; they might just leave the stepper in
    editing mode and leave the screen (it's in a view stack) so I want
    to get a total immediately when they change the amount. This
    happens by default with a "plain" stepper right on the screen, but
    it being an itemEditor seems to be different.
    Here's the stepper component code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:VBox xmlns:mx="
    http://www.adobe.com/2006/mxml"
    width="69" height="22">
    <mx:Script>
    <![CDATA[
    public function get newTotal ():Number{
    return step.value;
    ]]>
    </mx:Script>
    <mx:NumericStepper id="step" minimum=".25" maximum="1"
    stepSize=".25" value="{XML(data).@qty}" />
    </mx:VBox>

    oh, the outerDocument is what you need to dereference the
    function and it must not be private.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="vertical" width="300" height="300" >
    <mx:Script>
    <![CDATA[
    import mx.controls.Alert;
    import mx.collections.ArrayCollection;
    [Bindable]
    private var initDG:ArrayCollection = new ArrayCollection(
    {company:'C1', contact:'Con1', phone:'phone1', city:'City1',
    state:'state1'},
    {company:'C2', contact:'Con2', phone:'phone2', city:'City2',
    state:'state2'}
    function outerFunctionTest() : void {
    Alert.show("I'm outside the inlined component!");
    ]]>
    </mx:Script>
    <mx:Component id="inlineEditor">
    <mx:ComboBox>
    <mx:change>
    <![CDATA[
    Alert.show('Changed.');
    outerDocument.outerFunctionTest();
    ]]>
    </mx:change>
    <mx:dataProvider>
    <mx:String>AL</mx:String>
    <mx:String>AK</mx:String>
    <mx:String>AR</mx:String>
    <mx:String>CA</mx:String>
    <mx:String>MA</mx:String>
    </mx:dataProvider>
    <mx:Script>
    <![CDATA[
    import mx.controls.Alert;
    ]]>
    </mx:Script>
    </mx:ComboBox>
    </mx:Component>
    <mx:DataGrid id="myGrid"
    variableRowHeight="true"
    dataProvider="{initDG}"
    editable="true" >
    <mx:columns>
    <mx:DataGridColumn dataField="company"
    editable="false"/>
    <mx:DataGridColumn dataField="contact"/>
    <mx:DataGridColumn dataField="phone"/>
    <mx:DataGridColumn dataField="city"/>
    <mx:DataGridColumn dataField="state"
    width="150"
    editorDataField="selectedItem"
    itemEditor="{inlineEditor}"/>
    </mx:columns>
    </mx:DataGrid>
    </mx:Application>

  • How to bind json model to List items?

    Hi guys,
    I'm following ui5 developer guide trying to build an application. The application has a list to which I want to bind a json model.
    But I'm so confused by the binding path( absolute, relative):
    Here's my json model:
    var players =
    "name": "aaron"
    "name": "mike"
    "name": "jone"
    var playersModel = new sap.ui.model.json.JSONModel();
    playersModel.setData(players);
    sap.ui.getCore().setModel(playersModel,"all_players");
    Here's what I did to bind the model to the list:
    var playerList = new sap.m.List({
      playerList.setModel(sap.ui.getCore().getModel("all_players"));
      playerList.bindItems("",
      new sap.m.StandardListItem({
      title:"{/name}"
    what's wrong with my code?
    Can someone advice how to specify the binding path correctly?
    What's the meaning about relative path and absolute path?

    Just figure out how to bind.
    var playerList = new sap.m.List({
      playerList.setModel(sap.ui.getCore().getModel("all_players"));
      playerList.bindItems("/",   //<- absolute path, normally followed by a property name of the model object, but for this case, the model is an array,
                                                // so nothing follows, path is just one slash
      new sap.m.StandardListItem({
      title:"{name}"  // <- the array objects have been bound to the list items, so specify a relative path
    absolute path starts with slash: "/aaa/bbb"
    it means the path starts from the top hierarchy of the model:
    relative path starts with a name of a property. "ccc"
    it means the path is relative to the absolute path, so the absolute path of this relative path is "/aaa/bbb/ccc"

  • AdvancedDataGrid: binding an ArrayCollection of Objects

    All, I am a Flex newborn, so if this is a really dumb
    question with an obvious answer, please don't hesitate to respond.
    Everytime I think I wrap my head around something in this darned
    language, something else throws me totally .
    I have created a ArrayCollection, empsColl, that holds a
    number of Employee Objects. I can bind this to a DataGrid no
    problem. However, the data does not display in the
    AdvancedDataGrid. I have tried a DataProvider of HierarchicalData
    with a source of empsColl, but am very confused as to what the
    childrenField would be in this instance. The Object name sure
    doesn't work. I have also tried GroupingCollection with the same
    source, but, alas, no luck.
    Does someone have a code example where this has been done
    successfully? I see plenty of examples using XML or flat data, but
    none with an ArrayCollection of Objects.
    Thanks so much.
    Georgia

    "Vesta0424" <[email protected]> wrote in
    message
    news:[email protected]...
    > Yes, thanks, here is my ADG code. I've tried it both
    ways: Hierarchical
    > Data
    > (but as I said, don't know what the childrenField would
    be and, besides, I
    > think this data is flat really) and Groupingcollection.
    >
    > GroupingCollection: I tried a number of fields to use as
    the Grouping
    > fields,
    > this is my latest iteration.
    >
    > <mx:AdvancedDataGrid id="lvADG"
    initialize="lgc.refresh()">
    > <mx:dataProvider>
    > <mx:GroupingCollection id="lgc"
    source="{leaveColl}">
    > <mx:grouping>
    > <mx:Grouping>
    > <mx:GroupingField name="name"/>
    > <mx:GroupingField name="leaveRequestDetailID"/>
    > </mx:Grouping>
    > </mx:grouping>
    > </mx:GroupingCollection>
    > </mx:dataProvider>
    > <mx:columns>
    > <mx:AdvancedDataGridColumn dataField="name"
    headerText="Name"/>
    > <mx:AdvancedDataGridColumn dataField="leaveType"
    headerText="Type"/>
    > <mx:AdvancedDataGridColumn dataField="dateFrom"
    headerText="From Date"/>
    > <mx:AdvancedDataGridColumn dataField="dateTo"
    headerText="To Date"/>
    > <mx:AdvancedDataGridColumn dataField="startTime"
    headerText="Start
    > Time"/>
    > <mx:AdvancedDataGridColumn dataField="endTime"
    headerText="EndTime"/>
    > <mx:AdvancedDataGridColumn dataField="hours"
    headerText="Hours"/>
    > </mx:columns>
    > </mx:AdvancedDataGrid>
    >
    > HierarchicalData : an ArrayCollection of rows seems more
    flat than
    > hierarchical. I have tried binding directly to the
    XMLListData, using
    > request
    > as the childrenfield and this did not work either.
    >
    > <mx:AdvancedDataGrid id="leaveADG"
    initialize="gc.refresh()">
    > <mx:dataProvider>
    > <mx:HierarchicalData id="leaveHD"
    source="{leaveColl}"
    > childrenField="request"/>
    > </mx:dataProvider>
    > <mx:columns>
    > <mx:AdvancedDataGridColumn dataField="name"
    headerText="Name"/>
    > <mx:AdvancedDataGridColumn dataField="leaveType"
    headerText="Type"/>
    > <mx:AdvancedDataGridColumn dataField="dateFrom"
    headerText="From Date"/>
    > <mx:AdvancedDataGridColumn dataField="dateTo"
    headerText="To Date"/>
    > <mx:AdvancedDataGridColumn dataField="startTime"
    headerText="Start
    > Time"/>
    > <mx:AdvancedDataGridColumn dataField="endTime"
    headerText="EndTime"/>
    > <mx:AdvancedDataGridColumn dataField="hours"
    headerText="Hours"/>
    > </mx:columns>
    > </mx:AdvancedDataGrid>
    I put together a simpler example file, but I couldn't make it
    work either.
    If anyone else wants to pick this up, here's a starting
    point:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute"
    creationComplete="init()">
    <mx:Script>
    <![CDATA[
    private function init():void{
    trace('foo');
    ]]>
    </mx:Script>
    <mx:ArrayCollection id="leaveColl">
    <mx:Object leaveRequestID="1"
    leaveRequestDetailID="1"
    personID="1"
    name="Kostner, Kevin"
    hours="37.5"
    leaveType="Annual"
    startTime=""
    endTime=""
    dateFrom="{new Date(2009,0,5)}"
    dateTo="{new Date(2009,0, 9)}" />
    <mx:Object leaveRequestID="1"
    leaveRequestDetailID="2"
    personID="1"
    name="Kostner, Kevin"
    hours="7.5"
    leaveType="Annual"
    startTime=""
    endTime=""
    dateFrom="{new Date(2009,0,10)}"
    dateTo="{new Date(2009,0, 11)}" />
    <mx:Object leaveRequestID="2"
    leaveRequestDetailID="3"
    personID="1"
    name="Kostner, Kevin"
    hours="7.5"
    leaveType="Annual"
    startTime="8:15"
    endTime="4:45"
    dateFrom="{new Date(2009,0,7)}"
    dateTo="{new Date(2009,0, 8)}" />
    </mx:ArrayCollection>
    <mx:AdvancedDataGrid id="leave">
    <mx:dataProvider>
    <mx:GroupingCollection id="lgc" source="{leaveColl}">
    <mx:grouping>
    <mx:Grouping>
    <mx:GroupingField name="name" />
    </mx:Grouping>
    </mx:grouping>
    </mx:GroupingCollection>
    </mx:dataProvider>
    <mx:columns>
    <mx:AdvancedDataGridColumn dataField="GroupLabel"
    headerText="Test Header"
    />
    <mx:AdvancedDataGridColumn dataField="name"
    headerText="Name"/>
    <mx:AdvancedDataGridColumn dataField="leaveType"
    headerText="Type"/>
    <mx:AdvancedDataGridColumn dataField="dateFrom"
    headerText="From Date"/>
    <mx:AdvancedDataGridColumn dataField="dateTo"
    headerText="To Date"/>
    <mx:AdvancedDataGridColumn dataField="startTime"
    headerText="Start Time"/>
    <mx:AdvancedDataGridColumn dataField="endTime"
    headerText="EndTime"/>
    <mx:AdvancedDataGridColumn dataField="hours"
    headerText="Hours"/>
    </mx:columns>
    </mx:AdvancedDataGrid>
    </mx:Application>
    I put in the init() function in just as a place to put a
    break point so I
    could look at the variables. It didn't do me any good, thoug
    Sorry...I tried.

  • Can spark datagrid mouse click be disabled while in a custom item editor?

    Hi,
    Is it possible to prevent a user from clicking on another cell in a datagrid until the cell currently being edited has had its data saved? 
    I would like to validate the cell's text data as it is being entered by a user, character by character.  If the validation fails, I would like to put up an error message and prevent the user from clicking outside of the cell.  I am able to validate the data and put up an error message.  But I have not found a way, if there is one, of disabling mouse clicks in other cells.  I've tried setting the IE's parent.editable, .enabled and .mouseEnabled properties to false.  But none of these are working for me.
    Thanks,
    -Adobegillisisle2

    The session does stay if I hit the TAB or RETURN keys.  I return false from my overridden save() function and the session stays keeping the user in the edit cell, allowing fixing the invalid data.   But I don't get the same behavior when I click the mouse on another cell.  In these cases, my save function is still called, and I still return false ( in the case where the validation fails ), but the edit session goes away. 

Maybe you are looking for