Error in datagrid
<mx:DataGridColumn headerText="Type"
dataField="serviceCategoryDesc"
editable="false" width="120">
<mx:itemRenderer>
<mx:Component>
<mx:VBox>
<mx:ComboBox id="category_cb"
dataProvider="{outerDocument.acServiceCategory}"
labelField="label"
width="120"/>
</mx:VBox>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
Hi All,
I got an error in the dataProvider for my comboBox that is
inside of the
datagrid.
Data binding will not be able to detect assignments to
"acServiceCategory".
Any ideas why?
Tks
JFB
is acServiceCategory set to [Bindable] ?
e.g.
[Bindable]
private var acServiceCategory:ArrayCollection;
Similar Messages
-
Flex 4 - Error with DataGrid in Module
Hey, I'm using Flex 4 final and am now getting the following error when loading a Module with a DataGrid inside:
TypeError: Error #1009: Cannot access a property or method of a null object reference
at mx.styles::StyleProtoChain$/initProtoChainForUIComponentStyleName()[E:\dev\4.0.0\framewor ks\projects\framework\src\mx\styles\StyleProtoChain.as:356]
It is created via MXML:
<mx:Module layout="absolute" xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx">
<mx:DataGrid>
... config etc.
</mx:DataGrid>
... other code
</mx:Module>
If I remove the DataGrid the Module works fine. The code used to work in the various betas.
If I put a DataGrid in the main application that also renders fine, so it's only inside Modules.
Thanks in advance for any help or ideas!Hi Darrell,
I have the exact same error, and yes I am using module.factory.create() but I get an error when I try to add the module to my stage. Here it is the code in my modReady function.
var _sd:Object = new Object();
_sd = util.app.SDModule.factory.create() as SequenceDetail;
_sd.sequenceId = event.currentTarget.selectedItem.sequenceId;
_sd.environment = event.currentTarget.selectedItem.environment;
_sd.seqname = event.currentTarget.selectedItem.sequenceName;
util.app.page.addChildAt(_sd as SequenceDetail, util.app.page.numChildren);
util.app.nav_buttons.selectedIndex = -1;
util.app.page.selectedIndex = util.app.page.numChildren-1;
I get an error on util.app.page.addChildAt(........).
error is
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at mx.styles::StyleProtoChain$/initProtoChainForUIComponentStyleName()[E:\dev\4.0.0\framewor ks\projects\framework\src\mx\styles\StyleProtoChain.as:356]
at mx.styles::StyleProtoChain$/initProtoChain()[E:\dev\4.0.0\frameworks\projects\framework\s rc\mx\styles\StyleProtoChain.as:171]
at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::initProtoChain()[E:\dev\4.0.0\frameworks\proje cts\framework\src\mx\core\UIComponent.as:10186]
at mx.core::UIComponent/regenerateStyleCache()[E:\dev\4.0.0\frameworks\projects\framework\sr c\mx\core\UIComponent.as:10249]
at mx.core::Container/regenerateStyleCache()[E:\dev\4.0.0\frameworks\projects\framework\src\ mx\core\Container.as:3737]
at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::addingChild()[E:\dev\4.0.0\frameworks\projects \framework\src\mx\core\UIComponent.as:7114]
at mx.core::Container/http://www.adobe.com/2006/flex/mx/internal::rawChildren_addChild()[E:\dev\4.0.0\frameworks \projects\framework\src\mx\core\Container.as:4464]
at mx.core::ContainerRawChildrenList/addChild()[E:\dev\4.0.0\frameworks\projects\framework\s rc\mx\core\ContainerRawChildrenList.as:143]
at mx.containers::TabNavigator/createChildren()[E:\dev\4.0.0\frameworks\projects\framework\s rc\mx\containers\TabNavigator.as:559]
at mx.core::UIComponent/initialize()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\core\ UIComponent.as:7250]
at mx.core::Container/initialize()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\core\Co ntainer.as:3129]
at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::childAdded()[E:\dev\4.0.0\frameworks\projects\ framework\src\mx\core\UIComponent.as:7142]
at mx.core::Container/http://www.adobe.com/2006/flex/mx/internal::childAdded()[E:\dev\4.0.0\frameworks\projects\ framework\src\mx\core\Container.as:3951]
at mx.core::Container/addChildAt()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\core\Co ntainer.as:2616]
at mx.core::Container/addChild()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\core\Cont ainer.as:2534]
at mx.core::Container/createComponentFromDescriptor()[E:\dev\4.0.0\frameworks\projects\frame work\src\mx\core\Container.as:4371]
at mx.core::Container/createComponentsFromDescriptors()[E:\dev\4.0.0\frameworks\projects\fra mework\src\mx\core\Container.as:4160]
at mx.containers::Panel/createComponentsFromDescriptors()[E:\dev\4.0.0\frameworks\projects\f ramework\src\mx\containers\Panel.as:1685]
at mx.core::Container/createChildren()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\cor e\Container.as:3187]
at mx.containers::Panel/createChildren()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\c ontainers\Panel.as:1198]
at mx.core::UIComponent/initialize()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\core\ UIComponent.as:7250]
at mx.core::Container/initialize()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\core\Co ntainer.as:3129]
at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::childAdded()[E:\dev\4.0.0\frameworks\projects\ framework\src\mx\core\UIComponent.as:7142]
at mx.core::Container/http://www.adobe.com/2006/flex/mx/internal::childAdded()[E:\dev\4.0.0\frameworks\projects\ framework\src\mx\core\Container.as:3951]
at mx.core::Container/addChildAt()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\core\Co ntainer.as:2616]
at mx.core::Container/addChild()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\core\Cont ainer.as:2534]
at mx.core::Container/createComponentFromDescriptor()[E:\dev\4.0.0\frameworks\projects\frame work\src\mx\core\Container.as:4371]
at mx.core::Container/createComponentsFromDescriptors()[E:\dev\4.0.0\frameworks\projects\fra mework\src\mx\core\Container.as:4160]
at mx.core::Container/createChildren()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\cor e\Container.as:3187]
at mx.core::UIComponent/initialize()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\core\ UIComponent.as:7250]
at mx.core::Container/initialize()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\core\Co ntainer.as:3129]
at SequenceDetail/initialize()
at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::childAdded()[E:\dev\4.0.0\frameworks\projects\ framework\src\mx\core\UIComponent.as:7142]
at mx.core::Container/http://www.adobe.com/2006/flex/mx/internal::childAdded()[E:\dev\4.0.0\frameworks\projects\ framework\src\mx\core\Container.as:3951]
at mx.core::Container/addChildAt()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\core\Co ntainer.as:2616]
at mx.containers::ViewStack/addChildAt()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\c ontainers\ViewStack.as:1426]
at com::MyDBResult/displaySequenceDetail()[/Users/jbhavsar/Documents/workspace/virome/src/co m/MyDBResult.as:114]
at <anonymous>()[/Users/jbhavsar/Documents/workspace/virome/src/com/MyDBResult.as:103]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at ModuleInfoProxy/moduleEventHandler()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\mo dules\ModuleManager.as:1168]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at ModuleInfo/readyHandler()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\modules\Modul eManager.as:812]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::FlexModuleFactory/update()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\cor e\FlexModuleFactory.as:433]
at mx.core::FlexModuleFactory/docFrameHandler()[E:\dev\4.0.0\frameworks\projects\framework\s rc\mx\core\FlexModuleFactory.as:582]
at mx.core::FlexModuleFactory/docFrameListener()[E:\dev\4.0.0\frameworks\projects\framework\ src\mx\core\FlexModuleFactory.as:126]
Thanks
Jay
p.s: Please dont hammer me if my code isn't upto standard, I am learning this as I go along. -
Comma prompt error in datagrid
I had created a timetable in the datagrid. The datagrid is
able to display individual staff's tiimetable. However, I was
prompt an error when I click on this particular staff to view the
class schedule. I found out that the error is caused by a comma in
the rows in the database while the other individual staff's
timetable works fine without any comma found in the the rows.
The Error
http://i192.photobucket.com/albums/z63/nellehs/error.jpg
Particular Row
http://i192.photobucket.com/albums/z63/nellehs/databasecopy.jpg
Codes in Flex
<mx:DataGrid x="10" y="155" dataProvider="{timetable}"
width="1004" height="383" id="tableCol">
<mx:columns>
<mx:DataGridColumn headerText="Day" dataField="day"
width="50"/>
<mx:DataGridColumn headerText="Start" dataField="start"
width="50"/>
<mx:DataGridColumn headerText="End" dataField="end"
width="50"/>
<mx:DataGridColumn headerText="Subject"
dataField="mod"/>
<mx:DataGridColumn headerText="Room" dataField="room"/>
</mx:columns>
</mx:DataGrid>
Must I edit the codes in the PHP file or the codes in
Flex?"fypstudent" <[email protected]> wrote in
message
news:g9rfq4$91g$[email protected]..
> Hi, I do not sure how to check if i assign a normal
object type to the
> array
> collection. The codes are attached below. Did i did
wrongly to call the
> array
> out?
>
>
> /Array Collection for timetable
> [Bindable]
> private var timetable:ArrayCollection = new
ArrayCollection();
>
> private function
timetableHandler(event:ResultEvent):void
> {
> timetable = event.result.staffsignage.timetable;
> }
>
> //HTTP Service for calling timetable
> <mx:HTTPService id="allData"
> url="
http://localhost/timetableTest/src/scripts/timetable.php"
> result="timetableHandler(event)" method="POST"
showBusyCursor = "true">
> <mx:request xmlns="">
>
<staffid>{selectedProfileID.staffid}</staffid>
> </mx:request>
> </mx:HTTPService>
Have you done anything on the web service side to ensure that
the object
coming back is an ArrayCollection? I think you need to use
something like
JSON to make that happen, but I'm not a webservice person.
Are you sure that you ought to be using a HTTPService here?
Maybe what you
need is HTTPRequest instead. -
Getting error on DataGrid click
Flex Builder 3 build 3.0.2.214193
I seem to be getting this error when clicking on the scrollbar arrows when it reaches its top or bottom:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at InfusionProspectsList/displayDetails()[D:\Documents\dev\flex\InfusionProspectsList\src\In fusionProspectsList.mxml:16]
at InfusionProspectsList/__grdProspectData_click()[D:\Documents\dev\flex\InfusionProspectsLi st\src\InfusionProspectsList.mxml:83]
Also, I am getting the next error when I click on a row, but when I click continue and go back to the row it is fine:
ReferenceError: Error #1069: Property data not found on mx.core.SpriteAsset and there is no default value.
at InfusionProspectsList/displayDetails()[D:\Documents\dev\flex\InfusionProspectsList\src\In fusionProspectsList.mxml:16]
at InfusionProspectsList/__grdProspectData_click()[D:\Documents\dev\flex\InfusionProspectsLi st\src\InfusionProspectsList.mxml:83]
I have no code attached to the scrollbar, and have a function attached to the data grid itself to populate some detail fields.
Any ideas?
Thanks.Only the debugger player shows uncaught errors. Release players stop
running code until the next event or frame. The error is showing you a line
number in your code. See that code is on that line. -
VerifyError: Error #1025: An invalid register 2 was accessed
hi,
i have an this xml file to read
<test xmlns:"
http://something.com">
<n:name xmlnx:n="
http://something.com">hello</n:name>
i put is in an arrayCollection ,data, and when try to execute
this code i have an error
<mx:DataGrid id="test" visible="true"
dataProvider="{data}" xmlns="
http://something.com" >
<mx:columns>
<mx:DataGridColumn dataField="name"
headerText="name"/>
</mx:columns>
</mx:DataGrid>This turned out to be either
var myFunc:Function=someFunctionFromOurCode;
myFunc.apply(null,args);
//OR
myFunc.call(null);
changing the nulls (thisObj params) to something more appropriate killed the bug.
The reason I was setting the thisObj to null is because none of the functions getting called required a "this" scope -
I'm trying to use HTTPService to receive xml data from a
website, using e4x, then put it in a datagrid (and do other things
with it later). I can get it to populate the datagrid using object,
but need it in xml form to use it in other places. I've tryed using
an XMLListCollection, but can't seem to get it working.
/********************* XML *******************/
<?xml version="1.0" encoding="iso-8859-1" ?>
<tool>
<projects>
<project>
<projectName>Project 1</projectName>
<active>true</active>
</project>
<project>
<projectName>Project 2</projectName>
<active>true</active>
</project>
</projects>
</tool>
/***************** This works ****************/
<mx:HTTPService id="list_request" url="myxml.xml"
showBusyCursor="true" resultFormat="object"
fault="Alert.show('Project listing could not be
retrieved!','Error');"/>
<mx:DataGrid y="0" width="508" height="291"
horizontalCenter="0"
dataProvider="{list_request.lastResult.tool.projects.project}"
id="dgProjects">
<mx:columns>
<mx:DataGridColumn headerText="Projects"
dataField="projectName"/>
</mx:columns>
</mx:DataGrid>
Thanks in advance.Using that I get these console warnings:
warning: unable to bind to property 'projects' on class 'XML'
(class is not an IEventDispatcher)
warning: unable to bind to property 'project' on class
'XMLList' (class is not an IEventDispatcher)
Also, I can't figure out why lastResult is returning null if
I work with it in the same function list_request was called from.
public function GotoStartPage():void{
list_request.send();
// If the query contained a value for project_request...
if(Application.application.parameters.project_request!=null){
// Check to see if the query matched one of the listed
projects
project_request=Application.application.parameters.project_request;
currentState="Main Project Page";
}else{
trace(list_request.lastResult); // <-
this gives null
project_request="";
currentState="Project Selection Screen";
Is the trace statement getting called before
list_request.send() is finished getting the data? -
Error while inserting data in datagrid
Hi,
I am trying to insert data into a datagrid getting results
from a cfc using remoteobject. If I use everything inline then it
works fine.
I have a button when clicked give me the results. if I have
something like this:
<mx:Button label="get Query Remote Object"
click="myTest.getSystem()"/>
then it works fine.
but if I use a namespace like
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
xmlns:serv="services.*">
<serv:services id="services" />
and try to use
<mx:Button label="get Query Remote Object"
click="services.myTest.getSystem()"/>
then i get an error saying
Access of undefined property myTest in package services.
I have the remoteobject call within services.mxml which is
inside services folder. What do I need to change? It used to work
fine in 1.5.
ThanksAre you using the Cairngorm framework or why are you using a
sevices.mxml?? -
Error while saving dynamic row values of datagrid with record.
hi friends,
i am trying to add dynamic row in datagrid and save that value with record.i succeeded in first part while i am saving the record the error show like this.
errro:Property fromAmount not found on com.ci.view.Task and there is no default value.
how i resolve this error.
any suggession welcom
thanks in advance.
B.venkatesan
code:
package:
package com.ci.view
[Bindable]
public class Task
public function Task(frmAmount:String,toAmount:String,commissionPercentage:String)
this.frmAmount=frmAmount;
this.toAmount=toAmount;
this.commissionPercentage=commissionPercentage;
public var frmAmount:String;
public var toAmount:String;
public var commissionPercentage:String;
main mxml:
[Bindable]
private var tasks:ArrayCollection;
private static const ADD_TASK:String= "";
private function init():void
tasks = new ArrayCollection();
tasks.addItem(new Task("0","1000","0"));
tasks.addItem({frmAmount:ADD_TASK});
private function checkEdit(e:DataGridEvent):void
// Do not allow editing of Add Task row except for
// "Click to Add" column
if(e.rowIndex == tasks.length - 1 && e.columnIndex != 0)
e.preventDefault();
private function editEnd(e:DataGridEvent):void
// Adding a new task
if(e.rowIndex == tasks.length - 1)
var txtIn:TextInput =TextInput(e.currentTarget.itemEditorInstance);
var txtIn1:TextInput =TextInput(e.currentTarget.itemEditorInstance);
var txtIn2:TextInput =TextInput(e.currentTarget.itemEditorInstance);
var dt:Object = e.itemRenderer.data;
// Add new task
if((txtIn.text) != ADD_TASK)
var x:String=String(txtIn.text);
tasks.addItemAt(new Task("", "", ""), e.rowIndex);
// Destroy item editor
commPlanDetGrid.destroyItemEditor();
// Stop default behavior
e.preventDefault();Venktesan,
You are trying compare String and int..! which is not possible try to case the txtIn.text to int using parseInt(txtIn.text).
ORIGINAL:
if(txtIn.text != ADD_TASK).---->error : Comparison between a value with static type String and a possibly unrelated type int
tasks.addItemAt(new Task(txtIn.text, 0, ""), e.rowIndex);----> error:Implicit coercion of a value of type String to an unrelated type int.
EDITED:
if(parseInt(txtIn.text) != ADD_TASK).---->error : Comparison between a value with static type String and a possibly unrelated type int
tasks.addItemAt(new Task(parseInt(txtIn.text), 0, ""), e.rowIndex);----> error:Implicit coercion of a value of type String to an unrelated type int.
Thanks
Pradeep -
I am getting a runtime error when I click a button that fires
the addPerson function.
TypeError: Error #1009: Cannot access a property or method of
a null object reference.
at main/addPerson()[C:\Documents and Settings\edunn\My
Documents\Flex Builder 3\workspace2\Test-1\src\main.mxml:178]
at main/___main_Button4_click()[C:\Documents and
Settings\edunn\My Documents\Flex Builder
3\workspace2\Test-1\src\main.mxml:228]
I am new to Action Script - and object programming - so
understand...
I do not understand what I have done wrong here...
I have a result list coming from an external web service that
populates in a datagrid. I'd like to be able to update that
datagrid and then push back to the web service the new array.
Any ideas?????
import mx.rpc.events.ResultEvent;
import mx.rpc.events.FaultEvent;
import mx.collections.ArrayCollection;
import generated.webservices.FxAppiaUserFeaturesService;
import generated.webservices.UserSimRingConfig;
import generated.webservices.SimRingType;
public var plist:ArrayCollection
//Updated Function to populate the data from WS
public function
retrieveUserSimRingConfig(e:ResultEvent):void {
var UsrSimRngCfgNumList:Array = new
UserSimRingConfig().simRingNumberList;
var plist:ArrayCollection = e.result.simRingNumberList;
dgSimPhoneList.dataProvider = plist;
if (e.result.active) {
chboxSimultaneousRingPhones.selected=true;
} else {
chboxSimultaneousRingPhones.selected=false;
if (e.result.simRingType == "NO_RING_WHILE_ONCALL") {
chboxSimultaneousRing.selected=true;
} else {
chboxSimultaneousRing.selected = false;
// Add a person to the ArrayCollection.
public function addPerson():void {
plist.addItem({simRingNumberList:txtPhoneNumber1.text});
I posted this in the General Section first by
mistake...can u explain abt this line
var plist:ArrayCollection = e .
result.simRingNumberList; -
Hello.
At first sorry for my english.
I have encountered problem with DataGrid control.
There is DataGrid control, which have custom ItemRenderer
(MulticolorDataGridItemRenderer).
This DataGrid control has several properties:
1) click on a row changes it background color
2) click on "Filter ON" button, filter DataGrid by "status"
field
"TypeError: Error #1009: Cannot access a property or method
of a null object reference.
at
mx.controls::DataGrid/mx.controls:DataGrid::mouseUpHandler()"
This error occure when filter is ON, by click on a row. It
occures occasionally. I note that it
occur when DataGrid's vertical scrollbar is not in top
position.
If I remove recovering of scroll position, this bug
disappear.
Sample code:
~~~~~~~~~~~~
1. Application mxml:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="absolute">
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import mx.controls.List;
private var objPrevSelectedItem:Object = null;
private var arrList:Array = [{name: "Matt", lastname:
"Chotin", status: "0", selected: "0"},
{name: "Ely", lastname: "Greenfield", status: "1", selected:
"0"},
{name: "Christophe", lastname: "Coenraets", status: "2",
selected: "0"},
{name: "Sho", lastname: "Kuwamoto", status: "1", selected:
"0"},
{name: "Steven", lastname: "Webster", status: "4", selected:
"0"},
{name: "Alistair", lastname: "McLeod", status: "3",
selected: "0"},
{name: "Chafic", lastname: "Kazoun", status: "1", selected:
"0"},
{name: "Manish", lastname: "Jethani", status: "2", selected:
"0"},
{name: "Mike", lastname: "Chambers", status: "4", selected:
"0"},
{name: "Ted", lastname: "Patrick", status: "0", selected:
"0"},
{name: "Roger", lastname: "Gonzales", status: "1", selected:
"0"},
{name: "David", lastname: "Zuckerman", status: "3",
selected: "0"},
{name: "Alex", lastname: "Uhlmann", status: "3", selected:
"0"},
{name: "Peter", lastname: "Ent", status: "3", selected:
"0"},
{name: "Adobe", lastname: "Consulting", status: "2",
selected: "0"},
{name: "Marcel", lastname: "Boucher", status: "4", selected:
"0"},
{name: "Andrew", lastname: "Trice", status: "1", selected:
"0"},
{name: "Mike", lastname: "Morearty", status: "1", selected:
"0"},
{name: "Everything", lastname: "Flex", status: "0",
selected: "0"},
{name: "Jesse", lastname: "Warden", status: "3", selected:
"0"},
{name: "Richinternet", lastname: "Blog", status: "2",
selected: "0"},
{name: "Flex", lastname: "Daddy", status: "2", selected:
"0"},
{name: "Keun", lastname: "Lee", status: "0", selected: "0"},
{name: "David", lastname: "Koletta", status: "4", selected:
"0"},
{name: "Brian", lastname: "Deitte", status: "1", selected:
"0"},
{name: "Darron", lastname: "Schal", status: "2", selected:
"0"},
{name: "Narciso", lastname: "Jaramillo", status: "3",
selected: "0"},
{name: "Kiwi", lastname: "Teamblog", status: "4", selected:
"0"},
{name: "Anthony", lastname: "Rumsey", status: "0", selected:
"0"}];
[Bindable]
private var arrcollDP:ArrayCollection = new
ArrayCollection(arrList);
private function fnSelectRow(event:Event):void
if (objPrevSelectedItem != null)
objPrevSelectedItem["selected"] = new String("0");
ArrayCollection(DataGrid(event.target).dataProvider).itemUpdated(objPrevSelectedItem);
var numScrolPos:Number =
DataGrid(event.target).verticalScrollPosition;
Object(DataGrid(event.target).selectedItem)["selected"] =
new String("1");
ArrayCollection(DataGrid(event.target).dataProvider).itemUpdated(DataGrid(event.target).s electedItem);
objPrevSelectedItem =
Object(DataGrid(event.target).selectedItem);
if (arrcollDP.filterFunction != null)
arrcollDP.filterFunction = fnFilter;
arrcollDP.refresh();
DataGrid(event.target).verticalScrollPosition = numScrolPos;
private function fnFilter(item:Object):Boolean
var bResult:Boolean = new Boolean(false);
if (String(item["status"]) == "0")
bResult = true;
return bResult;
]]>
</mx:Script>
<mx:DataGrid
width="100%"
height="100"
dataProvider="{arrcollDP}"
itemRenderer="MulticolorDataGridItemRenderer"
draggableColumns="false"
rowHeight="17"
paddingTop="1"
paddingBottom="1"
horizontalGridLineColor="#a0a0a0"
horizontalGridLines="true"
change="fnSelectRow(event)">
<mx:columns>
<mx:DataGridColumn headerText="Name" dataField="name"
width="250" textAlign="left" sortable="false"/>
<mx:DataGridColumn headerText="Last Name"
dataField="lastname" width="250" textAlign="left"
sortable="false"/>
<mx:DataGridColumn headerText="Status" dataField="status"
width="80" textAlign="center" sortable="false"/>
</mx:columns>
</mx:DataGrid>
<mx:Button label="Filter ON" y="110" x="5"
click="arrcollDP.filterFunction = fnFilter;
arrcollDP.refresh();"/>
<mx:Button label="Filter OFF" y="110" x="105"
click="arrcollDP.filterFunction = null; arrcollDP.refresh();"/>
</mx:Application>
2. MulticolorDataGridItemRenderer component mxml:
<?xml version="1.0" encoding="utf-8"?>
<mx:DataGridItemRenderer xmlns:mx="
http://www.adobe.com/2006/mxml"
background="true" dataChange="fnChangeColor(event);">
<mx:Script>
<![CDATA[
import mx.controls.dataGridClasses.DataGridColumn;
import mx.events.FlexEvent;
import mx.controls.Alert;
private function fnChangeColor(event:FlexEvent):void
if (Object(this.data) != null)
if (!(this.data is DataGridColumn))
var strTmp:String = String(Object(this.data)["status"]);
if (strTmp == "0")
this.backgroundColor = 0xccffcc;
else if (strTmp == "1")
this.backgroundColor = 0xffff99;
else if (strTmp == "2")
this.backgroundColor = 0x99ccff;
else if (strTmp == "3")
this.backgroundColor = 0xffcc99;
else if (strTmp == "4")
this.backgroundColor = 0xcc66ff;
if (String(Object(this.data)["selected"]) == "1")
this.backgroundColor = 0xff9933;
]]>
</mx:Script>
</mx:DataGridItemRenderer>
And one another question: why did disappear standard DataGrid
control selection mechanism, when I used custom
DataGridItemRenderer? Try to use the sample code above withou
fnSelectRow function.
TIAHi, I will try to explain what i have undestood about this issue.
I have an application that loads at runtime some modules, and in my project configuration (Flex Modules), i specified some modules to compile optimizing to main application. Besides that, my project uses RSL to the framework linkage, and i perceived that the compiler output reports some warning messages just like "The CSS type selector 'DataGrid' was not processed, because the type was not used in the application." or others similars "The CSS type selector 'TextArea' was not processed, because the type was not used in the application.".
When i run the application, and click the first time in some grid column, the error "Type Coercion failed: cannot convert ......@abcda2 to ........." happens.
It happens because, these controls or components has not been linked in the main application compilation, and so, when you use the first module that uses one of these components, only the module loads an instance of these components and maintain on its part of memory.
Dispite of being loaded in the main application, each module and main application has its SystemManager instance to register and load components, and because of it, when the application try to cast instances of the same component, but at differents SystemManager's singleton implementations, the above error occurs.
So my solution was to add some reference of the controls or components that appears at the warning messages that was not compiled, to force the main application compilation to add these components at its SystemManager singletons first than any module.
Only add the name of the component and import its package. Do not have to add to the stage. See below.
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" ....>
<mx:Script>
<![CDATA[
DataGrid;
TextArea;
]]>
</mx:Script>
</mx:Application> -
Datagrid column that contains checkbox erroring
Hi i'm trying to set the selected option on a checkbox in a datagrid column but i keep getting the error "Access to undefined property data". Can someone shead some light on how i can fix this? The code i have is below.
Thanks in advance....
<mx:DataGrid x="140" y="85" width="596" height="294" id="rankGrid" dataProvider="{dp}" doubleClick="updRank();" doubleClickEnabled="true">
<mx:columns>
<mx:DataGridColumn headerText="Court" dataField="court"/>
<mx:DataGridColumn headerText="Team One" dataField="level"/>
<mx:DataGridColumn headerText="Checked In" dataField="chkdInOne">
<mx:itemRenderer>
<fx:Component>
<s:CheckBox selected="{data.chkdInOne}" click="outerDocument.checkInTeamOne()" />
</fx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
<mx:DataGridColumn headerText="Team One" dataField="teamonedesc"/>
<mx:DataGridColumn headerText="Checked In" dataField="chkdInTwo">
<mx:itemRenderer>
<fx:Component>
<s:CheckBox click="outerDocument.checkInTeamTwo()" selected="{data.chkdInTwo}"/>
</fx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
<mx:DataGridColumn headerText="Team Two" dataField="teamtwodesc"/>
</mx:columns>
</mx:DataGrid>try wrapping your component inside the itemrenderer tag
<fx:Component>
<s:ItemRenderer>
<s:CheckBox />
</s:ItemRenderer>
</fx:Component> -
Error #1009: while loading datagrid in to appl
Below exeption showing while trying to load datagrid in to my application..
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at mx.controls::DataGrid/createItemEditor()[E:\dev\4.0.0\frameworks\projects\framework\src\m x\controls\DataGrid.as:4325]
at mx.controls::DataGrid/itemEditorItemEditBeginHandler()[E:\dev\4.0.0\frameworks\projects\f ramework\src\mx\controls\DataGrid.as:5237]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\co re\UIComponent.as:12266]
at mx.controls::DataGrid/commitEditedItemPosition()[E:\dev\4.0.0\frameworks\projects\framewo rk\src\mx\controls\DataGrid.as:4093]
at mx.controls::DataGrid/updateDisplayList()[E:\dev\4.0.0\frameworks\projects\framework\src\ mx\controls\DataGrid.as:1804]
at mx.controls.listClasses::ListBase/validateDisplayList()[E:\dev\4.0.0\frameworks\projects\ framework\src\mx\controls\listClasses\ListBase.as:3962]
at mx.managers::LayoutManager/validateClient()[E:\dev\4.0.0\frameworks\projects\framework\sr c\mx\managers\LayoutManager.as:932]
at mx.core::UIComponent/validateNow()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\core \UIComponent.as:7631]
at mx.managers::PopUpManagerImpl/centerPopUp()[E:\dev\4.0.0\frameworks\projects\framework\sr c\mx\managers\PopUpManagerImpl.as:485]
at mx.managers::PopUpManager$/centerPopUp()[E:\dev\4.0.0\frameworks\projects\framework\src\m x\managers\PopUpManager.as:213]this is my code for datagrid... please check..
<commoncomponents:ListDatagrid id="reportGroupDetailsListDG"
dataProvider="{ReportGroupDetailsModelLocator.getInstance().reportGroupVO.reportDefinitio nList}"
width="100%"
keyDown="{reportGroupDetailsHelper.handleDataGridKeyDown(event,
Constants.VIEW_REPORT_GROUP,modelLocator.reportGroupVO.reportDefinitionList,ReportGroupDe tailComponent,'EX', -1);}"
keyUp="{reportGroupDetailsHelper.handleHotKeys(modelLocator.reportGroupVO.reportDefinitio nList,event,
EventConstants.REPORT_GROUP_EVENT,Constants.LIST_REPORT_GROUP_DETAILS,
reportGroupDetailsHelper.displayError, Constants.PAGE_REPORT_GROUP, -1);}"
>
<commoncomponents:columns>
<mx:DataGridColumn width="20"
headerText=""
dataField="userAction"
rendererIsEditor="true"
visible="{(reportGroupDetailsHelperVO.state == Constants.STATE_EDIT ||
reportGroupDetailsHelperVO.state == Constants.STATE_ADD_NEW) ? true : false}">
<mx:itemRenderer>
<mx:Component>
<commoncomponents:BDCUserActionTextInput height="10"
width="10"
fontFamily="Arial"
fontWeight="bold"
textAlign="center"
maxChars="1"
restrict="XE"
text="{data.userAction}"
includeInLayout="{parentDocument.reportGroupDetailsHelperVO.state == Constants.STATE_EDIT ? true : false}">
<commoncomponents:keyDown>
<![CDATA[
ListItemVO(ReportGroupDetailsModelLocator.getInstance().reportGroupVO.reportDefinitionLis t.getItemAt
(event.currentTarget.document.reportGroupDetailsListDG.selectedIndex)).userAction
= event.target.text;
]]>
</commoncomponents:keyDown>
<mx:Script>
<![CDATA[
import com.bnymellon.bds.bdc.ui.model.reportgroup.ReportGroupDetailsModelLocator;;
import com.bnymellon.bds.bdc.ui.vos.ListItemVO;
import com.bnymellon.bds.bdc.ui.utility.Constants;
]]>
</mx:Script>
</commoncomponents:BDCUserActionTextInput>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
<mx:DataGridColumn editable="false"
headerText="Report Name"
dataField="command" width="120">
<mx:itemRenderer>
<mx:Component>
<mx:HBox paddingLeft="5">
<mx:Text styleName="normalText"
text="{data.command}"/>
</mx:HBox>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
<mx:DataGridColumn editable="false"
headerText="Access Level Id"
dataField="accountScopeID" width="150">
<mx:itemRenderer>
<mx:Component>
<mx:HBox paddingLeft="5">
<mx:Text styleName="normalText"
text="{data.reportGroupScopeId}"/>
</mx:HBox>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
<mx:DataGridColumn editable="false"
headerText="Security ID"
dataField="security" width="140">
<mx:itemRenderer>
<mx:Component>
<mx:HBox paddingLeft="5">
<mx:Text styleName="normalText"
text="{data.security}"/>
</mx:HBox>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
<mx:DataGridColumn editable="false"
headerText="Qualifier"
dataField="reportParam">
<mx:itemRenderer>
<mx:Component>
<mx:HBox paddingLeft="5">
<mx:Text styleName="normalText" width="100%"
text="{data.parameter}"/>
</mx:HBox>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
<mx:DataGridColumn editable="false"
headerText="FileType"
dataField="fileFormat" width="80">
<mx:itemRenderer>
<mx:Component>
<mx:HBox paddingLeft="5">
<mx:Text styleName="normalText"
text="{'.' + data.fileFormat}"/>
</mx:HBox>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
</commoncomponents:columns>
</commoncomponents:ListDatagrid> -
Undefined error: when update datagrid in flex
I get this error when trying to update a field in my datagrid, using LCDS 2.61 with coldfusion.
Why?
undefined
at mx.data::CommitResponder/result()[C:\depot\flex\branches\enterprise_bridgeman_final_hotfi xes\frameworks\mx\data\CommitResponder.as:424]
at mx.rpc::AsyncRequest/acknowledge()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\rpc\ AsyncRequest.as:74]
at NetConnectionMessageResponder/resultHandler()[C:\autobuild\3.2.0\frameworks\projects\rpc\ src\mx\messaging\channels\NetConnectionChannel.as:515]
at mx.messaging::MessageResponder/result()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx \messaging\MessageResponder.as:199]
Thanks,
Jon KravetzTo troubleshoot this, you should add <mx:TraceTarget /> to your mxml file and then debug your application. Afterwards, reply with the trace log from the console...
-
Error when a DataGrid is edited
Hi,
I set my app DataGrid to editable to true. But when I double click to edit a cell, a Flash Player error occur :
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at spark.accessibility::DataGridAccImpl/makeRowString()[E:\dev\4.5.1\frameworks\projects\spa rk\src\spark\accessibility\DataGridAccImpl.as:1068]
at spark.accessibility::DataGridAccImpl/eventHandler()[E:\dev\4.5.1\frameworks\projects\spar k\src\spark\accessibility\DataGridAccImpl.as:1031]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\co re\UIComponent.as:13128]
at spark.components.gridClasses::DataGridEditor/setEditedItemPosition()[E:\dev\4.5.1\framewo rks\projects\spark\src\spark\components\gridClasses\DataGridEditor.as:315]
at spark.components.gridClasses::DataGridEditor/dataGrid_gridItemEditorSessionStartingHandle r()[E:\dev\4.5.1\frameworks\projects\spark\src\spark\components\gridClasses\DataGridEditor .as:1204]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\co re\UIComponent.as:13128]
at spark.components.gridClasses::DataGridEditor/startItemEditorSession()[E:\dev\4.5.1\framew orks\projects\spark\src\spark\components\gridClasses\DataGridEditor.as:798]
at spark.components::DataGrid/startItemEditorSession()[E:\dev\4.5.1\frameworks\projects\spar k\src\spark\components\DataGrid.as:3803]
at spark.components.gridClasses::DataGridEditor/grid_gridMouseUpHandler()[E:\dev\4.5.1\frame works\projects\spark\src\spark\components\gridClasses\DataGridEditor.as:1379]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\co re\UIComponent.as:13128]
at spark.components::Grid/dispatchGridEvent()[E:\dev\4.5.1\frameworks\projects\spark\src\spa rk\components\Grid.as:4038]
at spark.components::Grid/grid_mouseDownDragUpHandler()[E:\dev\4.5.1\frameworks\projects\spa rk\src\spark\components\Grid.as:3883]
at Function/<anonymous>()[E:\dev\4.5.1\frameworks\projects\spark\src\spark\utils\MouseEventU til.as:96]
I tried to put the DataGrid in a very simple new project and there is no error.
Here is the code :
<s:DataGrid id="dgProperties" width="100%" height="100%" editable="true"
sortableColumns="false">
<s:ArrayCollection>
<s:DataItem key="1000" name="Abrasive" price="100.11" call="false"/>
<s:DataItem key="1001" name="Brush" price="110.01" call="true"/>
<s:DataItem key="1002" name="Clamp" price="120.02" call="false"/>
<s:DataItem key="1003" name="Drill" price="130.03" call="true"/>
<s:DataItem key="1004" name="Epoxy" price="140.04" call="false"/>
<s:DataItem key="1005" name="File" price="150.05" call="true"/>
<s:DataItem key="1006" name="Gouge" price="160.06" call="false"/>
<s:DataItem key="1007" name="Hook" price="170.07" call="true"/>
<s:DataItem key="1008" name="Ink" price="180.08" call="false"/>
<s:DataItem key="1009" name="Jack" price="190.09" call="true"/>
</s:ArrayCollection>
<s:columns>
<s:ArrayList>
<s:GridColumn headerText="name" dataField="name"/>
<s:GridColumn headerText="price" dataField="price"/>
</s:ArrayList>
</s:columns>
</s:DataGrid>
Thx.I have same problem.
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at spark.accessibility::DataGridAccImpl/makeRowString()[E:\dev\4.5.1\frameworks\projects\spa rk\src\spark\accessibility\DataGridAccImpl.as:1068]
at spark.accessibility::DataGridAccImpl/eventHandler()[E:\dev\4.5.1\frameworks\projects\spar k\src\spark\accessibility\DataGridAccImpl.as:1031]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\co re\UIComponent.as:13128]
at spark.components.gridClasses::DataGridEditor/setEditedItemPosition()[E:\dev\4.5.1\framewo rks\projects\spark\src\spark\components\gridClasses\DataGridEditor.as:315]
at spark.components.gridClasses::DataGridEditor/dataGrid_gridItemEditorSessionStartingHandle r()[E:\dev\4.5.1\frameworks\projects\spark\src\spark\components\gridClasses\DataGridEditor .as:1204]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\co re\UIComponent.as:13128]
at spark.components.gridClasses::DataGridEditor/startItemEditorSession()[E:\dev\4.5.1\framew orks\projects\spark\src\spark\components\gridClasses\DataGridEditor.as:798]
at spark.components::DataGrid/startItemEditorSession()[E:\dev\4.5.1\frameworks\projects\spar k\src\spark\components\DataGrid.as:3803]
at spark.components.gridClasses::DataGridEditor/doubleClickTimerHandler()[E:\dev\4.5.1\frame works\projects\spark\src\spark\components\gridClasses\DataGridEditor.as:1428]
at flash.utils::Timer/_timerDispatch()
at flash.utils::Timer/tick()
In the class DataGridAccImpl, line 1068: "rowString = rowString.replace("%1", dgAccInfo.reachableRowIndex + 1).replace("%2", dgAccInfo.reachableRowCount);". rowString is null.
After app initialized i call ResourceManager.getInstance().localeChain = [language]; (language = "fr_FR"). I tried "fr" "en_US" "pt_BR".. Same problem.
This problem is only in AIR project.
Anyone already solved this problem? -
Advanced Datagrid error in Flex 2
Hi,
I copied the source of Advanced Datagrid and the related
classes from Flex Moxie SDK into my personal project and changed
the package name etc. wherever required. Now I don't get any
compile time error. But I get runtime error as
TypeError: Error #1007: Instantiation attempted on a
non-constructor.
at com.resources::ResourceManager$/getInstance()
at com.controls::AdvancedDataGrid$cinit()
at global$init()
at FinalADG/::_AdvancedDataGrid1_i()
at FinalADG$iinit()
at _FinalADG_mx_managers_SystemManager/create()
at mx.managers::SystemManager/::initializeTopLevelWindow()
at mx.managers::SystemManager/::docFrameHandler()
Is there anybody from Adobe to help me??
Thanks in advance.Hi John,
Sorry, we do not officially support this.
Is there any particular reason why you cannot using the
AdvancedDataGrid directly (or derive from it)?
Thanks,
Swaroop
Maybe you are looking for
-
The sound on my iPhone is perfect until I plug in speakers or headphones Then the sound halves and won't turn all the way up, when I do turn it up the Sound just switches off till I turn it back down low to wear it works , When I unplug headphones/de
-
I dropped my iPod touch and the screen cracked. Can I get it repaired?
Today I dropped my iPod. Then realized the screen cracked. So. Is there any way to get it repaired or back? my mom didn't pay the insurance and she bought my iPod touch (the new one with both cameras) at best buy. But can apple store Still fix it i
-
Ios 7 app switcher ??
I read here that closing apps from the switcher and loading them again drains power . In short he says not to remove apps from the switcher . Is it true ? http://www.telegraph.co.uk/technology/apple/iphone/10757729/Ex-Apple-Genius-reve als-8-ways-to
-
Release time for production order
HI Want to know the release time of the production order.Is it possible in any of the base reports regards, PradeepM.
-
External Drives Keep Getting Renamed
My LaCie drive has a famously short USB cord, so if I move my laptop, the jack sometimes yanks out, causing everything that was using the drive to halt mid-operation. What's more obnoxious: when I plug the drive back in, the drive's name is unchanged