prototype.js
elenctic87 Oct 28, 2008 8:38 PMI'm using Exadel's Fiji components in a Seam application that makes use of richfaces. I want to send an ajax request and after it completes update the chart component using the .update() method which is a part of prototype.js. The problem is that the chart component does not have a .update() method. Nor are is the prototype.js file included as a script.
Here is the head section of the page. You can see which scripts are included. I'm using ajax4jsf to send the ajax requests. Do I have to somehow configure it in web.xml? (I have included my web.xml below, too).
<head> <link class="component" rel="stylesheet" type="text/css" href="/ds2/a4j/s/3_2_2.CR3org/richfaces/renderkit/html/css/basic_classes.xcss/DATB/eAF7sqpgb-jyGdIAFrMEaw__"> </link> <link class="component" rel="stylesheet" type="text/css" href="/ds2/a4j/s/3_2_2.CR3org/richfaces/renderkit/html/css/extended_classes.xcss/DATB/eAF7sqpgb-jyGdIAFrMEaw__"> </link> <link class="component" rel="stylesheet" type="text/css" href="/ds2/a4j/s/3_2_2.CR3css/toolBar.xcss/DATB/eAF7sqpgb-jyGdIAFrMEaw__"> </link> <link class="component" rel="stylesheet" type="text/css" href="/ds2/a4j/s/3_2_2.CR3css/panel.xcss/DATB/eAF7sqpgb-jyGdIAFrMEaw__"> </link> <script type="text/javascript" src="/ds2/a4j/g/3_2_2.CR3org.ajax4jsf.javascript.AjaxScript"> </script> <script type="text/javascript" src="/ds2/a4j/g/3_2_2.CR3com/exadel/fiji/renderkit/html/AC_OETags.js"> </script> <script type="text/javascript"> </script> <script type="text/javascript" src="/ds2/a4j/g/3_2_2.CR3org/richfaces/renderkit/html/scripts/skinning.js"> </script> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <title>ds2</title> <link href="stylesheet/theme.css" rel="stylesheet" type="text/css"> </link> </head>
Web.xml:
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> <display-name>ds2</display-name> <welcome-file-list> <welcome-file>index.html</welcome-file> <welcome-file>index.htm</welcome-file> <welcome-file>index.jsp</welcome-file> <welcome-file>default.html</welcome-file> <welcome-file>default.htm</welcome-file> <welcome-file>default.jsp</welcome-file> </welcome-file-list> <servlet> <servlet-name>Faces Servlet</servlet-name> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern>*.seam</url-pattern> </servlet-mapping> <context-param> <param-name>org.richfaces.SKIN</param-name> <param-value>blueSky</param-value> </context-param> <listener> <listener-class>org.jboss.seam.servlet.SeamListener</listener-class> </listener> <filter> <filter-name>Seam Filter</filter-name> <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class> </filter> <filter-mapping> <filter-name>Seam Filter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <servlet> <servlet-name>Seam Resource Servlet</servlet-name> <servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>Seam Resource Servlet</servlet-name> <url-pattern>/seam/resource/*</url-pattern> </servlet-mapping> <context-param> <param-name>facelets.DEVELOPMENT</param-name> <param-value>true</param-value> </context-param> <context-param> <param-name>javax.faces.DEFAULT_SUFFIX</param-name> <param-value>.xhtml</param-value> </context-param> <security-constraint> <display-name>Restrict raw XHTML Documents</display-name> <web-resource-collection> <web-resource-name>XHTML</web-resource-name> <url-pattern>*.xhtml</url-pattern> </web-resource-collection> <auth-constraint/> </security-constraint> </web-app>
Finally, here is the .xhtml file:
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:s="http://jboss.com/products/seam/taglib" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:a="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich" xmlns:fiji="http://exadel.com/fiji" template="layout/template.xhtml"> <ui:define name="body"> <h:messages globalOnly="true" styleClass="message" /> <rich:panel> <f:facet name="header">Welcome!</f:facet> <p>This empty shell application includes:</p> <ul> <li>Ant build script</li> <li>Deployment to JBoss AS (EAR or WAR)</li> <li>Development and production profiles</li> <li>Integration testing using TestNG and Embedded JBoss</li> <li>JavaBean or EJB 3.0 Seam components</li> <li>JPA entity caoeu oeu</li> <li>A configurable DataSource and JPA EntityManager</li> <li>Templated Facelets views</li> <li>RichFaces panels and tables</li> <li>Default CSS stylesheet</li> <li>Internationalization support</li> </ul> </rich:panel> <rich:panel id="chartsPanel"> <fiji:barChart id="barChartOne22" value="#{AuctionQuery.data2[1]}" displayLegend="false" width="280" height="230" title="AuctionQuery.data2[1]"> <fiji:chartData type="name" value="Series Array" /> </fiji:barChart> </rich:panel> <h:form> <h:inputText value="#{AuctionQuery.qperiod}"> <a:support event="onblur" oncomplete="document.getElementById('barChartOne22:component').update(); alert('aoeu');" /> </h:inputText> </h:form> </ui:define> </ui:composition>
Please let me know if I should configure things differently. I have been stumped by this one for a while.
Thank you.