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

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

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

m_awais1947
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/
Reply | Threaded
Open this post in threaded view
|

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

kamcknig
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 <[hidden email]> 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/
>