public class DeleteHistoryServiceImpl extends CommanServiceImpl implements
DeleteHistoryService {
private IDeleteHistoryDAO deleteHistoryDAO = DAOFactory.getInstance()
.getDeleteHistoryDAO();
public JSONObject queryAll(Map map) throws SQLException {
JSONObject returnJson = new JSONObject();
returnJson.put("flag", true);
try {
           List testlist = deleteHistoryDAO.query(map);
if(testlist==null){
returnJson.put("flag", false);
returnJson.put("errorInfo", "list is null");
}
returnJson.put("testList",testlist);
} catch (SQLException e) {
returnJson.put("flag", false);
returnJson.put("errorInfo", "query fail");
}
return returnJson;
}private function queryAllSuccess(tmp:Object):void{
            var tmpArr:Array = tmp.testList as Array;
if(tmpArr != null){
for(var i:int = 0;i<tmpArr.length;i++){
var dh:DeleteHistoryTable = new DeleteHistoryTable();
dh.module = tmpArr[i].module;
dh.name = tmpArr[i].name;
dh.username =tmpArr[i].username;
dh.createDate = tmpArr[i].createDate;
testList.addItem(dh);
}
}
}Flex 不认识list.现在页面什么也不显示。不知道为什么。要怎么做才能显示?

解决方案 »

  1.   

    [Bindable]
    private var autoList:ArrayCollection = new ArrayCollection();<mx:DataGrid x="1" y="38" id="auto" columnWidth="60" rowHeight="50" labelField="label" direction="horizontal" height="220" width="239" dataProvider="{autoList}">
                    <mx:itemRenderer>
                    <mx:Component>                    
                        <mx:Image source="{data.image}" />  
                    </mx:Component>                        
                    </mx:itemRenderer>
            </mx:DataGrid>
      

  2.   

    var tmpArr:Array = tmp.testList as ArrayCollection;
      

  3.   


    谢谢,这个我已经解决了。我现在做了一个DataGrid,现在有增加,删除,修改的功能。  但是,我只要点删除。成功后弹框。然后随便点什么按钮都会弹一个删除成功的框。
       
      其他两个一样。不知道为什么。在线等......