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
Posts: 73
Registered: ‎11-16-2010
My Device: Playbook
Accepted Solution

Session 4 Sample Code Fix

Hey Everyone, 

 

Just wondering if anyone could explain why when trying to delete the first url added to the FeedManager, causes a crash saying the currentItem is a null object? It doesn't make any sense, since all other urls added are detected and act as they should, except for the first one.

 

Cheers,

decibell

----------------------------
Let's turn things up...
Developer
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: Session 4 Sample Code Fix

hey decibell,

 

there is an "error" in the code. apparently when the dropdown menu is created the selectedIndex value is null. that means when you go to the manage feeds page and see the drop down nothing is "selected". and when you hit the delete selected feed button you can obviously see that the first item on the list is "selected" but technically to the system nothing is selected initially. thats why u can delete subsequental items on the list without a problem cause you are actually selecting those items from the list before deleting. the workaround for this problem is as follows:

 

scroll down in your FullRSSReader.as class file to where it creates the dropdown menu (dp):

 

 

(...)

var dp:DropDown = new DropDown();
dp.rowHeight = 30;
dp.width = 250;
dp.x = 700;
dp.y = 40;
dp.dataProvider = feedManager.getSharedData();

(...)

 

 

at the end of that block of code you need to add the following bolded line:

 

 

var dp:DropDown = new DropDown();
dp.rowHeight = 30;
dp.width = 250;
dp.x = 700;
dp.y = 40;
dp.dataProvider = feedManager.getSharedData();
dp.selectedIndex = 0;

 

now when the dropdown is created on screen it defaults to the first item on the list as its selected item. and now the error should not show up anymore. hope that helps!

 

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
Developer
Posts: 73
Registered: ‎11-16-2010
My Device: Playbook

Re: Session 4 Sample Code Fix

Awesome JRab! Thanks so much, I was hoping it wasn't a bug. Cheers!
----------------------------
Let's turn things up...