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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

zzynxSr. Software 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
zzynxSr. Software engineerCommented:
>> then i am getting error#1009.
On exactly what line of the code you posted?
0
Powerful Yet Easy-to-Use Network Monitoring

Identify excessive bandwidth utilization or unexpected application traffic with SolarWinds Bandwidth Analyzer Pack.

zzynxSr. Software 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
zzynxSr. Software 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
zzynxSr. Software 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
zzynxSr. Software 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
zzynxSr. Software 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
zzynxSr. 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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Flex

From novice to tech pro — start learning today.