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

  • Home
  • SEARCH
  • 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 7945509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T00:53:10+00:00 2026-06-04T00:53:10+00:00

I have a CustomDataGrid that extends from DataGrid and CustomDataGridColumn that extends from DataGridColumn.

  • 0

I have a CustomDataGrid that extends from DataGrid and CustomDataGridColumn that extends from DataGridColumn.

CustomDataGridColumn has member variables of type Function.

Inside my view, I inject a presentation model using parsley.

The code is as follows:

<fx:Declarations> 
        <spicefactory:Configure/> 
    </fx:Declarations> 

<fx:Script> 

        [Inject(id="associatedDocumentsPM")] 
        [Bindable] 
        public var model:AssociatedDocumentsPM; 


</fx:Script> 

   <customDataGrid:CustomDataGrid id="AssocDocGrid" 
                                   width="100%" height="{(documentDataList.length+2)*20}" 
                                   doubleClickEnabled="true" enabled="{modeHandler.appEnable}" 
                                   dataP="{documentDataList}" 
                                   sortableColumns="false"> 
        <customDataGrid:columnList> 
            <customDataGrid:CustomDataGridColumn 
                textAlign="left" 
                dataFieldIdentifier="documentName" 
                headerText="Document Type" 
                modifyLabelField="{model.modifyLabelField}" 
                dataField="documentName" 
                isNaNZero="true" 
                showDataTips="true" 
                editable="false"/> 
                ...more columns here...  
       </customDataGrid:columnList>
    </customDataGrid:CustomDataGrid>

The AssociatedDocumentsPM has functions defined and these are set in the columns.

One example being for attribute modifyLabelField="{model.modifyLabelField}"

CustomDataGridColumn.myLabelField is of type Function. myLabelField inside AssociatedDocumentsPM is a public function.

The Parsley Context file is in the parent of the above file and declares the PM as follows:

AssocDocPMFactory is a class with a sole function decorated with [Factory].

So the problem is the following:

When I debug the application and check the columnList of the DataGrid, the variable modifyLabelField is null.

Are function bindings treated differently than variables? I’m using Flex 4.5.1 together with Parsley 2.4.1

I understand that injection could happen after creationComplete is invoked but I thought the binding would take care of that.

I have a feeling that the model – the PM – is null until much much later and the function binding is not triggered.

I tried to use FastInject as well but to no avail.

Is this a problem with function pointers and Flex binding?

  • 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-06-04T00:53:12+00:00Added an answer on June 4, 2026 at 12:53 am

    No it isn’t. If you have these kind of doubts, it’s always a good idea to quickly set up a simple isolated test situation that verifies your assumption. I created the following to test yours:

    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
                   xmlns:s="library://ns.adobe.com/flex/spark" 
                   creationComplete="onCreationComplete()" >
    
        <fx:Script>
            <![CDATA[
                private function onCreationComplete():void {
                    test = function(item:*):String {
                        return "AAA";
                    }
                }
    
                [Bindable]
                private var test:Function;
            ]]>
        </fx:Script>
    
        <s:List labelFunction="{test}">
            <s:dataProvider>
                <s:ArrayList>
                    <fx:String>A</fx:String>
                    <fx:String>B</fx:String>
                    <fx:String>C</fx:String>
                </s:ArrayList>
            </s:dataProvider>
        </s:List>
    
    </s:Application>
    

    If the test Function variable is declared Bindable, you’ll see 3 times “AAA”. If you remove the Bindable metadata, you’ll see “A”, “B”, “C”.

    So clearly binding works with function pointers too (and you’ll have to look elsewhere to find your nullpointer).

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

Sidebar

Related Questions

I have a custom dataGrid that acts more like a 2D list (if that
Have a matrix report now that has Position, Hours and Wages for a location
I have a custom datagrid in my application that when its source is empty
Have a fun issue with sharepoint calendar view filtering. That code works fine: SPSecurity.RunWithElevatedPrivileges(delegate()
I have a custom DataGrid mixed with DataGridTemplateColumns and a custom behavior derived from
Have following setup: MainActivity class - extends activity MyLayout class - extends View Prefs
Have data that has this kind of structure. Will be in ascending order by
Have data that has this kind of structure: $input = [ { animal: 'cat',
Have an issue with jquery autocomplete, focus function After i type something in the
Have a SomeLib.pro file that contains: CONFIG += debug TEMPLATE = lib TARGET =

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.