标签: flex3

Flex DataGrid与ComboBox itemRenderer

我正在努力找出在Flex(3.4)DataGrid中嵌入ComboBox的"正确"方法.通过权利(例如根据这个页面http://blog.flexmonkeypatches.com/2008/02/18/simple-datagrid-combobox-as-item-editor-example/)它应该很容易,但我不能为我的生活使这项工作.

我对上面链接的示例的不同之处在于,我的显示值(用户看到的内容)与我想在我的数据提供程序中选择并存储的id值不同.

所以我拥有的是:

<mx:DataGridColumn headerText="Type" width="200" dataField="TransactionTypeID" editorDataField="value" textAlign="center" editable="true" rendererIsEditor="true">
    <mx:itemRenderer>
        <mx:Component>
            <mx:ComboBox dataProvider="{parentDocument.transactionTypesData}"/>
        </mx:Component>
    </mx:itemRenderer>
</mx:DataGridColumn>
Run Code Online (Sandbox Code Playgroud)

transactionTypesData"数据"和"标签"字段在哪里(根据什么ComboBox- 为什么它不提供labelField和idField,我永远不会知道).

无论如何,上面的MXML代码不能以两种方式工作:

  1. 组合框不会显示任何选定的项目.
  2. 选择项目后,它不会将所选项目存储回数据存储区.

那么,有没有人有类似的情况工作?

datagrid flex3 itemrenderer

9
推荐指数
1
解决办法
5万
查看次数

as3 scanHardware()函数使我的应用程序崩溃

我正在使用ScanHardware功能来获取更新的相机列表.如果将相机插入我的Mac mini,则会更新相机长度.如果我插入相机我的应用程序突然关闭.

<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" 
                       xmlns:s="library://ns.adobe.com/flex/spark" 
                       xmlns:mx="library://ns.adobe.com/flex/mx"
                       height="280"
                       width="280"
                       creationComplete="test1()">
    <fx:Declarations>
        <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <fx:Script>
        <![CDATA[

            import mx.controls.Alert;
            public var hardwareTimer:Timer;
            public function test1():void{
                hardwareTimer = new Timer(5000);
                hardwareTimer.addEventListener(TimerEvent.TIMER,refreshHardware);
                hardwareTimer.start();
            }
            public function refreshHardware(ev:TimerEvent):void{

                flash.media.scanHardware();
                Alert.show(Camera.names.length.toString());
            }
        ]]>
    </fx:Script>
</s:WindowedApplication>
Run Code Online (Sandbox Code Playgroud)

如果我Camera.names在拔掉任何电源后使用Camera,我的应用程序就会崩溃.

如何解决这个问题?

macos camera actionscript flex3 actionscript-3

9
推荐指数
1
解决办法
161
查看次数

TextField()设置插入位置

如何设置插入位置,只有

this.caretIndex(READ)

apache-flex flex3 actionscript-3

8
推荐指数
1
解决办法
1万
查看次数

如何自动构建Flex组件库?

我想自动构建一个flex库项目而不是当前进程,这涉及我们的一个开发人员在他的机器上编译它然后我们检查生成的.swc文件.这很糟糕.

我是从Java开发人员的角度来看这个,所以我很难掌握Flex Builder 3应用程序中提供的编译工具,但这就是我已经拥有的:

  1. 我创建了一个正确加载ant任务库的ant文件,因此可以执行<mxmlc/>和执行<compc/>任务.
  2. 我找到了我需要构建的源代码,并且知道我想要最终使用什么类型的.swc.

我想要的是一个ant脚本,它将完成以下步骤:

  1. 我们将项目中的所有源(actionscript和MXML)和资产构建到swc文件中.
  2. 提取并优化library.swf文件

到目前为止我有这个:

<target name="compile-component" depends="init">
  <compc output="${DEPLOY_DIR}/${SWC_NAME}.swc">
    <source-path path-element="${FLEX_HOME}/frameworks"/>
    <source-path path-element="${SRC_DIR}"/>
  </compc>
</target>
Run Code Online (Sandbox Code Playgroud)

但是,它不包括任何内容:

[compc] Loading configuration file /Applications/Adobe Flex Builder 3/sdks/3.2.0/frameworks/flex-config.xml
[compc] Adobe Compc (Flex Component Compiler)
[compc] Version 3.2.0 build 3958
[compc] Copyright (c) 2004-2007 Adobe Systems, Inc. All rights reserved.
[compc] 
[compc] Error: nothing was specified to be included in the library
[compc] 
[compc] Use 'compc -help' for information about using the command line.
Run Code Online (Sandbox Code Playgroud)

看起来我需要枚举我想要包含在库中的每个类,这是......荒谬的.肯定有更好的办法.我该怎么做呢?

apache-flex ant adobe flexbuilder flex3

8
推荐指数
2
解决办法
5064
查看次数

如何在Flex中将数据网格导出到Excel文件?

如何将数据网格中的数据导出到Flex中Excel文件?

任何人都可以提供一些例子吗?我正在浏览,但无法找到这种类型的一个例子.

编辑

浏览了很多,并找到了如何将datagrid数据转换为csv格式.现在如何将其转换为excel?有没有办法在不使用任何服务器脚本的情况下执行此操作?难道不能单独在Flex中完成吗?

apache-flex flex3 actionscript-3 export-to-excel

8
推荐指数
1
解决办法
3万
查看次数

Flex选项卡导航器:初始化隐藏的选项卡

我的问题:我有一个标签导航器,每个标签中都有许多表格.但我有一个全局保存按钮.问题是,如果我不打开Tab,它就不会被初始化,因此它包含的表单不存在..

如何让用户点击每个标签?

apache-flex tabs flex3

8
推荐指数
1
解决办法
2889
查看次数

在Flex中计算字典长度

在Flex中计算Dictionary对象长度的最佳方法是什么?

var d:Dictionary = new Dictionary();
d["a"] = "alpha";
d["b"] = "beta";
Run Code Online (Sandbox Code Playgroud)

我想检查这个词典应该是2的长度.除了循环遍历对象之外,还有什么方法可以做到吗?

apache-flex flex3 actionscript-3

7
推荐指数
1
解决办法
1万
查看次数

Flex ItemRenderer可防止在文本输入之间使用Tab键

我有一个自定义ItemRenderer,它在3个面板中显示5个文本输入:

<?xml version="1.0" encoding="utf-8"?>
<mx:VBox 
    xmlns:mx="http://www.adobe.com/2006/mxml"
    height="300"
    width="800"
    creationComplete="onCreationComplete()"
>
    <!-- code-behind -->
    <mx:Script source="ChainListRenderer.mxml.as" />

    <mx:Label text="{data.title}" fontSize="25" fontWeight="bold" width="100%" textAlign="center" />
    <mx:HBox>
        <mx:Panel id="triggerPanel" title="Trigger" width="260">
            <mx:VBox id="tpBoxes" width="100%" paddingBottom="5" paddingLeft="5" paddingRight="5" paddingTop="5">
                <mx:TextInput id="trigger1" width="100%" textAlign="left" tabIndex="0" tabEnabled="true" />
                <mx:TextInput id="trigger2" width="100%" textAlign="left" tabIndex="1" tabEnabled="true" />
                <mx:TextInput id="trigger3" width="100%" textAlign="left" tabIndex="2" tabEnabled="true" />
                <mx:TextInput id="trigger4" width="100%" textAlign="left" tabIndex="3" tabEnabled="true" />
                <mx:TextInput id="trigger5" width="100%" textAlign="left" tabIndex="4" tabEnabled="true" />
            </mx:VBox>
        </mx:Panel>
        <mx:Panel id="linkPanel" title="Link" width="260">
            <mx:VBox id="lpBoxes" …
Run Code Online (Sandbox Code Playgroud)

apache-flex usability flex3 itemrenderer

7
推荐指数
1
解决办法
1万
查看次数

是否有一种在flex中获得三态复选框的好方法?

我在interweb周围进行了很好的翻找,似乎无法找到任何三态复选框的例子.它看起来不受SDK支持,我在网上找不到任何示例.

我想这是一个常见的问题,在我开始自己编写之前,有没有人知道我可以使用的一个好的flex三态复选框组件:)

干杯,

Jawache.

apache-flex flex3 actionscript-3

7
推荐指数
1
解决办法
3070
查看次数

如何在Flex中的高级网格中创建叠加层

我想知道如何在Flex的高级网格中创建"叠加层"?请在此处查看示例

http://tinypic.com/r/4ieccm/4

apache-flex flex3 advanceddatagrid

7
推荐指数
1
解决办法
464
查看次数