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: 102
Registered: ‎01-12-2011
My Device: Blackberry Playbook
My Carrier: DiGi twitter@TylorPin

Source could not be found for qnx.ui.listClasses.CellRenderer.init when using the custom cell renderer class

I'm starting to learn coding and during one of the displaying data tutorial, (http://docs.blackberry.com/en/developers/deliverables/23959/Creating_a_custom_list_1446778_11.jsp)

I encountered this problem "source could not be found for qnx.ui.listClasses.CellRenderer.init in C:\Program Files\...". Any help with that?

Click "like" if my reply helps and click "Accept as Solution" if it solves your problem!

twitter @Twopinstudio
my vendor page https://appworld.blackberry.com/webstore/vendor/7126/?lang=en
Developer
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: Source could not be found for qnx.ui.listClasses.CellRenderer.init when using the custom cell renderer class

hey,

 

that error simply means that the place where the error occured was in the source file to a class in the QNX API library. normally it would bring you to the source where the error has occured, butsince we do not have access the source library for the QNX API, it will throw a source not found error. so to fix the error, you have to look at the errors before that line and go to your own source where the error originated to fix the problem. if you cant figure it out, you can always post a sample of the problem code on these forums and we'll help you figure it out. 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
Developer
Posts: 102
Registered: ‎01-12-2011
My Device: Blackberry Playbook
My Carrier: DiGi twitter@TylorPin

Re: Source could not be found for qnx.ui.listClasses.CellRenderer.init when using the custom cell renderer class

Here's the source code:

On the line override protected function init, there's this small arrow at the side(usually it's a cross when the line got error) and when i press the error, a dialogue box comes out and says "source could not be found for qnx.ui.listClasses.CellRenderer.init"

package  
{
     import flash.events.Event;
     import flash.events.MouseEvent;
	
     import qnx.ui.buttons.CheckBox;
     import qnx.ui.listClasses.AlternatingCellRenderer;
	
     public class MyCustomCellRenderer extends AlternatingCellRenderer 
     {
         private var myCB:CheckBox;
			
         public function MyCustomCellRenderer()
         {
         }
	
         override protected function init():void 
         {
             super.init();
			
             myCB = new CheckBox();
             myCB.x = 250;
             myCB.y = 10;
             this.addChild(myCB);
			
             myCB.addEventListener( MouseEvent.CLICK, onClick );
			
             //add this listener in order to block the mouse
             // down event from the list
             myCB.addEventListener( MouseEvent.MOUSE_DOWN, onMouseDown);
         }
		
         //this will prevent the cell from being selected 
         private function onMouseDown(event:MouseEvent):void 
         {
             event.stopImmediatePropagation();
         }
		
         private function onClick(event:MouseEvent):void 
         {
             dispatchEvent( new Event( Event.SELECT, true, true ) );
         }
     }
}
Click "like" if my reply helps and click "Accept as Solution" if it solves your problem!

twitter @Twopinstudio
my vendor page https://appworld.blackberry.com/webstore/vendor/7126/?lang=en
Developer
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: Source could not be found for qnx.ui.listClasses.CellRenderer.init when using the custom cell renderer class

there should be a stack trace near the bottom of your flash builder screen with a bunch of text and numbers. can you copy and paste that? it will tell us what line caused the problem before the init function. thanks!

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: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: Source could not be found for qnx.ui.listClasses.CellRenderer.init when using the custom cell renderer class

I'm going to guess that it is the addChild call in the init() function that is causing the error.  addChild should be done in the override function of onAdded and then removeChild called in the override function onRemoved.

 

If that is not it, move the stuff in the init() and place it in the constructor, execpt for the addChild call (follow idea above).

 

Just a guess.

Developer
Posts: 102
Registered: ‎01-12-2011
My Device: Blackberry Playbook
My Carrier: DiGi twitter@TylorPin

Re: Source could not be found for qnx.ui.listClasses.CellRenderer.init when using the custom cell renderer class

Here's what the error says 

 

 

Description Resource Path Location Type
A file found in a source-path can not have more than one externally visible definition. MCCR;CLS MCCR.as /MCCR/src Unknown Flex Problem

 

Description Resource Path Location TypeA file found in a source-path can not have more than one externally visible definition. MCCR;CLS MCCR.as /MCCR/src Unknown Flex Problem

 

what does that mean?

Click "like" if my reply helps and click "Accept as Solution" if it solves your problem!

twitter @Twopinstudio
my vendor page https://appworld.blackberry.com/webstore/vendor/7126/?lang=en
Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: Source could not be found for qnx.ui.listClasses.CellRenderer.init when using the custom cell renderer class

Do you have more than one file of the same name in different directories?  Do you have more than one file with the same name but different extensions?  Is the class in the file match the name of the file?

Developer
Posts: 102
Registered: ‎01-12-2011
My Device: Blackberry Playbook
My Carrier: DiGi twitter@TylorPin

Re: Source could not be found for qnx.ui.listClasses.CellRenderer.init when using the custom cell renderer class

here's what the dialogue box says

error.jpg

Click "like" if my reply helps and click "Accept as Solution" if it solves your problem!

twitter @Twopinstudio
my vendor page https://appworld.blackberry.com/webstore/vendor/7126/?lang=en
Highlighted
Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: Source could not be found for qnx.ui.listClasses.CellRenderer.init when using the custom cell renderer class

Waiting for moderator approval of image...  If you see it get approved, repost that it did.

Developer
Posts: 102
Registered: ‎01-12-2011
My Device: Blackberry Playbook
My Carrier: DiGi twitter@TylorPin

Re: Source could not be found for qnx.ui.listClasses.CellRenderer.init when using the custom cell renderer class

I got the solution already! In that tutorial, it requires 2 classes in the same package, as before this I did it wrongly and thus i suspect the problem might be the missing .init. But now I corrected it, and the apps run fine and I just ignored that problem. Thanks alot  for helping me Smiley Happy

Click "like" if my reply helps and click "Accept as Solution" if it solves your problem!

twitter @Twopinstudio
my vendor page https://appworld.blackberry.com/webstore/vendor/7126/?lang=en