Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
surjeet singh
Call action from popup page
November 19, 2012 1:33 AM
Answer

surjeet singh

Rank: New Member

Posts: 14

Join Date: October 8, 2012

Recent Posts

Hi all,

I have some problem with calling action from a popup page. Here is my code

here is my view.jsp

 1
 2<DIV style="width: 200px;height: 40px" id=content>Branch Name - ' + branchName + '</br> IFSC Code - '+ifscCode+' <a onclick="return <portlet:namespace />showFeedback();">[b]Feedback[/b]</a></DIV>
 3
 4
 5function <portlet:namespace />openLookup(contextPath) {       
 6            var searchResult = document.getElementById("searchResult").value; 
 7            alert("contextPath=="+contextPath);            
 8            var directoryPath = contextPath + '/html/branchfeedbackportlet/list.jsp?email='+ searchResult;       
 9            var winRef = window.open(directoryPath, 'UsersDetails', 'height=450,status=no,toolbar=no,width=600,resizable=no,scrollbars=yes');
10}


list.jsp

<%String emailId= request.getParameter("email");
out.println("emailId"+emailId);
%>

onclick of that link "Feedback", I get list.jsp page as a popup window and I also get the email value in that jsp . When I put that code in list.jsp as

 1<%
 2PortletURL updateBrachFeedback = renderResponse.createActionURL();
 3updateBrachFeedback.setParameter(ActionRequest.ACTION_NAME,"branchFeedBackSubmit");
 4%>
 5<%String emailId= request.getParameter("email");
 6out.println("emailId"+emailId);
 7%>
 8<form name="fm" method="POST" action="<%=updateBrachFeedback.toString()%>">
 9            <div class="exText">
10                <label for="name">Feedback Comment: <span style="color: red">*</span>
11                </label>
12            </div>
13            <div class="exInput">
14                <textarea cols="50" rows="10" style="" name="feedback"></textarea>
15            </div>
16            <aui:button type="submit" value="SUBMIT" />   
17            <input type="hidden" name="redirectURL"
18                value="<%=renderResponse.createRenderURL().toString()%>" />       
19</form>

as I am calling action by submitting the SUBMIT button it gives me error as


 1SEVERE: Servlet.service() for servlet [jsp] in context with path [/BranchFeedback-portlet] threw exception [An exception occurred processing JSP page /html/branchfeedbackportlet/list.jsp at line 21
 2
 318: List<BranchFeedback> branchFeedbacks =
 419:     BranchFeedbackLocalServiceUtil.getBranchFeedbacks(0, count);
 520: List<BranchLocator> searchList = BranchLocatorLocalServiceUtil.findBranchBySearchString("Mumbai", 0, 10);
 621: PortletURL updateBrachFeedback = renderResponse.createActionURL();
 722: updateBrachFeedback.setParameter(ActionRequest.ACTION_NAME,"branchFeedBackSubmit");
 823: %>
 924: <table border="1" width="80%" class="availProdTable">
10
11
12Stacktrace:] with root cause
13java.lang.NullPointerException
14    at org.apache.jsp.html.branchfeedbackportlet.list_jsp._jspService(list_jsp.java:170)
15    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
16    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
17    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
18    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
19    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
20    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
21    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
22    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
23    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:72)
24    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
25    at sun.reflect.GeneratedMethodAccessor349.invoke(Unknown Source)
26    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
27    at java.lang.reflect.Method.invoke(Method.java:597)
28    at com.liferay.portal.kernel.bean.ClassLoaderBeanHandler.invoke(ClassLoaderBeanHandler.java:67)
29    at $Proxy403.doFilter(Unknown Source)
30    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:72)
31    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
32    at com.liferay.portal.servlet.filters.gzip.GZipFilter.processFilter(GZipFilter.java:123)
33    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
34    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
35    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
36    at com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:70)
37    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
38    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
39    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
40    at sun.reflect.GeneratedMethodAccessor349.invoke(Unknown Source)
41    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
42    at java.lang.reflect.Method.invoke(Method.java:597)
43    at com.liferay.portal.kernel.bean.ClassLoaderBeanHandler.invoke(ClassLoaderBeanHandler.java:67)
44    at $Proxy403.doFilter(Unknown Source)
45    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:72)
46    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:167)
47    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:95)
48    at com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:70)
49    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
50    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
51    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:73)
52    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
53    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
54    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
55    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
56    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
57    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
58    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
59    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
60    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
61    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
62    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)
63    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
64    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
65    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
66    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
67    at java.lang.Thread.run(Thread.java:619)



please help me with that.
Anil Sunkari
RE: Call action from popup page
November 19, 2012 8:22 PM
Answer

Anil Sunkari

Rank: Expert

Posts: 427

Join Date: August 11, 2009

Recent Posts

Please refer the below url.This might be helpful.

http://www.liferay.com/community/wiki/-/wiki/Main/Using+Pop-up+in+Liferay

Regards,
Anil Sunkari
surjeet singh
RE: Call action from popup page
November 19, 2012 10:15 PM
Answer

surjeet singh

Rank: New Member

Posts: 14

Join Date: October 8, 2012

Recent Posts

Dear Anil Sunkari

I have already seen that link and study that. But you didn't get my problem.
My problem is that how can I call an action from that popup page?
I have implemented that popup window, I just want call an action which gives me some error.
Please give me some solution for that.

Participate in the State of Liferay Community 2017. Help the community and even win some prizes!