arigs
asked on
advanced datagrid problem flex 4
Hi experts,
I have a problem that in my application I am using adg with headerrenderers for each column. In headerrenderer I included dropdown menu which is having filter labels and checkboxes.
by default all checkboxes will be checked in initially. when all these labels are checked in initially, if click on any value of that column I am able to show corresponding popup . when i unchecked any filter label in dropdown menu and unchecked any filter label , then i click on any value of that column , I am getting error saying that TypeError: Error #1009: Cannot access a property or method of a null object reference.
anyone help me out, thanks in advance.
I have a problem that in my application I am using adg with headerrenderers for each column. In headerrenderer I included dropdown menu which is having filter labels and checkboxes.
by default all checkboxes will be checked in initially. when all these labels are checked in initially, if click on any value of that column I am able to show corresponding popup . when i unchecked any filter label in dropdown menu and unchecked any filter label , then i click on any value of that column , I am getting error saying that TypeError: Error #1009: Cannot access a property or method of a null object reference.
anyone help me out, thanks in advance.
ASKER
scenario:
1. by default all labels are checked . 2. uncheck any label and close the dropdown editor. 3 now click on any value of that column. then i am getting error#1009.
code:
protected function messDg_itemClickHandler(ev ent:ListEv ent):void
{
var messageVo:MessageCenterVo = event.itemRenderer.data as MessageCenterVo;
if(event.columnIndex == 3 )
{
if(messageVo.status == "Notices" )
{
var statusConstructPopup:Statu sConstruct Window = PopUpManager.createPopUp(t his,Status ConstructW indow,true ) as StatusConstructWindow;
statusConstructPopup.width = this.width;
statusConstructPopup.heigh t = this.height;
}else if(messageVo.status == "Complete")
{
Alert.show("u r wrong:");
}else if(messageVo.status == "Processing")
1. by default all labels are checked . 2. uncheck any label and close the dropdown editor. 3 now click on any value of that column. then i am getting error#1009.
code:
protected function messDg_itemClickHandler(ev
{
var messageVo:MessageCenterVo = event.itemRenderer.data as MessageCenterVo;
if(event.columnIndex == 3 )
{
if(messageVo.status == "Notices" )
{
var statusConstructPopup:Statu
statusConstructPopup.width
statusConstructPopup.heigh
}else if(messageVo.status == "Complete")
{
Alert.show("u r wrong:");
}else if(messageVo.status == "Processing")
>> then i am getting error#1009.
On exactly what line of the code you posted?
On exactly what line of the code you posted?
>> 1. by default all labels are checked
>> 2. uncheck any label and close the dropdown editor.
And maybe a screenshot of this would also help me to understand the situation...
>> 2. uncheck any label and close the dropdown editor.
And maybe a screenshot of this would also help me to understand the situation...
ASKER
below one is the default filter editor .
null-reference.bmp
null-reference.bmp
ASKER
if I close this editor after unchecking any label and then clicking on that column value then i am getting the null reference
>> if I close this editor after unchecking any label and then clicking on that column value then i am getting the null reference
And you get that error on exactly what line of the code you posted?
And you get that error on exactly what line of the code you posted?
ASKER
at one of inside if conditions depends on the clicked value(i.e. if value is notices then at notices)
>> at one of inside if conditions depends on the clicked value(i.e. if value is notices then at notices)
So, you mean at this line of code
if(messageVo.status == "Notices" )
This means that messageVo (or event.itemRenderer.data) is null where you don't expect it to be null.
You'll have to check - where the event is dispatched - that the event's data is filled in correctly.
So, you mean at this line of code
if(messageVo.status == "Notices" )
This means that messageVo (or event.itemRenderer.data) is null where you don't expect it to be null.
You'll have to check - where the event is dispatched - that the event's data is filled in correctly.
ASKER
yeah exactly, I am getting data as object when i unchecked label, otherwise i am getting it as messagecenterVo, can u guide me how to handle this?
>> I am getting data as object when i unchecked label, otherwise i am getting it as messagecenterVo
Don't understand what you really mean with that...
>> can u guide me how to handle this?
I'll try. If you provide me as much information as possible.
Don't understand what you really mean with that...
>> can u guide me how to handle this?
I'll try. If you provide me as much information as possible.
ASKER
when i am debugging without unchecking the filter labels , i am able to see the data(messagecenterVo).
if i unchecked the filter labels and then clicked on any value of the column, I was not able to see data i.e messagecenterVo is null. in this scenario debugging is taking me to the following point of filtereditor
protected function deactivateHandler(event:Ev ent):void
{
endEdit();
}
if i unchecked the filter labels and then clicked on any value of the column, I was not able to see data i.e messagecenterVo is null. in this scenario debugging is taking me to the following point of filtereditor
protected function deactivateHandler(event:Ev
{
endEdit();
}
Can you post the complete code of that filtereditor?
ASKER
zzynx:
Hi, thx for ur time and patience. I fixed it myself, actually it is typecasting fault. thats y it was not able to convert the data to messagecenterVo. Really appreciate ur helping nature, thx a ton.
Hi, thx for ur time and patience. I fixed it myself, actually it is typecasting fault. thats y it was not able to convert the data to messagecenterVo. Really appreciate ur helping nature, thx a ton.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
1. Post some code
>> I am getting error saying that TypeError: Error #1009: Cannot access a property or method of a null object reference.
2. Tell us on what line of your code you get this one.
3. Tell us your scenario in a step by step way:
1. I check that filter
2. I get that result (as expected)
3. Now I uncheck that filter label
4. I get that result while it should be ...