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.
arigsAsked:
Who is Participating?
 
zzynxConnect With a Mentor Software engineerCommented:
>> Really appreciate ur helping nature, thx a ton.
You're welcome.

>> I fixed it myself, actually it is typecasting fault. thats y it was not able to convert the data to messagecenterVo.
Oh I see now.

>> I am getting data as object when i unchecked label, otherwise i am getting it as messagecenterVo
When unchecking this line doesn't work out as expected:
var messageVo:MessageCenterVo = event.itemRenderer.data as MessageCenterVo;

See you
0
 
zzynxSoftware engineerCommented:
Your question is not at all clear to me.
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 ...
0
 
arigsAuthor Commented:
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(event:ListEvent):void
                  {
                        var messageVo:MessageCenterVo = event.itemRenderer.data as MessageCenterVo;
                        if(event.columnIndex == 3 )
                        {
                              if(messageVo.status == "Notices" )
                              {
                                    var statusConstructPopup:StatusConstructWindow = PopUpManager.createPopUp(this,StatusConstructWindow,true) as StatusConstructWindow;
                                    statusConstructPopup.width = this.width;
                                    statusConstructPopup.height = this.height;
                              }else if(messageVo.status == "Complete")
                              {
                                    Alert.show("u r wrong:");
                              }else if(messageVo.status == "Processing")

0
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
zzynxSoftware engineerCommented:
>> then i am getting error#1009.
On exactly what line of the code you posted?
0
 
zzynxSoftware engineerCommented:
>> 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...
0
 
arigsAuthor Commented:
below one is the default filter editor .
null-reference.bmp
0
 
arigsAuthor Commented:
if I close this editor after unchecking any label and then clicking on that column value then i am getting the null reference
0
 
zzynxSoftware engineerCommented:
>> 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?
0
 
arigsAuthor Commented:
at one of inside if conditions depends on the clicked value(i.e. if value is notices then at notices)
0
 
zzynxSoftware engineerCommented:
>> 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.
0
 
arigsAuthor Commented:
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?
0
 
zzynxSoftware engineerCommented:
>> 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.
0
 
arigsAuthor Commented:
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:Event):void
            {
                  
                  endEdit();
            }

0
 
zzynxSoftware engineerCommented:
Can you post the complete code of that filtereditor?
0
 
arigsAuthor Commented:
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.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.