6 Replies Latest reply on May 15, 2012 6:38 AM by SAMPATH KUMAR AKIRALA

    Error #1009:  while loading datagrid in to appl

    SAMPATH KUMAR AKIRALA

      Below exeption showing while trying to load datagrid in to my application..

       

      TypeError: Error #1009: Cannot access a property or method of a null object reference.

      at mx.controls::DataGrid/createItemEditor()[E:\dev\4.0.0\frameworks\projects\framework\src\m x\controls\DataGrid.as:4325]

      at mx.controls::DataGrid/itemEditorItemEditBeginHandler()[E:\dev\4.0.0\frameworks\projects\f ramework\src\mx\controls\DataGrid.as:5237]

      at flash.events::EventDispatcher/dispatchEventFunction()

      at flash.events::EventDispatcher/dispatchEvent()

      at mx.core::UIComponent/dispatchEvent()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\co re\UIComponent.as:12266]

      at mx.controls::DataGrid/commitEditedItemPosition()[E:\dev\4.0.0\frameworks\projects\framewo rk\src\mx\controls\DataGrid.as:4093]

      at mx.controls::DataGrid/updateDisplayList()[E:\dev\4.0.0\frameworks\projects\framework\src\ mx\controls\DataGrid.as:1804]

      at mx.controls.listClasses::ListBase/validateDisplayList()[E:\dev\4.0.0\frameworks\projects\ framework\src\mx\controls\listClasses\ListBase.as:3962]

      at mx.managers::LayoutManager/validateClient()[E:\dev\4.0.0\frameworks\projects\framework\sr c\mx\managers\LayoutManager.as:932]

      at mx.core::UIComponent/validateNow()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\core \UIComponent.as:7631]

      at mx.managers::PopUpManagerImpl/centerPopUp()[E:\dev\4.0.0\frameworks\projects\framework\sr c\mx\managers\PopUpManagerImpl.as:485]

      at mx.managers::PopUpManager$/centerPopUp()[E:\dev\4.0.0\frameworks\projects\framework\src\m x\managers\PopUpManager.as:213]

        • 1. Re: Error #1009:  while loading datagrid in to appl
          luisborlido

          Can you show the code related with the datagrid? Are you assigning some itemRenderer?

          • 2. Re: Error #1009:  while loading datagrid in to appl
            SAMPATH KUMAR AKIRALA Level 1

            this is my code for datagrid... please check..

             

             

            <commoncomponents:ListDatagrid id="reportGroupDetailsListDG"

                                                           dataProvider="{ReportGroupDetailsModelLocator.getInstance().reportGroupVO.reportDefinitio nList}"

                                                           width="100%"

                                                           keyDown="{reportGroupDetailsHelper.handleDataGridKeyDown(event,

                                                                     Constants.VIEW_REPORT_GROUP,modelLocator.reportGroupVO.reportDefinitionList,ReportGroupDe tailComponent,'EX', -1);}"

                                                           keyUp="{reportGroupDetailsHelper.handleHotKeys(modelLocator.reportGroupVO.reportDefinitio nList,event,

                                                                                             EventConstants.REPORT_GROUP_EVENT,Constants.LIST_REPORT_GROUP_DETAILS,

                                                                                                 reportGroupDetailsHelper.displayError, Constants.PAGE_REPORT_GROUP, -1);}"

                                                           >

                                <commoncomponents:columns>

                                    <mx:DataGridColumn width="20"

                                                       headerText=""

                                                       dataField="userAction"

                                                       rendererIsEditor="true"

                                                       visible="{(reportGroupDetailsHelperVO.state == Constants.STATE_EDIT ||

                                                       reportGroupDetailsHelperVO.state == Constants.STATE_ADD_NEW) ? true : false}">

                                        <mx:itemRenderer>

                                            <mx:Component>

                                                <commoncomponents:BDCUserActionTextInput height="10"

                                                              width="10"

                                                              fontFamily="Arial"

                                                              fontWeight="bold"

                                                              textAlign="center"

                                                              maxChars="1"

                                                              restrict="XE"

                                                              text="{data.userAction}"

                                                              includeInLayout="{parentDocument.reportGroupDetailsHelperVO.state == Constants.STATE_EDIT ? true : false}">

                                                    <commoncomponents:keyDown>

                                                            <![CDATA[

                                                                ListItemVO(ReportGroupDetailsModelLocator.getInstance().reportGroupVO.reportDefinitionLis t.getItemAt

                                                                    (event.currentTarget.document.reportGroupDetailsListDG.selectedIndex)).userAction

                                                                = event.target.text;

                                                              ]]>

                                                    </commoncomponents:keyDown>

                                               

                                                <mx:Script>

                                                    <![CDATA[

                                                    import com.bnymellon.bds.bdc.ui.model.reportgroup.ReportGroupDetailsModelLocator;;

                                                    import com.bnymellon.bds.bdc.ui.vos.ListItemVO;

                                                    import com.bnymellon.bds.bdc.ui.utility.Constants;

                                                    ]]>

                                                </mx:Script>

                                                </commoncomponents:BDCUserActionTextInput>

                                            </mx:Component>

                                        </mx:itemRenderer>

                                    </mx:DataGridColumn>

                                    <mx:DataGridColumn editable="false"

                                                       headerText="Report Name"

                                                       dataField="command" width="120">

                                        <mx:itemRenderer>

                                            <mx:Component>

                                                <mx:HBox paddingLeft="5">

                                                    <mx:Text styleName="normalText"

                                                             text="{data.command}"/>

                                                </mx:HBox>

                                            </mx:Component>

                                        </mx:itemRenderer>

                                    </mx:DataGridColumn>

                                    <mx:DataGridColumn editable="false"

                                                       headerText="Access Level Id"

                                                       dataField="accountScopeID" width="150">

                                        <mx:itemRenderer>

                                            <mx:Component>

                                                <mx:HBox paddingLeft="5">

                                                    <mx:Text styleName="normalText"

                                                             text="{data.reportGroupScopeId}"/>

                                                </mx:HBox>

                                            </mx:Component>

                                        </mx:itemRenderer>

                                    </mx:DataGridColumn>

             

                                    <mx:DataGridColumn editable="false"

                                                       headerText="Security ID"

                                                       dataField="security" width="140">

                                        <mx:itemRenderer>

                                            <mx:Component>

                                                <mx:HBox paddingLeft="5">

                                                    <mx:Text styleName="normalText"

                                                             text="{data.security}"/>

                                                </mx:HBox>

                                            </mx:Component>

                                        </mx:itemRenderer>

                                    </mx:DataGridColumn>

             

                                    <mx:DataGridColumn editable="false"

                                                       headerText="Qualifier"

                                                       dataField="reportParam">

                                        <mx:itemRenderer>

                                            <mx:Component>

                                                <mx:HBox paddingLeft="5">

                                                    <mx:Text styleName="normalText" width="100%"

                                                             text="{data.parameter}"/>

                                                </mx:HBox>

                                            </mx:Component>

                                        </mx:itemRenderer>

                                    </mx:DataGridColumn>

             

                                    <mx:DataGridColumn editable="false"

                                                       headerText="FileType"

                                                       dataField="fileFormat" width="80">

                                        <mx:itemRenderer>

                                            <mx:Component>

                                                <mx:HBox paddingLeft="5">

                                                    <mx:Text styleName="normalText"

                                                             text="{'.' + data.fileFormat}"/>

                                                </mx:HBox>

                                            </mx:Component>

                                        </mx:itemRenderer>

                                    </mx:DataGridColumn>

             

                                </commoncomponents:columns>

                            </commoncomponents:ListDatagrid>

            • 3. Re: Error #1009:  while loading datagrid in to appl
              luisborlido Level 1

              Try to remove this line includeInLayout="{parentDocument.reportGroupDetailsHelperVO.state == Constants.STATE_EDIT ? true : false}". Other than that, I don't see nothing that could be causing the exception, without debbuging the code.

               

              Sorry if this doesn't help.

              • 5. Re: Error #1009:  while loading datagrid in to appl
                luisborlido Level 1

                What about BDCUserActionTextInput? Did you use it somewhere else? Can you post the code?

                • 6. Re: Error #1009:  while loading datagrid in to appl
                  SAMPATH KUMAR AKIRALA Level 1

                   

                   

                   

                   

                   

                   

                  private function BDCUserActionTextInput()

                  {

                  width = 10;

                  height=10;

                  maxChars=1;

                   

                  addEventListener(KeyboardEvent.KEY_DOWN, handleKeyDown);

                  addEventListener(Event.CHANGE, handleChange);

                  addEventListener(ResizeEvent.RESIZE, handleResize);

                  }

                   

                   

                   

                  How add item renderers at run time