views:

1308

answers:

1

Using JSP and RichFaces. The search div should blind up when the "Run Search" button is clicked and the results div should blind down.

       <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 -->

I am running this on tomcat web server.

The Libraries included are:

  • 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

I am getting two errors.

This on load:

element.dispatchEvent is not a function

and this when the "Run Search" button is clicked.

element.makeClipping is not a function

EDIT It seems that other rich components work such as , however, I have tried multiple such as fade and they do not seem to work.

Thanks,

+1  A: 

The problem was a parameter in the context.xml file.

Original File:

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

The antiJARLocking parameter was not something I recognized, so I removed it and everything works fine now.

New File:

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

Thanks for the input everybody.

Berek Bryan