Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Residual display in List with change in dataProvider

I have a list that gets set with a new DataProvider with an Array:

 

this._list.dataProvider = null;
this._list.dataProvider = new DataProvider( data );
this._list.selectedIndex = (-1);

 

Everything is OK.

When this function gets called again, the information in list seems to get screwed up some.  I've inspected the this._list.dataProvider.data and the information looks good.  I have a custom renderer for the list, but I assume that if the dataProvider is cleared, the items defining the renderer would be cleared too.  The renderer extends AlternatingCellRenderer and only overrides drawLabel to properly position and set the values of the additional labels.

I override onRemoved and call removeChild on the additional resources.

I event tried only adding the additonal resources with onAdded, but the results are still the same; residual items from another part of the list gets sset elsewhere.

Any thoughts that I should investigate?

Please use plain text.
Developer
JRab
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: Residual display in List with change in dataProvider

hey john,

 

the residual data, is it coming from the cellrenderer? try resetting the cellrenderer before you add the new dataprovider and than reapplying the cellrenderer to the list with the new data.

J. Rab (Blog) (Twitter)
--
1. If you liked my post or found it useful please click on the thumbs up and provide a Like!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!

Approved Apps: OnTrack | ssShots | Hangman
Please use plain text.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: Residual display in List with change in dataProvider

That did not do it.  Appreciate the idea.

Please use plain text.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: Residual display in List with change in dataProvider

The pattern seems to be if the label in the renderer is left blank, the second (or third, ...) time it is used, picks up a label from another item in the list (always the last item in the list).  The first item in the list has a blank label.  If I default the label to (space) ' ', instead of blank, it seems to be fine.

 

@jrab: I hope you're working on your own projects.  You've been a big help to this forum!

Please use plain text.
Developer
JRab
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: Residual display in List with change in dataProvider

hey john,

 

haha thanks for your concern much appreciated :smileyvery-happy: yes i am working on my own stuff but whenever i run into a snag i come into here and help out and somehow it sparks a new random thought and helps me figure out what im gonna do next with my project. you could say its theraputic hah.

 

and as for the residual data, im trying to replicate the problem but cant seem to. your list might be a little more involved than the example im using here. ill keep looking into it and if i can come up with anything ill let you know . good luck!

J. Rab (Blog) (Twitter)
--
1. If you liked my post or found it useful please click on the thumbs up and provide a Like!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!

Approved Apps: OnTrack | ssShots | Hangman
Please use plain text.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: Residual display in List with change in dataProvider

Add a second QNX label to the renderer and try setting both via the data given to the data provider.

Please use plain text.