Just a guess in the wild, but maybe it's because of a bad use of auto-completion in Eclipse. There's another ActionEvent class in package java.awt.something . Make sure you import javax.faces.event.ActionEvent in your bean, and not the awt thing.
Regards, Cedric Durmont 2010/11/11 <[email protected]>: > I am new to MyFaces Trinidad component library and I am trying to do some > pretty simple stuff. I am experiencing a problem with getting the > tr:commandButton to actually invoke the managed bean's method. My setup is > as follows: > > - Ubuntu Linux 64-bit > - Sun JDK 1.6.0_20 > - Tomcat 6.0.29 > - Apache MyFaces JSF Core 1.2.9 > - Apache MyFaces Trinidad 1.2.13 > - Facelets 1.1.15 > - Development IDE = Eclipse Helios > > For testing I have made reduced the eventHandler method called by the Search > Button do nothing but System.out.println("..."), to confirm if it is being > called. It is not. Any ideas on what I am missing (something obvious, I am > sure)? > > Here is the xhtml file with the unresponsive commandButton: > -------------------------------------------------------------------------------------------- > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> > <tr:document xmlns="http://www.w3.org/1999/xhtml" > xmlns:h="http://java.sun.com/jsf/html" > xmlns:f="http://java.sun.com/jsf/core" > xmlns:ui="http://java.sun.com/jsf/facelets" > xmlns:tr="http://myfaces.apache.org/trinidad" > xmlns:trh="http://myfaces.apache.org/trinidad/html"> > > <trh:head title="Litens Automotive Group - Agile Drawing Search"> > <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> > <link href="css/stylesheet.css" rel="stylesheet" type="text/css" /> > </trh:head> > > <tr:form id="form1"> > > <tr:panelGroupLayout id="top" layout="horizontal" styleClass="greyBox"> > <tr:panelGroupLayout id="left" layout="vertical" > styleClass="subContainer"> > <tr:outputText value="Agile Drawing Search" > inlineStyle="font-weight: bold; margin-bottom: 10px"/> > <tr:spacer height="10"/> > <tr:outputText value="Enter Part Number:"/> > <tr:inputText id="searchString" > contentStyle="width: 200px" > maximumLength="20" > value="#{DrawingFetcherBean.searchString}" /> > <tr:commandButton text="Search" > id="searchButton" > partialSubmit="true" > > actionListener="#{DrawingFetcherBean.loadDrawingResultsEventHandler}" /> > </tr:panelGroupLayout> > <tr:panelGroupLayout id="right" layout="vertical"> > <h:graphicImage url="/cad_logo.jpg" alt="Logo" > style="margin-right: 10px"/> > </tr:panelGroupLayout> > </tr:panelGroupLayout> > > <tr:spacer height="30"/> > > <tr:panelGroupLayout id="bottom" layout="vertical" class="greyBox" > partialTriggers="searchButton"> > <tr:outputText value="Search Results:" inlineStyle="font-weight: > bold; margin-bottom: 10px"/> > <tr:table var="searchResults" > value="#{DrawingFetcherBean.drawingResults}" > columns="4" columnBandingInterval="1"> > <tr:column headerText="Part Number" width="120px"> > <tr:outputText value="#{searchResults.partNumber}"/> > </tr:column> > <tr:column headerText="Revision"> > <tr:outputText value="#{searchResults.revision}"/> > </tr:column> > <tr:column headerText="Part Type" width="150px"> > <tr:outputText value="#{searchResults.partType}"/> > </tr:column> > <tr:column headerText="File Name" width="100px"> > <tr:outputText value="#{searchResults.fileName}"/> > </tr:column> > <tr:column headerText="_____"> > <h:commandButton value="Get" action="Submit" /> > </tr:column> > </tr:table> > </tr:panelGroupLayout> > </tr:form> > </tr:document> > > -------------------------------------------------------------------------------------------------- > > Here is the managed bean snippet: > > public class DrawingFetcher implements Serializable > { > String searchString; > String fileName; > ... > ... > public void loadDrawingResultsEventHandler(ActionEvent event) > { > System.out.println("Drawing Results loaded!"); > } > } > > > Here is the 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>Test_Trinidad</display-name> > <welcome-file-list> > <welcome-file>index.html</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>*.xhtml</url-pattern> > </servlet-mapping> > <!-- FaceletViewHandler configuration --> > <context-param> > <param-name>org.apache.myfaces.trinidad.ALTERNATE_VIEW_HANDLER</param-name> > > <param-value>org.apache.myfaces.trinidadinternal.facelets.TrinidadFaceletViewHandler</param-value> > </context-param> > <!-- Use documents saved as *.xhtml for Facelets --> > <context-param> > <param-name>javax.faces.DEFAULT_SUFFIX</param-name> > <param-value>.xhtml</param-value> > </context-param> > <context-param> > <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name> > <param-value>resources.application</param-value> > </context-param> > <context-param> > <description>State saving method: 'client' or 'server' (=default). See JSF > Specification 2.5.2</description> > <param-name>javax.faces.STATE_SAVING_METHOD</param-name> > <param-value>client</param-value> > </context-param> > <context-param> > <description> > This parameter tells MyFaces if javascript code should be allowed in > the rendered HTML output. > If javascript is allowed, command_link anchors will have javascript code > that submits the corresponding form. > If javascript is not allowed, the state saving info and nested parameters > will be added as url parameters. > Default is 'true'</description> > <param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name> > <param-value>true</param-value> > </context-param> > <context-param> > <description> > If true, rendered HTML code will be formatted, so that it is > 'human-readable' > i.e. additional line separators and whitespace will be written, that do not > influence the HTML code. > Default is 'true'</description> > <param-name>org.apache.myfaces.PRETTY_HTML</param-name> > <param-value>true</param-value> > </context-param> > <context-param> > <param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name> > <param-value>false</param-value> > </context-param> > <context-param> > <description> > If true, a javascript function will be rendered that is able to restore the > former vertical scroll on every request. Convenient feature if you have > pages > with long lists and you do not want the browser page to always jump to the > top > if you trigger a link or button action that stays on the same page. > Default is 'false' > </description> > <param-name>org.apache.myfaces.AUTO_SCROLL</param-name> > <param-value>true</param-value> > </context-param> > <listener> > > <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class> > </listener> > </web-app> > > Here is the 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"> > <managed-bean> > <managed-bean-name>DrawingFetcherBean</managed-bean-name> > <managed-bean-class>com.litens.agile.cad.DrawingFetcher</managed-bean-class> > <managed-bean-scope>session</managed-bean-scope> > </managed-bean> > <application> > <!-- Use the Trinidad RenderKit --> > <default-render-kit-id>org.apache.myfaces.trinidad.core</default-render-kit-id> > </application> > </faces-config> > > > ************************** CONFIDENTIALITY NOTE ************************** > This message contains information which may be privileged or confidential , > or exempt from disclosure under applicable law. If the reader of this > message is not the intended recipient, or the employee or agent responsible > for delivering the message to the intended recipient, you are hereby NOTIFIED > that any dissemination, distribution, retention, archiving, or copying of > this communication is strictly prohibited. If you have received this e-mail > in error, please notify us immediately by calling our office at (905) > 856-0200 or by return e-mail to the Sender of this e-mail. > ************************** CONFIDENTIALITY NOTE ************************** >

