1

我将 IceFace 3.3.0 与 MyFaces 一起使用。我对 ace:dialog 有疑问。它不适用于 IE 7 或 8,它适用于任何其他浏览器。

这是一个显示问题的简单示例:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xml:lang="de" lang="de" xmlns="http://www.w3.org/1999/xhtml"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:icecore="http://www.icefaces.org/icefaces/core"
  xmlns:ace="http://www.icefaces.org/icefaces/components"
  xmlns:ice="http://www.icesoft.com/icefaces/component"
>
<h:head>
  <title></title>
</h:head>
<h:body>
<ace:dialog id="helpDialog" header="Help" widgetVar="helpDialog"
  closable="true" modal="true" draggable="false" showEffect="clip"
  hideEffect="fade" closeOnEscape="true" width="400" height="600">
  <h:outputText value="Help Dialog" />
</ace:dialog>

<h:form id="myform">
  <ace:panel id="mypanel" header="Test" closable="false" toggleable="false">
    <h:commandLink immediate="true" value="&gt; Dialog" onclick="helpDialog.show();" />
  </ace:panel>
</h:form>
</h:body>
</html>

在 IE8 上,此代码不会显示对话框并在加载页面时产生 JavaScript 错误:

SCRIPT438 object doesn't support this property or method

JavaScript 错误出现在这个生成的行上:

helpDialog = ice.ace.create("Dialog",["helpDialog_main",{"isVisible":false,"minHeight":0,"width":400,"height":600,"draggable":false,"modal":true,"show":"clip","hide":"fade","title":"Help","ariaEnabled":true}])

我已经尝试过不同版本的 MyFaces 甚至 Mojarra,所以我认为这是一个 icefaces 问题。

任何帮助表示赞赏!

4

1 回答 1

0

对话框必须包含在表单中,甚至内容也可以包含在表单中,如链接所示。

<h:form>
  <ace:dialog id="helpDialog" header="Help" widgetVar="helpDialog"
    closable="true" modal="true" draggable="false" showEffect="clip"
    hideEffect="fade" closeOnEscape="true" width="400" height="600">
    <h:outputText value="Help Dialog" />
  </ace:dialog>
</h:form>

欲了解更多信息,王牌对话

于 2013-09-06T21:03:35.570 回答