添加选项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>
在 CRXDE 中,这可以通过创建相同的层次结构来实现:
- 右键单击您的选择节点并选择Create > Node。
- 给这个节点一个
jcr:primaryType。cq:WidgetCollection这将保存您的选项值。
- 现在可以将单个选项添加为 this 的子节点,其中 a
jcr:primaryTypeof nt:unstructured。
- 将您的属性 (
value, text, qtip) 放在这些子节点上。