ace:dialog 组件样本不工作

ace:dialog component sample not working

http://icefaces-showcase.icesoft.org/showcase.jsf?grp=ace:dialog&exp=Server%20Initiated 我只是想学习如何使用这个组件。但是无法运行这个例子。当我点击按钮时没有任何反应。有人知道吗?也没有错误信息。

<h:form>
        <h:panelGroup style="display:block; text-align:center;">
            <ace:pushButton id="show" value="Show Dialog"
                            type="button">
                <ace:ajax execute="@none" render="@none"
                          onStart="ice.ace.instance('#{dialog.clientId}').show(); return false;"/>
            </ace:pushButton>
        </h:panelGroup>
    </h:form>
    <ace:dialog id="dialog" binding="#{dialog}"
                header="A sample dialog overview example"
                closable="false"
                modal="true"
                draggable="false"
                showEffect="clip"
                hideEffect="fade"
                width="400">

        <h:form id="inputForm">
            <h:panelGrid columns="2" width="100%">
                <h:outputLabel id="firstNameLabel" for="firstNameInputField" value="First Name:"/>
                <ace:textEntry id="firstNameInputField"
                               value="#{dialogBean.firstName}" />

                <h:outputLabel id="lastNameLabel" for="lastNameInputField" value="Last Name:"/>
                <ace:textEntry id="lastNameInputField"
                               value="#{dialogBean.lastName}"/>
            </h:panelGrid>

            <h:panelGrid width="100%" style="text-align: center;">
                <ace:pushButton id="submitBtn"
                                value="Click me once done with input">
                    <ace:ajax execute="@form" render="@all"
                              onSuccess="ice.ace.instance('#{dialog.clientId}').hide(); "/>
                </ace:pushButton>
            </h:panelGrid>
        </h:form>

    </ace:dialog>


    <h:form id="outputForm">
        <h:panelGrid id="outputPanel" columns="2">
            <h:outputLabel value="Entered text: " for="enteredName"/>
            <h:outputText id="enteredName" value="#{dialogBean.firstName} #{dialogBean.lastName}"/>
        </h:panelGrid>
    </h:form>

这是示例中的客户端代码。

<h:form prependId="false">
<h:commandButton id="show" value="Show Dialog" onclick="ice.ace.instance('myDialog').show();" type="button"/>

            <ace:dialog id="myDialog"
                        header="A sample dialog overview example"
                        width="400">
            <h:outputText value="i will fix this"/>


</ace:dialog>
</h:form>

我找到了问题的解决方案。关键问题之一是我应该将 prependId="false" 与表单一起使用。所以现在基本功能起作用了,点击按钮会出现 ace:dialog。