Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6085569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:39:12+00:00 2026-05-23T11:39:12+00:00

My issue is that when a user clicks a datagrid cell that has a

  • 0

My 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:

<mx:DataGridColumn  
                                headerText="Field Name" 
                                dataField="attribId"
                                editorDataField="attributeId"
                                labelFunction="getFieldName">

Here is the Item editor

                            <mx:itemEditor>

                                <mx:Component>

                                    <mx:ComboBox 
                                        dataProvider="{this.outerDocument.lendersModel.fileAttributes}"
                                        creationComplete="{outerDocument.selectAttribute();}"
                                        labelField="fileAttribDesc"
                                        change="updateAttribute(event);"
                                        selectedIndex="-1">


                                        <mx:Script>
                                            <![CDATA[                                                   
                                                [Bindable]
                                                public var attributeId:int;
                                                private var fileDetailRecordType:String;

                                                override public function set data( value:Object ):void{
                                                    this.attributeId = value.attribId; // adding this line appears to be the fix. 
                                                    var category:String = value.category;

                                                    this.filterFileAttributes( category );
                                                }

                                                /** Change handler for combobox in Record Type column.  
                                                 */
                                                private function filterFileAttributes( recordType:String ):void{
                                                    this.fileDetailRecordType = recordType;

                                                    this.dataProvider.filterFunction = filterByRecordType;
                                                    this.dataProvider.refresh();
                                                }

                                                /** Filters the file attributes collection based on the record type. 
                                                 */
                                                private function filterByRecordType( item:Object ):String{
                                                    return item.category.match( this.fileDetailRecordType );
                                                }

                                                private function updateAttribute( event:* ):void{ 
                                                    attributeId = event.currentTarget.selectedItem.attribId;
                                                    this.outerDocument.selectedAttributeId = attributeId;
                                                }

                                            ]]>
                                        </mx:Script>

                                    </mx:ComboBox> 

                                </mx:Component>

                            </mx:itemEditor>

and here is the label function for the DataGridColumn.

        private function getFieldName( item:Object, dgc:DataGridColumn ):String{
            var fieldName:String = '';

            /* At this point the lendersModel.fileAttributes collection is
               filtered based on the record type. We need to remove the filter
               so we can search the entire collection, not just the filtered subset. */
            lendersModel.fileAttributes.filterFunction = refreshFilter;
            lendersModel.fileAttributes.refresh();

            for each( var attrib:FileAttributeDTO in lendersModel.fileAttributes ){
                if( attrib.attribId == item.attribId )
                    fieldName = attrib.fileAttribDesc;
            }

            return fieldName;
        }

And here is the code executed in the itemEditEndHandler for the Datagrid:

var rowCount:int = fieldsGridEmpty.selectedIndex;
var attribCombo:ComboBox = ComboBox( fieldsGridEmpty.itemEditorInstance );

                if( rowCount != -1 && attribCombo.selectedItem != null )
                {                                                           
                    newFieldsDp[ rowCount ].fileAttribute.dataType = attribCombo.selectedItem.dataType;                                         
                    newFieldsDp[ rowCount ].fileAttribute.dataLength = attribCombo.selectedItem.dataLength; 
                    newFieldsDp[ rowCount ].fileAttribute.fileAttribDesc = attribCombo.selectedLabel;   
                    newFieldsDp[ rowCount ].dataLength = attribCombo.selectedItem.dataLength;       
                    newFieldsDp[ rowCount ].attribId = attribCombo.selectedItem.attribId;   
                }  

Now, the item edit handler shows a valid value for ‘attribId’:

newFieldsDp[ rowCount ].attribId = attribCombo.selectedItem.attribId;

However, the label function gets executed after this and the value for item.attribId is 0. And that’s the reason ‘fieldName’ is an empty String, because there’s no match.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T11:39:13+00:00Added an answer on May 23, 2026 at 11:39 am

    My fix mentioned in the comments seems to work. The underlying problem is that the editorDataField property was only set when the user interacted with the combobox.

    I remedied that problem by setting it in the override public function set data() method. In this manner, as soon as a user touches it, it is set.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I believe I have a potential threading issue. I have a user control that
I have a page that when the user clicks a button there is a
I have div called panel that itself contains another div. When a user clicks
I have a several divs that a refreshed using Ajax after the user clicks
Context: User is currently in the following page: http://myinternaldomain.com/page/ Issue: When user clicks on
I'm writing my own sessions controller that issues a unique id to a user
The issue that prompted me to ask this is a web form that was
I have an issue that is driving me a bit nuts: Using a UserProfileManager
An odd issue that I have been trying to address in a project -
I have a database issue that i currently cannot wrap my head around with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.