1

使用 JSP 和 RichFaces。当单击“运行搜索”按钮时,搜索 div 应该被遮住,结果 div 应该被遮住。

       <div id="paper">

        <f:view>
            <h:form>

                <div id="criteria">
                    <rich:panel header="Search">
                        <h:inputText value="#{Bean.name}" id="name">
                            <h:outputLabel for="name" value="Enter Name: " />
                        </h:inputText>

                        <a4j:commandButton value="Run Search" action="#{Bean.runSearch}"
                                           onclick="hideCrit({duration:0.8}); showResult({delay:1.5,duration:0.5});"
                                           reRender="searchresultstable">
                        </a4j:commandButton>
                    </rich:panel>
                </div> <!-- end criteria -->

                <rich:effect name="hideCrit" for="criteria" type="BlindUp" />
                <rich:effect name="showResult" for="results" type="BlindDown" />

                <div id="results" style="display: none;">
                    <a4j:commandButton
                        id="searchbttn" value="Back To Search"
                        onclick="hideResult({duration:0.8}); showCrit({delay:0.9,duration:0.5});"
                        reRender="searchresultstable" />

                    <rich:panel header="Results">
                        <rich:dataTable id="searchresultstable" value="#{Bean.results}" var="req"
                                        styleClass="dataTable" rowClasses="oddrow, evenrow">

                            <f:facet name="header">
                                <rich:columnGroup>
                                    <h:column>
                                        <h:outputText styleClass="headerText" value="Name" />
                                    </h:column>
                                </rich:columnGroup>
                            </f:facet>

                            <rich:columnGroup>
                                <rich:column>
                                    <h:outputText value="#{req.name}" />
                                </rich:column>
                            </rich:columnGroup>
                        </rich:dataTable>
                    </rich:panel>
                </div> <!-- end results -->

                <rich:effect name="showCrit" for="criteria" type="BlindDown" />
                <rich:effect name="hideResult" for="results" type="BlindUp" />

            </h:form>
        </f:view>

    </div> <!-- end paper -->

我在 tomcat 网络服务器上运行它。

包含的库有:

  • JSF 1.2
  • JSTL 1.1
  • commons-beanutils-1.7.0.jar
  • commons-collections-3.2.jar
  • commons-lang-2.2.jar
  • commons-logging-1.1.1.jar
  • mysql-connector-java-3.1.1.jar
  • richfaces-api-3.3.0.GA.jar
  • richfaces-impl-3.3.0.GA.jar
  • richfaces-ui-3.3.0.GA.jar

我收到两个错误。

这在加载:

element.dispatchEvent 不是函数

当单击“运行搜索”按钮时。

element.makeClipping 不是函数

编辑 似乎其他丰富的组件可以工作,但是,我尝试了多种,例如淡入淡出,但它们似乎不起作用。

谢谢,

4

1 回答 1

1

问题是 context.xml 文件中的一个参数。

原始文件:

<?xml version="1.0" encoding="UTF-8"?>
<Context antiJARLocking="true" path="/project"/>

antiJARLocking 参数不是我认识的,所以我删除了它,现在一切正常。

新文件:

<?xml version="1.0" encoding="UTF-8"?>
<Context path="/project">

感谢大家的投入。

于 2009-04-29T19:15:12.223 回答