Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/apache-flex/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache flex FlexItemRenderer问题_Apache Flex_Flex3 - Fatal编程技术网

Apache flex FlexItemRenderer问题

Apache flex FlexItemRenderer问题,apache-flex,flex3,Apache Flex,Flex3,我使用复选框作为tilelist中的ItemRenderer。我正在试着设置 复选框通过xml选择值。我完全掌握了价值观。。但是 复选框无法绑定值(无法接受该值)。它是 自动为所有复选框设置true。 这是我的xml <PmhTreeAllow> <PmhTreeAllowname id='1' label ='Allow Text' isField='false'/> <PmhTreeAllowname id='2' label ='Document Li

我使用复选框作为tilelist中的ItemRenderer。我正在试着设置 复选框通过xml选择值。我完全掌握了价值观。。但是 复选框无法绑定值(无法接受该值)。它是 自动为所有复选框设置true。 这是我的xml

<PmhTreeAllow>
  <PmhTreeAllowname id='1' label ='Allow Text' isField='false'/>
  <PmhTreeAllowname id='2' label ='Document Link' isField='false'/>
  <PmhTreeAllowname id='3' label ='Test Results Entry'isField='false'/>
  <PmhTreeAllowname id='4' label ='Dummy' isField='false'/>
</PmhTreeAllow>

我的提琴手

<mx:TileList id="tileList" width="160" height="100%" textAlign="left" horizontalScrollPolicy="off" verticalScrollPolicy="off" dataProvider="modelInstance.optionCollList}" columnCount="1" backgroundAlpha="0" borderStyle="none"itemRenderer="com.Frontend.views.treeStructure.myTileList" useRollOver="false" rowHeight="28" itemClick="tileItemClick(event)" columnWidth="150" selectedIndex="0" x="10" y="0">

复选框ItemRenderer

<?xml version="1.0" encoding="utf-8"?>
<mx:CheckBox xmlns:mx="http://www.adobe.com/2006/mxml" label="{data.@label}" selected="data.@isField}"/>

提前谢谢 Ashok


这将有助于u..

出于性能原因,在itemRenderer中使用绑定被认为是一种不好的做法。而是听FlexEvent.DATA\u更改并手动修改您的值。我打赌这样做会解决你的问题

请尝试如下所示的itemRenderer:

<mx:CheckBox xmlns:mx="http://www.adobe.com/2006/mxml" label="{data.@label}" selected="data.@isField}" dataChange="onDataChange()">
<mx:Script><[[
 public function onDataChange():void{
 var dataAsXML = data as XML; 
 this.selected = data.@isField
 this.label = data.@label
]]></mx:Script>
</mx:CheckBox>


我对XML做的不多,但我怀疑XML属性不会绑定,因为XML不像ActionScript对象,因此“propertyChanged”绑定事件在XML对象上的存在方式与在AS3对象上的存在方式不同。

需要更多的“代码”。。