CQ5使用fileuploaddialogbuton xtype

时间:2014-08-27 13:07:15

标签: adobe cq5 aem

有人可以发布一个如何在对话框中设置fileuploaddialogbutton小部件的示例吗?

我假设可以这样做 - 来自文档:

“FileUploadDialogBu​​tton创建一个按钮,打开一个用于通过FileUploadField上传文件的新对话框。可以在编辑对话框中使用,其中上传必须在新对话框中以单独的形式发生。”

我的搜索似乎返回的唯一结果是Widget API文档,它没有提供示例。

我在对话框中尝试了各种随机配置,但得到了JS错误:

TypeError: c.setSize is not a function
  c.setSize(cw || undefined, ch || undefined);

注意我没有在配置中指定任何高度或宽度(文档没有将它们列为选项)。任何人都可以提供一个如何正确配置它的例子(dialog.xml片段会很棒)?

提前致谢

修改

这是我的对话框XML。它给出了错误,但它并不是导致控制台中出现这个js错误的唯一版本,也没有任何声称这应该起作用(因为缺少文档)我要求一个例子。

<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
    jcr:primaryType="cq:Dialog"
    height="{Long}700"
    xtype="dialog">
    <items
    jcr:primaryType="cq:Widget"
    xtype="tabpanel">
    <items jcr:primaryType="cq:WidgetCollection">
        <tab1
            jcr:primaryType="cq:Panel"
            title="Tab 1">
            <items jcr:primaryType="cq:WidgetCollection">
                <name
                    jcr:primaryType="cq:Widget"
                    fieldLabel="Enter name"
                    name="./theName"
                    xtype="textfield"/>
                <description
                    jcr:primaryType="cq:Widget"
                    fieldLabel="Change description"
                    name="./changeDescription"
                    xtype="richtext"/>
                <files
                    jcr:primaryType="cq:Widget"
                    collapsed="{Boolean}false"
                    collapsible="{Boolean}false"
                    title="Files"
                    xtype="dialogfieldset">
                    <items jcr:primaryType="cq:WidgetCollection">
                        <test
                            jcr:primaryType="cq:Widget"
                            fieldLabel="Test"
                            xtype="textfield"/>
                        <file-upload
                            jcr:primaryType="cq:Widget"
                            dialogTitle="the dialog title"
                            fieldLabel="the field label"
                            text="the text"
                            xtype="fileuploaddialogbutton"/>
                    </items>
                </files>
            </items>
        </tab1>
    </items>
</items>

0 个答案:

没有答案