473,379 Members | 1,184 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

The code is crashing while removing column from AdvancedDataGrid.

Hello All,
I am facing problem while removing the columns from
AdvancedDataGrid. It is crashing at one point and i am unable to
resolve it.

The code i'm using to remove the columns is like this.
Expand|Select|Wrap|Line Numbers
  1.                public function clearPlot():void
  2.                {
  3.                        cols = cols.slice(0, 0);
  4.  
  5.                        this.columns = cols;
  6.                        this.validateNow();
  7.                }
  8.  
The class is extending AdvancedDataGrid and the variable "cols" is an
Array type. And also i have tried many variations, but none of
them solved the problem. So i'm giving the variations also.

[1]
Expand|Select|Wrap|Line Numbers
  1.                public function clearPlot():void
  2.                {
  3.                        cols = cols.slice(0, 0);
  4.                        cols.push(new AdvancedDataGridColumn(""));
  5.  
  6.                        this.columns = cols;
  7.                        this.validateNow();
  8.                }
  9.  
[2]
Expand|Select|Wrap|Line Numbers
  1.              public function clearPlot():void
  2.                {
  3.                        cols = new Array();
  4.                        cols.push(new AdvancedDataGridColumn("dummy"));
  5.  
  6.                        this.columns = cols;
  7.                        this.validateNow();
  8.                }
  9.  
[3]
Expand|Select|Wrap|Line Numbers
  1.              public function clearPlot():void
  2.                {
  3.                        cols = new Array();
  4.  
  5.                        this.columns = cols;
  6.                        this.validateNow();
  7.                }
  8.  
[4]
Expand|Select|Wrap|Line Numbers
  1.              public function clearPlot():void
  2.                {
  3.                        this.columns = null;
  4.                        this.validateNow();
  5.                }
  6.  
[5]
Expand|Select|Wrap|Line Numbers
  1.              public function clearPlot():void
  2.                {
  3.                        cols = null;
  4.                        cols = new Array();
  5.  
  6.                        this.columns = cols;
  7.                        this.validateNow();
  8.                }
  9.  
The error is like this:

TypeError: Error #1009: Cannot access a property or method of a null
object reference.
at mx.controls::AdvancedDataGridBaseEx/http://www.adobe.com/2006/flex/
mx/internal::getHeaderInfo()[C:\work\flex\dmv_automation\projects
\datavisualisation\src\mx\controls\AdvancedDataGri dBaseEx.as:2366]
at mx.controls::AdvancedDataGrid/http://www.adobe.com/2006/flex/mx/
internal::getHeaderInfo()[C:\work\flex\dmv_automation\projects
\datavisualisation\src\mx\controls\AdvancedDataGri d.as:2147]
at mx.controls::AdvancedDataGrid/getFieldSortInfo()[C:\work\flex
\dmv_automation\projects\datavisualisation\src\mx\ controls
\AdvancedDataGrid.as:6840]
at
mx.controls.advancedDataGridClasses::AdvancedDataG ridHeaderRenderer/
getFieldSortInfo()[C:\work\flex\dmv_automation\projects
\datavisualisation\src\mx\controls\advancedDataGri dClasses
\AdvancedDataGridHeaderRenderer.as:757]
at
mx.controls.advancedDataGridClasses::AdvancedDataG ridHeaderRenderer/
updateDisplayList()[C:\work\flex\dmv_automation\projects
\datavisualisation\src\mx\controls\advancedDataGri dClasses
\AdvancedDataGridHeaderRenderer.as:560]
at mx.core::UIComponent/validateDisplayList()[C:\autobuild
\3.3.0\frameworks\projects\framework\src\mx\core\U IComponent.as:6351]
at mx.managers::LayoutManager/validateDisplayList()[C:\autobuild
\3.3.0\frameworks\projects\framework\src\mx\manage rs\LayoutManager.as:
622]
at mx.managers::LayoutManager/doPhasedInstantiation()[C:\autobuild
\3.3.0\frameworks\projects\framework\src\mx\manage rs\LayoutManager.as:
695]
at Function/http://adobe.com/AS3/2006/builtin::apply()
at mx.core::UIComponent/callLaterDispatcher2()[C:\autobuild
\3.3.0\frameworks\projects\framework\src\mx\core\U IComponent.as:8628]
at mx.core::UIComponent/callLaterDispatcher()[C:\autobuild
\3.3.0\frameworks\projects\framework\src\mx\core\U IComponent.as:8568]


And i'm giving the stack trace also. It is:
mx.controls::AdvancedDataGridBaseEx/http://www.adobe.com/2006/flex/mx/
internal::getHeaderInfo
mx.controls::AdvancedDataGrid/http://www.adobe.com/2006/flex/mx/
internal::getHeaderInfo
mx.controls::AdvancedDataGrid/getFieldSortInfo
mx.controls.advancedDataGridClasses::AdvancedDataG ridHeaderRenderer/
getFieldSortInfo
mx.controls.advancedDataGridClasses::AdvancedDataG ridHeaderRenderer/
updateDisplayList
mx.core::UIComponent/validateDisplayList
mx.managers::LayoutManager/validateDisplayList
mx.managers::LayoutManager/doPhasedInstantiation
Function/http://adobe.com/AS3/2006/builtin::apply [no source]
mx.core::UIComponent/callLaterDispatcher2
mx.core::UIComponent/callLaterDispatcher


Please help me in solving this.
Jan 10 '11 #1
0 1503

Sign in to post your reply or Sign up for a free account.

Similar topics

25
by: delerious | last post by:
I see some code examples like this: <DIV onmouseover="this.style.background='blue'"> and other code examples like this: <DIV onmouseover="javascript:this.style.background='blue'"> Which...
3
by: Shravan Kumar | last post by:
Hi, I am using my code to set column widths of datagrid columns dynamically, but when I am setting the column widths to zero, the header text of the column whose width is made to zero is...
0
by: Bala | last post by:
Hi, i added the column in datagrid like the below code. then when i try to add row using this code it says "Column 'ImpNo' does not belong to table ". whats the problem? create a column code:...
24
by: Kunal | last post by:
Hello, I need help in removing if ..else conditions inside for loops. I have used the following method but I am not sure whether it has actually helped. Below is an example to illustrate what I...
6
by: Mike S | last post by:
Hi all, A (possibly dumb) question, but I've had no luck finding a definitive answer to it. Suppose I have two tables, Employees and Employers, which both have a column named "Id": Employees...
10
by: Mythmon | last post by:
I am trying to make a program that will basically simulate a chess clock in python. To do this I have two threads running, one that updates the currently running clock, and one that watches for a...
5
momotaro
by: momotaro | last post by:
this program is to double space the lines but it works perfectly but there is two "unusfull lines in my point of view since i tried every possible version to see if the any porblem will hapen if...
0
by: johnmott | last post by:
Hi all, I've added a sample application that shows how to deal with a sticky problem that we all eventually encounter with the GridView control -- there is no built-in way to have a column of...
5
by: =?Utf-8?B?TWlrZSBPS0M=?= | last post by:
How do I get the width of a column using Type Datasets? I don't want to know the length of the data in the column, I want to know the width of the column. In my code, if the column width is 50...
7
n8kindt
by: n8kindt | last post by:
this is what i have: Right$(,(Len()-1)) it works but i'm just curious... is there a built-in function that is better than this?
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.