p:编辑器在chrome中可见,但在IE中无法正确呈现

时间:2013-04-30 06:36:44

标签: primefaces editor

当它在Chrome浏览器中正常工作时,我的IE窗口中没有出现编辑器

我已经实现了p:layout并且在中心layoutunit中我使用ui包含了template.xhtml:include包含在

<h:form id="centercontentpanel">

请告诉我需要做些哪些更正才能在IE 8中显示

Template.xhtml

<?xml version='1.0' encoding='UTF-8' ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:p="http://primefaces.org/ui"
  xmlns:f="http://java.sun.com/jsf/core">

<h:body>
<f:view> 
    <p:editor id="editor" value="#{editorBean.value}"/>
    <h:panelGrid columns="2" style="margin-top:10px">
        <p:commandButton id="submitButton" value="Submit" update="display" oncomplete="editordlg.show()"
                    icon="ui-icon-disk" />
        <p:commandButton id="clearButton" type="button" value="Clear" onclick="editor.clear()"
                    icon="ui-icon-close"/>
    </h:panelGrid>
    <p:dialog header="Content" widgetVar="editordlg" showEffect="fade" hideEffect="fade" modal="true">
        <h:outputText id="display" value="#{editorBean.value}" escape="false" />
    </p:dialog>
</f:view>
</h:body>

</html>

1 个答案:

答案 0 :(得分:1)

据我所知,IE 8不支持Primefaces Editor,仍然在IE 11中。 实际上我可以渲染它,但没有任何效果,甚至不是粗体/斜体/下划线。

我认为这是因为IE处理javascript的方式......但我对技术问题知之甚少。

(我的测试是在IE 11和Primefaces 4.0上完成的,普通编程,没有抽搐任何东西)

仅适用于我正在使用HTML5库wysihtml5(GIT)的RichText

编辑: 对不起,我只是偶然发现我的问题(在IE上编辑),希望它能解决你的问题 只需将contentType="text/html"添加到<f:view>,就像这样<f:view contentType="text/html"> Here是Optimus的帖子(即使它是chrome的渲染问题)