1

我在 RichFaces3.3.3 中开发了一个演示应用程序客户人口统计向导。在 GoogleChrome 和 Mozilla Firefox 上一切正常。但是在 IE8 中运行相同的问题。在 IE8 向导的第一页显示正常,但在尝试导航到下一页时单击下一步按钮后没有显示任何表单。

IE8 显示如下错误:

用户代理:Mozilla/4.0(兼容;MSIE 7.0;Windows NT 5.1;Trident/4.0;.NET CLR 2.0.50727)时间戳:2012 年 12 月 11 日星期二 11:08:28 UTC

消息:未知的运行时错误行:120 字符:1 代码:0 URI:http://localhost:8400/BBGUServer/a4j/g/3_3_3.Finalorg.ajax4jsf.javascript.AjaxScript.jsf

任何人都可以帮助我解决问题所在。

提前致谢..

以下代码在 IE8 RichFaces3.3.3 中给出错误

请参阅下面给出的代码。除此之外,我没有提供 .java bean 文件,因为我认为这些文件是必需的。

这里 start.xhtml 是加载 custStep1.xhtml 的主页。当我通过单击“下一步”按钮导航到下一页时,在表单中给出了一些值后,没有显示“custStep2”表单的任何内容。仅显示父表单下拉列表(如您所见,我 start.xhtml)。通常这个特殊问题发生在 IE8 中。在 Firefox/Chrome 中一切都运行良好............

--------------------------------------- start.xhtml 的开始

    <ui:composition xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:rich="http://richfaces.org/rich">

    <script type='text/javascript'>
    //<![CDATA[
        function setSkinValue(skinName)
        {
            Seam.Component.getInstance('skinBean').setSkin(skinName, function()
            {
                Seam.Remoting.log('reloading window');
                window.location.reload(false);
            });
        }
    //]]>
    </script>
    <style type="text/css">
        .wizard { width:800px; }
        .wform td { vertical-align:right; }
        .wfcol1 { text-align: right; white-space:nowrap;}
        .s1row td { height:30px; }
        .rich-message { color:red;  }

        .navPanel {
            position:absolute;
            bottom:0;
            height:30px;
            margin:0;
            padding:2px;
        }
    </style>
    <head>  
      <link rel="stylesheet" href="css/style.css" type="text/css" />
    </head>
    <br/>
    <h:panelGrid width="800px" border="0">
        <a4j:keepAlive beanName="customerBean" />
        <rich:panel styleClass="wizard">
            <f:facet name="header">
            <h:outputText value="BBGUI Customer Demographics..." />
            </f:facet>
            <h:form id="mainForm" dir="#{customerBean.textDirection}">
                <rich:comboBox
                    id="language" 
                    selectFirstOnUpdate="false"
                    defaultLabel=""
                    value="#{customerBean.languageName}"
                    enableManualInput="false"
                    width="100"> 
                    <f:selectItem itemValue="English"/>
                    <f:selectItem itemValue="Arabic"/>
                    <a4j:support event="onselect" reRender="mainForm" action="#{customerBean.changeLanguage}"/>
                </rich:comboBox>
                <br/><br/>
                <rich:comboBox
                    id="theme" 
                    selectFirstOnUpdate="false"
                    defaultLabel="Emerald Town"
                    value="#{skinBean.skin}"
                    enableManualInput="false"
                    width="100"> 
                    <f:selectItem itemValue="emeraldTown"/>
                    <f:selectItem itemValue="blueSky"/>
                    <f:selectItem itemValue="wine"/>
                    <f:selectItem itemValue="japanCherry"/>
                    <f:selectItem itemValue="plain"/>
                    <f:selectItem itemValue="ruby"/>
                    <f:selectItem itemValue="classic"/>
                    <f:selectItem itemValue="laguna"/>
                    <f:selectItem itemValue="deepMarine"/>
                    <a4j:support event="onselect" reRender="mainForm" action="javascript:setSkinValue(this.value);"/>
                </rich:comboBox>
                <rich:comboBox
                    id="country1" 
                    selectFirstOnUpdate="false"
                    defaultLabel=""
                    value="#{accountBean.countryCD}"
                    enableManualInput="false"
                    width="200"> 
                    <f:selectItems value="#{accountBean.countryItems}" />
                </rich:comboBox>
                <br/><br/>
                <a4j:include viewId="#{customerBean.formName}" />
            </h:form>
        </rich:panel>

    </h:panelGrid>
    <br/>
</ui:composition>

--------------------------------------- start.xhtml 结束

--------------------------------------- cust_step1.xhtml 结束

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:rich="http://richfaces.org/rich">

<head>
 <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7; IE=EmulateIE8" />
</head>

    <div style="position:relative;height:140px">
        <h:panelGrid id ="custFrm1" width="750px" columns="4" border="0" cellspacing="0" cellpadding="0">

            Customer No: 

            <h:inputText id="customerNo" value="#{customerBean.data.customerno}" size="30" styleClass="inputText"/>

            <h:outputText id="fnamelbl" value="#{customerBean.fnamelbl}:" size="30"/>

            <h:inputText id="firstName" value="#{customerBean.data.firstname}" size="30" styleClass="inputText"/>

            Last Name:

            <h:inputText id="lastName" value="#{customerBean.data.lastname}" size="30" styleClass="inputText"/>

            E-Mail:

            <h:inputText id="eMail" value="#{customerBean.data.emailaddress}" size="30" styleClass="inputText"/>

            Creation Date:

            <rich:calendar id="creationDate" value="#{customerBean.data.creationdate}" size="30"/>

            Country:

            <rich:comboBox
                id="country" 
                selectFirstOnUpdate="false"
                defaultLabel=""
                value="#{customerBean.countryCD}"
                enableManualInput="false"
                width="200" dir="#{customerBean.textDirection}"> 
                <f:selectItems value="#{customerBean.countryItems}" />
                <a4j:support event="onselect" reRender="state"/>
            </rich:comboBox>

            State:

            <rich:comboBox
                id="state" 
                selectFirstOnUpdate="false"
                defaultLabel=""
                value="#{customerBean.stateCD}"
                enableManualInput="false"
                width="200"> 
                <f:selectItems value="#{customerBean.stateItems}" />
                <a4j:support event="onselect" reRender="city"/>
            </rich:comboBox>

            City:

            <rich:comboBox
                id="city" 
                selectFirstOnUpdate="false"
                defaultLabel=""
                value="#{customerBean.cityCD}"
                enableManualInput="false"
                width="200"> 
                <f:selectItems value="#{customerBean.cityItems}" />
            </rich:comboBox>

        </h:panelGrid>
        <BR /><BR />
        <h:panelGroup> 
            <h:outputText value=" " />
            <h:outputText value="Enter Customer No:" />
            <h:inputText id="custNo" value="#{customerBean.custNumberToSearch}" required="true"/>
            <a4j:commandButton id="retrieveButton" value="#{customerBean.retrieveButtonName}" reRender="custFrm1" styleClass="submitButton" action="#{customerBean.actionSearch}"/>
            <a4j:commandButton id="newCustButton" value="#{customerBean.newCustButtonName}" reRender="custFrm1" styleClass="submitButton" action="#{customerBean.actionNewCust}"/>
            <a4j:commandButton id="nextButton" style="float:right" action="next" value="Next &gt;&gt;"/>
        </h:panelGroup>
    </div>

    <rich:hotKey key="alt+n"
    handler="#{rich:element('nextButton')}.click();
    event.stopPropagation();event.preventDefault();
    return false;"/>
    <rich:hotKey selector="#custNo" key="return"
    handler="#{rich:element('retrieveButton')}.click();
    event.stopPropagation();event.preventDefault();
    return false;"/>

</ui:composition>

--------------------------------------- cust_step1.xhtml 结束

--------------- cust_step2.xhtml 的开始

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:rich="http://richfaces.org/rich">

<head>
 <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7; IE=EmulateIE8" />
</head>

    <div style="position:relative;height:140px">    
        <h:panelGroup>
            <rich:simpleTogglePanel switchType="client" label="Customer Properties">
                <rich:dataTable id="custPropertyData" width="723px" value="#{customerBean.data.customerPropertyList}" 
                                var="custPropData" 
                                columnClasses="10,10,10,10"
                                onRowMouseOver="this.style.backgroundColor='#B5F3FB'"
                                onRowMouseOut="this.style.backgroundColor='#{a4jSkin.rowBackgroundColor}'"
                                styleClass="table">

                    <rich:column width="220px">
                        <f:facet name="header">Property Id</f:facet>
                        <h:outputText id="propertyID" value="#{custPropData.propertyid}" />
                    </rich:column>

                    <rich:column width="220px">
                        <f:facet name="header">Property Name</f:facet>
                        <h:outputText id="propertyName" value="#{custPropData.property}" />
                    </rich:column>

                    <rich:column width="220px">
                        <f:facet name="header">Property Value</f:facet>
                        <h:inputText id="propertyValue" value="#{custPropData.propertyvalue}" />
                    </rich:column>
                </rich:dataTable>
            </rich:simpleTogglePanel>
        </h:panelGroup>
        <BR /><BR />
        <h:panelGroup> 
            <a4j:commandButton value="#{customerBean.saveButtonName}" 
                                styleClass="submitButton" 
                                action="#{customerBean.actionSave}"
                                oncomplete="if(#{customerBean.custSaveFlag == true}) 
                                            {#{rich:component('successPopup')}.show()}
                                            else 
                                            {#{rich:component('errorPopup')}.show()}"/>

            <a4j:commandButton 
                value="#{customerBean.storePropButtonName}" 
                styleClass="submitButton"
                oncomplete="#{rich:component('editPanel')}.show()">
                <f:setPropertyActionListener value="#{customerBean}" 
                            target="#{customerBean}"/>  
            </a4j:commandButton>
            <a4j:commandButton id="prevButton" value="&lt;&lt;Previous" style="float:right"  immediate="true" action="previous"/>
        </h:panelGroup>
    </div>

     <rich:modalPanel id="successPopup" modal="true" autosized="true" resizeable="false" width="300">
        <f:facet name="header">
            <h:outputText value="Unicorn" />
        </f:facet>
        <h:panelGrid columns="1" >               
            <h:outputText id="idText" value="#{customerBean.saveSuccessfullMsg}" />
            <h:commandButton action="#" onclick="#{rich:component('successPopup')}.hide(); return false;" value="Cancel"/>
        </h:panelGrid>
     </rich:modalPanel>

     <rich:modalPanel id="errorPopup" autosized="true" width="300">
        <f:facet name="header">
            <h:outputText value="Unicorn" />
        </f:facet>
        <h:panelGrid columns="1" >               
            <h:outputText id="idText1" value="#{customerBean.saveErrorMsg}" />
            <h:commandButton action="#" onclick="#{rich:component('errorPopup')}.hide(); return false;" value="Cancel"/>
        </h:panelGrid>
     </rich:modalPanel>

    <rich:hotKey key="alt+b"
    handler="#{rich:element('prevButton')}.click();
    event.stopPropagation();event.preventDefault();
    return false;"/>

    <rich:modalPanel id="editPanel" autosized="true" width="450">
        <f:facet name="header">
            <h:outputText value="Save Customer Property" />
        </f:facet>

        <f:facet name="controls">
            <h:panelGroup>
                <rich:componentControl for="editPanel" attachTo="hidelink" operation="hide" event="onclick" />
            </h:panelGroup>
        </f:facet>

<h:form id="form1">
<rich:messages style="color:red;"></rich:messages>
            <h:panelGrid columns="1">
                <a4j:outputPanel ajaxRendered="true">
                    <h:panelGrid columns="2">
                        <h:outputText value="Property Name" />
                        <rich:comboBox
                                id="propname" 
                                selectFirstOnUpdate="false"
                                defaultLabel=""
                                value="#{customerBean.propertyName}"
                                enableManualInput="false"
                                width="250"> 
                            <f:selectItems value="#{customerBean.propertyItems}" />
                        </rich:comboBox>
                        <h:outputText value="Property Value" />
                        <h:inputText id="propval" value="#{customerBean.propertyValue}"/>
                    </h:panelGrid>
                    <rich:message showSummary="true" showDetail="false" for="propname" />
                </a4j:outputPanel>
                <a4j:commandButton value="Store"
                    action="#{customerBean.actionPropertyStore}"
                    reRender="custPropertyData"
                    oncomplete="if (#{facesContext.maximumSeverity==null}) #{rich:component('editPanel')}.hide();"/>
            </h:panelGrid>
</h:form>
    </rich:modalPanel>
</html>

--------------- cust_step2.xhtml 结束

--------------- faces-Config.xml 的开始

<?xml version="1.0" encoding="UTF-8"?>

<faces-config version="1.2" 
xmlns="http://java.sun.com/xml/ns/javaee" 
xmlns:xi="http://www.w3.org/2001/XInclude" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">

    <application>
      <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
    </application>

    <lifecycle>
        <phase-listener>mypackage.ActionListener</phase-listener>
    </lifecycle>

    <managed-bean>
        <managed-bean-name>skinBean</managed-bean-name>
        <managed-bean-class>mypackage.SkinBean</managed-bean-class>
        <managed-bean-scope>session</managed-bean-scope>        
    </managed-bean>

    <managed-bean>
        <managed-bean-name>customerBean</managed-bean-name>
        <managed-bean-class>mypackage.CustomerBean</managed-bean-class>
        <managed-bean-scope>request</managed-bean-scope>        
    </managed-bean>

    <managed-bean>
        <managed-bean-name>accountBean</managed-bean-name>
        <managed-bean-class>mypackage.AccountBean</managed-bean-class>
        <managed-bean-scope>request</managed-bean-scope>        
    </managed-bean>

    <navigation-rule> 
        <from-view-id>/Customer/cust_step1.xhtml</from-view-id> 
        <navigation-case> 
            <from-outcome>next</from-outcome> 
            <to-view-id>/Customer/cust_step2.xhtml</to-view-id> 
        </navigation-case> 
    </navigation-rule>  
    <navigation-rule> 
        <from-view-id>/Customer/cust_step2.xhtml</from-view-id> 
        <navigation-case> 
            <from-outcome>previous</from-outcome> 
            <to-view-id>/Customer/cust_step1.xhtml</to-view-id> 
        </navigation-case> 
    </navigation-rule>   
</faces-config>

--------------- faces-Config.xml 结束

4

1 回答 1

0

你写了

<a4j:commandButton id="nextButton" style="float:right" action="next" value="Next &gt;&gt;"/>

将上面替换为

<a4j:commandButton id="nextButton" style="float:right" action="#{customerBean.nextAction}" value="Next"/>
于 2013-05-07T06:29:34.783 回答