JSFTemplating's default factories simply pass through all properties
(declared or not) through to the UIComponent. This error message is not
related to that code. This says that it thinks you're trying to use a
"handler" called "onClick" and that handler is not declared. The syntax
below does not attempt to use an onClick "handler"... so perhaps this is
somewhere else in your file? If the parser is not working for the code
below, then it is a bug... I will try this and get back to you...
however, I've used onClick's for other components before.
Ken
Anissa Lam wrote:
>
> Hi,
> It looks like i cannot use onClick for <sun:button>
> Does the syntax correct ? or this is missing support from jsftemplating ?
>
> Here is how my button looks like:
>
> <sun:button id="previousButton"
> onClick="javascript: alert(' previous
> button ')"
> immediate="#{true}"
> text="$resource{i18n.button.Previous}" >
> <!command
> setAttribute(key="fromStep2"
> value="#{true}")
>
> navigate(page="/resources/jdbcConnectionPoolNew1.jsf")
> />
> </sun:button>
>
> During the parsing of this page, i got the followin exception:
>
> [#|2006-09-21T08:26:01.153-0700|SEVERE|sun-appserver-ee9.1|javax.enterprise.system.container.web|_ThreadID=13;_ThreadName=httpWorkerThread-8080-1;_RequestID=4af2157f-32a0-4b48-a677-78aac6efb510;|StandardWrapperValve[FacesServlet]:
> PWC1406: Servlet.service() for servlet FacesServlet threw exception
> com.sun.jsftemplating.layout.SyntaxException: Handler 'onClick' in
> event 'command' is not declared! Ensure the '_at_Handler' annotation has
> been defined on the handler Java method, that it has been compiled
> with the annotation processing tool, and that the resulting
> 'META-INF/jsftemplating/Handler.map' is located in your classpath (you
> may need to do a clean build).
> at
> com.sun.jsftemplating.layout.template.TemplateReader$EventParserCommand.process(TemplateReader.java:762)
>
> at
> com.sun.jsftemplating.layout.template.BaseProcessingContext.beginSpecial(BaseProcessingContext.java:122)
>
> at
> com.sun.jsftemplating.layout.template.TemplateReader$LayoutComponentContext.beginSpecial(TemplateReader.java:723)
>
> at
> com.sun.jsftemplating.layout.template.TemplateReader.process(TemplateReader.java:262)
>
> at
> com.sun.jsftemplating.layout.template.BaseProcessingContext.beginComponent(BaseProcessingContext.java:82)
>
> at
> com.sun.jsftemplating.layout.template.TemplateReader.process(TemplateReader.java:268)
>
> at
> com.sun.jsftemplating.layout.template.BaseProcessingContext.beginComponent(BaseProcessingContext.java:82)
>
> at
> com.sun.jsftemplating.layout.template.TemplateReader.process(TemplateReader.java:268)
>
> at
> com.sun.jsftemplating.layout.template.TemplateReader$FacetParserCommand.process(TemplateReader.java:983)
>
> at
> com.sun.jsftemplating.layout.template.BaseProcessingContext.beginSpecial(BaseProcessingContext.java:119)
>
> at
> com.sun.jsftemplating.layout.template.TemplateReader$LayoutComponentContext.beginSpecial(TemplateReader.java:723)
>
> at
> com.sun.jsftemplating.layout.template.TemplateReader.process(TemplateReader.java:262)
>
> at
> com.sun.jsftemplating.layout.template.BaseProcessingContext.beginComponent(BaseProcessingContext.java:82)
>
> at
> com.sun.jsftemplating.layout.template.TemplateReader.process(TemplateReader.java:268)
>
> at
> com.sun.jsftemplating.layout.template.BaseProcessingContext.beginComponent(BaseProcessingContext.java:82)
>
> at
> com.sun.jsftemplating.layout.template.TemplateReader.process(TemplateReader.java:268)
>
> at
> com.sun.jsftemplating.layout.template.BaseProcessingContext.beginComponent(BaseProcessingContext.java:82)
>
> at
> com.sun.jsftemplating.layout.template.TemplateReader.process(TemplateReader.java:268)
>
> at
> com.sun.jsftemplating.layout.template.BaseProcessingContext.beginComponent(BaseProcessingContext.java:82)
>
> at
> com.sun.jsftemplating.layout.template.TemplateReader.process(TemplateReader.java:268)
>
> at
> com.sun.jsftemplating.layout.template.BaseProcessingContext.beginComponent(BaseProcessingContext.java:82)
>
> at
> com.sun.jsftemplating.layout.template.TemplateReader.process(TemplateReader.java:268)
>
> at
> com.sun.jsftemplating.layout.template.TemplateReader.readLayoutDefinition(TemplateReader.java:156)
>
> at
> com.sun.jsftemplating.layout.template.TemplateReader.read(TemplateReader.java:114)
>
> at
> com.sun.jsftemplating.layout.template.TemplateLayoutDefinitionManager.getLayoutDefinition(TemplateLayoutDefinitionManager.java:163)
>
> at
> com.sun.jsftemplating.layout.LayoutDefinitionManager.getLayoutDefinition(LayoutDefinitionManager.java:208)
>
> at
> com.sun.jsftemplating.layout.LayoutViewRoot.getLayoutDefinition(LayoutViewRoot.java:227)
>
> at
> com.sun.jsftemplating.layout.LayoutViewHandler.createView(LayoutViewHandler.java:128)
>
> at
> com.sun.jsftemplating.handlers.NavigationHandlers.navigate(NavigationHandlers.java:120)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:585)
> at
> com.sun.jsftemplating.layout.descriptors.handler.Handler.invoke(Handler.java:332)
>
> at
> com.sun.jsftemplating.layout.descriptors.LayoutElementBase.dispatchHandlers(LayoutElementBase.java:336)
>
> at
> com.sun.jsftemplating.layout.descriptors.LayoutElementBase.dispatchHandlers(LayoutElementBase.java:316)
>
> at
> com.sun.jsftemplating.layout.event.CommandActionListener.invokeCommandHandlers(CommandActionListener.java:132)
>
> at
> com.sun.jsftemplating.layout.event.CommandActionListener.processAction(CommandActionListener.java:80)
>
> at javax.faces.event.ActionEvent.processListener(ActionEvent.java:77)
> at
> javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:776)
> at javax.faces.component.UICommand.broadcast(UICommand.java:368)
> at
> javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:471)
> at
> javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:783)
> at
> com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
>
> at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:244)
> at
> com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:113)
> at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
> at
> org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:397)
>
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:276)
>
> at
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586)
>
> at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:556)
>
> at
> org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:246)
>
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:185)
>
> at
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586)
>
> at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:73)
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:182)
>
> at
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586)
>
> at
> com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120)
>
> at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
> at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137)
>
> at
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586)
>
> at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:556)
>
> at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
> at
> org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:239)
> at
> com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:618)
>
> at
> com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.processNonBlocked(DefaultProcessorTask.java:549)
>
> at
> com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:789)
>
> at
> com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:328)
>
> at
> com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:251)
>
> at
> com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:205)
>
> at
> com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
> at
> com.sun.enterprise.web.connector.grizzly.WorkerThreadImpl.run(WorkerThreadImpl.java:103)
>
> |#]
>