【发布时间】:2014-05-14 21:21:58
【问题描述】:
我是 Adobe CQ5 版本 5.6.1 的新手,并试图学习使用 ExtJs 创建小部件,所以我正在做一些示例。我在这里要做的就是在单击按钮时显示一个警报框,但没有得到它。这是代码。
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:primaryType="cq:Dialog"
helpPath="en/cq/current/wcm/default_components.html#Title"
title="Title Component"
xtype="panel">
<items jcr:primaryType="cq:WidgetCollection">
<webcastAtAGlanceTitle
jcr:primaryType="cq:Widget"
fieldLabel="Title"
maxLength="{Long}25"
name="./webcastAtAGlanceTitle"
xtype="textfield"/>
<selection
jcr:primaryType="cq:Widget"
defaultValue="pageProp"
fieldLabel="Configuration Options"
name="./selection"
type="radio"
xtype="selection">
<options jcr:primaryType="cq:WidgetCollection">
<pageProp
jcr:primaryType="nt:unstructured"
text="Page Properties"
value="pageProp"/>
<RTE
jcr:primaryType="nt:unstructured"
text="RTE"
value="RTE"/>
</options>
</selection>
<testbutton
jcr:primaryType="cq:Widget"
autoWidth="{Boolean}true"
fieldLabel="test button"
text="Ok"
xtype="button">
<listener
jcr:primaryType="nt:unstructured"
click="function(){alert("Hello World","All set!!!");}"/>
</testbutton>
</items>
</jcr:root>
我确信这很容易实现。欣赏输入。
谢谢!
【问题讨论】: