我在如何为选择对话框添加选项方面遇到了困难.
我正在阅读的Adobe笔记在这里:CQ.form.Selection
向下滚动options : Object[]/String将显示两种方法来引用选项,通过对象或字符串提供所述选择.我正在尝试使用对象方法.他们提供的格式示例就足够了.
[
{
value: "pink", // all types except "combobox"
text: "Pink",
qtip: "Real Pink" // "select" and "combobox"
}
]
Run Code Online (Sandbox Code Playgroud)
但是,CRXDE Lite不允许我在添加新属性时选择或键入Object,这是我不知所措的地方.还有另一种输入复杂价值的方法吗?
ano*_*ave 20
添加选项Object[]将通过子节点而不是属性来完成.(事实上,无论你Object在API中看到哪一个,node都要考虑而不是property.)
在您的dialog.xml文件中,这将按如下方式完成:
<selectList
jcr:primaryType="cq:Widget"
defaultValue="0"
fieldLabel="Number"
name="./number"
type="select"
xtype="selection">
<options jcr:primaryType="cq:WidgetCollection">
<one
jcr:primaryType="nt:unstructured"
text="One"
value="1"/>
<two
jcr:primaryType="nt:unstructured"
text="Two"
value="2"/>
<three
jcr:primaryType="nt:unstructured"
text="Three"
value="3"/>
<four
jcr:primaryType="nt:unstructured"
text="Four"
value="4"/>
</options>
</selectList>
Run Code Online (Sandbox Code Playgroud)
在CRXDE中,这可以通过创建相同的层次结构来实现:
jcr:primaryType的cq:WidgetCollection.这将保留您的选项值.jcr:primaryType的nt:unstructured.value,text,qtip)这些子节点上.| 归档时间: |
|
| 查看次数: |
21502 次 |
| 最近记录: |