[英]How to reload the whole page in Liferay
I am using Liferay 5.2.3. 我正在使用Liferay 5.2.3。
In my view.jsp
file I have a hidden form that after it is populated, it is sent to the processAction(request, response)
method of my portlet like this: 在我的
view.jsp
文件中,我有一个隐藏的表单,在填充之后,它被发送到我的portlet的processAction(request, response)
方法,如下所示:
document.getElementById('email').value = member.emailAddress;
document.getElementById('myForm').submit();
After all the java code in my extended GenericPortlet
class from processAction(request, response)
has been executed, I want my entire web page to be refreshed, not only the portlet. 在执行了
processAction(request, response)
扩展GenericPortlet
类中的所有java代码之后,我希望刷新整个网页,而不仅仅是portlet。
I think there are two ways to do that: 我认为有两种方法可以做到这一点:
1: inside processAction
1:内部
processAction
2: using some kind of ajax code and call document.location.reload()
after document.getElementById('myForm').submit();
2:使用某种ajax代码并在
document.getElementById('myForm').submit();
之后调用document.location.reload()
document.getElementById('myForm').submit();
Could you share some sample code for any of these options (or others)? 你能分享一些这些选项(或其他)的示例代码吗?
You're describing the default behaviour in portal world: After triggering an Action, the whole page will be reloaded. 您正在描述门户网站中的默认行为:触发Action后,将重新加载整个页面。 Whatever you did in order to work around this default: Undo it and you're done.
无论你为了解决这个默认设置而做了什么:撤消它并且你已经完成了。
Look at (almost) any of the Liferay demo portlets, eg on https://github.com/liferay/liferay-plugins/tree/master/portlets 查看(几乎)任何Liferay演示portlet,例如https://github.com/liferay/liferay-plugins/tree/master/portlets
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.