You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by m_awais1947 <mr...@gmail.com> on 2018/01/11 18:13:17 UTC

Adobe flex 4.0 data grid error "null reference object", when clicked for first time

Hi,

I am working on Adobe Flash Builder and Flex 4. i am facing a problem with
data grid. When data grid is populated for the first time and clicked on
editable column it gives "null reference object error"
<http://apache-flex-users.2333346.n4.nabble.com/file/t1155/gridError.png> 

However, when grid is populated secod time and clicked on editable column,
it does'nt generate error. I have debugged the code, and get to know that
when grid is populated for first time and clicked, the selectedItem is not
null. Still i am not able to find out why this "null reference object" error
keeps appearing. Apart from that there is no such code which access the grid
items.

Thanks in advance!

Regards,
awais



--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/

Re: Adobe flex 4.0 data grid error "null reference object", when clicked for first time

Posted by Kyle McKnight <ka...@gmail.com>.
Flex usually creates a "temporary" item renderer initially to get a default
size for the item renderers. In your data setter method for your renderer
you should check for null value fo the passed data. If it is null then jut
return and do nothing. Sometimes you might also have not just return but
set any default properties on your renderer since renderers get reused.


Kyle


Kyle McKnight
Senior UI Engineer - Accesso
321.347.7318 (M)


On Thu, Jan 11, 2018 at 1:13 PM, m_awais1947 <mr...@gmail.com> wrote:

> Hi,
>
> I am working on Adobe Flash Builder and Flex 4. i am facing a problem with
> data grid. When data grid is populated for the first time and clicked on
> editable column it gives "null reference object error"
> <http://apache-flex-users.2333346.n4.nabble.com/file/t1155/gridError.png>
>
> However, when grid is populated secod time and clicked on editable column,
> it does'nt generate error. I have debugged the code, and get to know that
> when grid is populated for first time and clicked, the selectedItem is not
> null. Still i am not able to find out why this "null reference object"
> error
> keeps appearing. Apart from that there is no such code which access the
> grid
> items.
>
> Thanks in advance!
>
> Regards,
> awais
>
>
>
> --
> Sent from: http://apache-flex-users.2333346.n4.nabble.com/
>