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: 133
Registered: ‎12-02-2010
My Device: Z10 & Dev Alpha C
My Carrier: T
Accepted Solution

Custom AlternatingCellRenderer BB10 Air 2.0 Example Doesn't work

The following Custom AlternatingCellRenderer Class example from the BB10 Air 2.0 Documentation throws the following error in Flash Builder 4.6: 

 

Description    Resource    Path    Location    Type
1144: Interface method get listOwner in namespace qnx.fuse.ui.listClasses:ICellRenderer is implemented with an incompatible signature in class MyCustomCellRenderer.    MyCustomCellRenderer.as  

 

Documentation Example: https://developer.blackberry.com/air/beta/apis/qnx/fuse/ui/listClasses/AlternatingCellRenderer.html

 

Example Code:

package 
{
	import flash.events.Event;
	import flash.events.MouseEvent;
	
	import qnx.fuse.ui.buttons.CheckBox;
	import qnx.fuse.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
			//see the onMouseDown method to see how to stop the event propagation
			myCB.addEventListener( MouseEvent.MOUSE_DOWN, onMouseDown);
		}
		
		//this will prevent the cell from being selected when the button is clicked down
		private function onMouseDown(event:MouseEvent):void 
		{
			event.stopImmediatePropagation();
		}
		
		private function onClick(event:MouseEvent):void 
		{
			dispatchEvent( new Event( Event.SELECT, true, true ) );
		}
	}
}

 

---------------------------------------------------------------------
Developer of Stocks for Blackberry 10
Retired
Posts: 427
Registered: ‎02-22-2012
My Device: BlackBerry Z10, BlackBerry Dev Alpha C, BlackBerry PlayBook
My Carrier: Bell

Re: Custom AlternatingCellRenderer BB10 Air 2.0 Example Doesn't work

Make sure you follow steps 7 & 8 from the "Create an ActionScript Mobile AIR project" section of the documentation here - https://developer.blackberry.com/air/beta/documentation/create_your_first_application_fb_ms_2010840_...

 

Let me know if that helps and we can go from there.

 

Cheers,

Dustin

Follow me on Twitter: @dustinmalik
-----------------------------------------------------------------------------------------------------
Keep up to date on BlackBerry development: http://devblog.blackberry.com/
Developer
Posts: 133
Registered: ‎12-02-2010
My Device: Z10 & Dev Alpha C
My Carrier: T

Re: Custom AlternatingCellRenderer BB10 Air 2.0 Example Doesn't work

I already went through that guide and did all that. Here are the screen shots of my configuration.bb10_ane.jpgbb10_libs

---------------------------------------------------------------------
Developer of Stocks for Blackberry 10
Developer
Posts: 133
Registered: ‎12-02-2010
My Device: Z10 & Dev Alpha C
My Carrier: T

Re: Custom AlternatingCellRenderer BB10 Air 2.0 Example Doesn't work

Its working after I restarted my machine.. Something was weird with my environment. Thx

---------------------------------------------------------------------
Developer of Stocks for Blackberry 10