File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes h:Commandlink error passing param and opening javascript error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "h:Commandlink error passing param and opening javascript error" Watch "h:Commandlink error passing param and opening javascript error" New topic
Author

h:Commandlink error passing param and opening javascript error

siva prasa
Greenhorn

Joined: Feb 16, 2010
Posts: 25
Help me i am gettin this error.I have to call my action event methos and open javascript from there how to do that???

My error in tomcat:


Mar 2, 2010 1:34:00 PM javax.faces.event.MethodExpressionActionListener processAction
SEVERE: Received 'org.apache.jasper.el.JspMethodNotFoundException' when invoking action listener '#{transactionListBean.openPopupClickedEvent}' for
component 'cmdlink'
Mar 2, 2010 1:34:00 PM javax.faces.event.MethodExpressionActionListener processAction
SEVERE: org.apache.jasper.el.JspMethodNotFoundException: /transaction/TransactionSummary.jsp(49,6) '#{transactionListBean.openPopupClickedEvent}' Me
thod not found: com.celcom.app.bean.TransactionListBean@f3ed4d.openPopupClickedEvent(javax.faces.event.ActionEvent)
at org.apache.jasper.el.JspMethodExpression.invoke(JspMethodExpression.java:71)
at javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:99)
at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88)
at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:771)
at javax.faces.component.UICommand.broadcast(UICommand.java:372)
at org.ajax4jsf.component.UIDataAdaptor.broadcast(UIDataAdaptor.java:1364)
at org.ajax4jsf.component.UIInclude.broadcast(UIInclude.java:170)
at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:324)
at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:299)
at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:256)
at org.ajax4jsf.component.AjaxViewRoot.processDecodes(AjaxViewRoot.java:412)
at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:78)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:341)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Thread.java:619)

2010 Mar 02 13:34:00 [http-8080-1] ERROR org.ajax4jsf.component.AjaxViewRoot - Error processing faces event for the component mainPpsInclude
javax.faces.event.AbortProcessingException: /transaction/TransactionSummary.jsp(49,6) '#{transactionListBean.openPopupClickedEvent}' Method not foun
d: com.celcom.app.bean.TransactionListBean@f3ed4d.openPopupClickedEvent(javax.faces.event.ActionEvent)
at javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:118)
at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88)
at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:771)
at javax.faces.component.UICommand.broadcast(UICommand.java:372)
at org.ajax4jsf.component.UIDataAdaptor.broadcast(UIDataAdaptor.java:1364)
at org.ajax4jsf.component.UIInclude.broadcast(UIInclude.java:170)
at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:324)
at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:299)
at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:256)
at org.ajax4jsf.component.AjaxViewRoot.processDecodes(AjaxViewRoot.java:412)
at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:78)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:341)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.apache.jasper.el.JspMethodNotFoundException: /transaction/TransactionSummary.jsp(49,6) '#{transactionListBean.openPopupClickedEvent}'
Method not found: com.celcom.app.bean.TransactionListBean@f3ed4d.openPopupClickedEvent(javax.faces.event.ActionEvent)
at org.apache.jasper.el.JspMethodExpression.invoke(JspMethodExpression.java:71)
at javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:99)
... 34 more


Bean:

public void openPopupClickedEvent(ActionEvent event) {
// View's id in the same form as used in the navigation rules in faces-config.xml
// This value could be passed as parameter (using <f:param>)
FacesContext context = FacesContext.getCurrentInstance();
Map requestMap = context.getExternalContext().getRequestParameterMap();
String value = (String)requestMap.get("statusValue");
log.debug("Param name:"+value);

final String viewId = "/popup.faces";

FacesContext facesContext = FacesContext.getCurrentInstance();

// This is the proper way to get the view's url
ViewHandler viewHandler = facesContext.getApplication().getViewHandler();
String actionUrl = viewHandler.getActionURL(facesContext, viewId);

String javaScriptText = "window.open('"+actionUrl+"', 'popupWindow', 'dependent=yes, menubar=no, toolbar=no');";

// Add the Javascript to the rendered page's header for immediate execution
AddResource addResource = AddResourceFactory.getInstance(facesContext);
addResource.addInlineScriptAtPosition(facesContext, AddResource.HEADER_BEGIN, javaScriptText);
}


