02-13-2012 02:57 PM
Do this:
import flash.display.Sprite;
import qnx.fuse.ui.listClasses.List;
import qnx.ui.data.DataProvider;
[SWF(height="1024", width="600", frameRate="30", BackgroundColor="#000000")]
public class test3 extends Sprite
{
public function test3()
{
var l:List = new List();
l.dataProvider = new DataProvider([{label:1},{label:2}]);
l.setPosition(200,200);
l.width = 200;
l.height = 200;
addChild(l);
}
}
And run the application.
Point the finger right below the last row in the list and swipe up or down.
You get this:
TypeError: Error #1009: Cannot access a property or method of a null object reference. at qnx.fuse.ui.listClasses::List/resetCellState()[E:\hudson\workspace\GR2_0_0_AIR_SDK_API\src\qnxui\src \qnx\fuse\ui\listClasses\List.as:2532] at qnx.fuse.ui.listClasses::List/deselectCellDown()[E :\hudson\workspace\GR2_0_0_AIR_SDK_API\src\qnxui\s rc\qnx\fuse\ui\listClasses\List.as:2337] at qnx.fuse.ui.listClasses::List/scrollMouseMove()[E: \hudson\workspace\GR2_0_0_AIR_SDK_API\src\qnxui\sr c\qnx\fuse\ui\listClasses\List.as:2349]
How do I trap this? Is this a bug of the qnx.fuse.up.listClasses.List component?
Solved! Go to Solution.
02-13-2012 03:31 PM
After typing this post I went back to SDK download page and noticed there is a new 2.0.0 SDK available (dated February 3rd, 2012). I was using previous SDK version dated January 16th , 2012.
So I went ahead and upgraded to the latest SDK and this error no longer occurs!
It must have been a bug.
So I (sort of) solved my own problem.. Kudos to me... ha!
02-21-2012 05:27 PM
@P3pp3r,
I am running into the same issue over here I thought it might be on the custom renderer that I created but I am still running into this issue.
I see the issue once its adding the Playbook. I do have the latest SDK. I have zero clue.
var colors:Array=[];
// add objects with a label property
var total:Number = Colors.DEFAULT.length;
for(var i:Number=0;i<total;i++) {
colors[i] = {color:Colors.DEFAULT[i]};
}
var myList:List = new List();
myList.setPosition(0, 0);
myList.width = 269;
myList.height = 70;
myList.columnWidth = 60;
//set the dataProvider
myList.scrollDirection = ScrollDirection.HORIZONTAL;
myList.dataProvider = new DataProvider(colors);
myList.cellRenderer = MyCustomCellRenderer;
myList.addEventListener(ListEvent.ITEM_CLICKED, onListClick);
myList.addEventListener(ScrollEvent.SCROLL_END, onScroll);
myList.addEventListener(ScrollEvent.SCROLL_BEGIN, onScrollStart);
this.addChild(myList);and Renderer:
package renderers {
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.geom.ColorTransform;
import qnx.fuse.ui.listClasses.AlternatingCellRenderer;
import qnx.fuse.ui.listClasses.CellRenderer;
import qnx.ui.buttons.CheckBox;
public class MyCustomCellRenderer extends CellRenderer {
public var ct:ColorTransform;
public function MyCustomCellRenderer() {
ct = new ColorTransform();
}
override protected function init():void {
super.init();
}
override public function set data(value:Object):void {
super.data = value;
if (value != null) {
ct.color = this.data.color
this.transform.colorTransform = ct;
}
super.invalidateDisplayList();
}
//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 ) );
}
}
}
02-21-2012 06:53 PM
02-21-2012 07:01 PM
02-21-2012 07:11 PM
Might seem odd but try:
for(var i:int=0;i<total;i++)
{
colors[i] = {data:Colors.DEFAULT[i], label : 'color ' + String( i ) };
}
02-21-2012 10:22 PM
02-21-2012 11:52 PM
02-22-2012 02:33 AM