Jsp page:

<%@ page import="java.util.*,java.text.*"%>
<%@ page language="java" import="java.sql.*" %>
<%@ page import="java.text.SimpleDateFormat"%>

<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"%>
<!-- RichFaces tag library declaration -->
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<h:inputHidden id="totalTransCount" value="#{transactionListBean.totalTransCount}"/>
<h:inputHidden id="currdate" value="#{transactionListBean.hiddenCurrentDate}"/>
<html>
<head>
<link href="../_assets/css/celcom.css" rel="stylesheet" type="text/css">
<title>Transaction List</title>
</head>
<body>
<f:subview id="transSummaryList">
<h:form id="transactionSummaryListForm">
<div id="myProfile" class="screenmoveleft">
<center>
<a4j:region id="transactionSummaryRegion">
<h:panelGrid border="0" columns="2" style="width: 250px" styleClass="celcomBlack01">
<hutputText value="Transaction Summary"
styleClass="celcomBlack01" style="align:left;font-weight:bold" />
<hutputText value="#{transactionListBean.hiddenCurrentDate}"
styleClass="celcomBlack01" style="align:left;font-weight:bold" />
</h:panelGrid>
<h:panelGrid border="0" style="width: 50px">

<rich:dataTable id="transactionSummaryData" value="#{transactionListBean.transactionSummaryList}"
var="transactionsSummary" width="300" rowKeyVar="row" columnClasses="celcomBlack01"
ajaxKeys="#{transactionListBean.keys}" >
<!-- ----------------------------------------------------------------- Table Header -->
<f:facet name="header" >
<rich:columnGroup columnClasses="celcomBlack01">
<rich:column width="200">
<hutputText value="Transaction Type" />
</rich:column>
<rich:column width="100" >
<hutputText value="Total" />
</rich:column>
</rich:columnGroup>

</f:facet>
<!-- ----------------------------------------------------------------- Transaction Type field -->
<rich:column width="#{msg['transaction.MerchantIDWidth']}" >
<h:commandLink id="cmdlink" value="#{transactionsSummary.txnStatus}"
actionListener="#{transactionListBean.openPopupClickedEvent}"
immediate="true" style="text-decoration:underline">
<f:param name="statusValue" value="#{transactionsSummary.txnStatus}" />
</h:commandLink>
</rich:column>

<!-- ----------------------------------------------------------------- Transaction Count field -->
<rich:column width="#{msg['transaction.MerchantIDWidth']}" >
<hutputText id="transactionCount" value="#{transactionsSummary.txnStatusCount}" style="text-align:right;width:100px;" />
</rich:column>

</rich:dataTable>
</h:panelGrid>
<h:panelGrid border="0" columns="2" style="width: 250px" styleClass="celcomBlack01">
<hutputText value="Total:" style="align:left;font-weight:bold"/>
<hutputText id="totalField" value="#{transactionListBean.totalTransCount}"
style="text-align:right;width:255px;font-weight:bold"/>
</h:panelGrid>
<br>
<div id="transSummary" style="text-align: left";>
<h:panelGrid id="transSummaryExportToExcel" columns="1" >
<a4j:commandButton value="Export Summary To Excel" styleClass="celcomBlack01"
/>
</h:panelGrid>
</div>
</a4j:region>
</center>
</div>
</h:form>
</f:subview>

</body>
</html>
<script>
function editContact(trans)
{
var data = trans;
alert("Pas");
alert(data.value);

}
</script>


It is not calling my backing bean mehod why it is like that???help me......
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: h:Commandlink error passing param and opening javascript error
 
Similar Threads
Getting Nullpointer exception in file upload
Error in File upload in JSF.How to get the file name in bean?
javax.faces.FacesException: javax.faces.model.NoRowAvailableException
Problem with rich:listShuttle
h:selectOneMenu PROBLEM