[英]ICEFaces 1.8 Rendering in different portlets (liferay)
I have two Portlets: the first contains: datatable A and the second: datatable B . 我有两个Portlet:第一个包含:数据表A ,第二个包含:数据表B。 The two portlets are shown in the same page.
这两个portlet显示在同一页面中。 I want to refresh the datatable A after I click on a command button in the datatable B .
单击数据表B中的命令按钮后,我想刷新数据表A。
The method called by the command button contains this code: 命令按钮调用的方法包含以下代码:
OnDemandRenderer onDemandRenderer = getRenderManager().getOnDemandRenderer("RENDER_GROUP");
onDemandRenderer.requestRender();
But it doesn't work. 但这是行不通的。 Can anyone help me please?
谁能帮我吗? Some hints?
一些提示? Thanks in advance for any help!!
在此先感谢您的帮助!
I resolved the problem using static variables. 我使用静态变量解决了问题。 Datatable A uses the dataModel object that is filled in this way in the managed bean:
数据表A使用以这种方式填充在托管Bean中的dataModel对象:
dataModel=new ListDataModel(globalDD.getDetailsList());
where globalDD in the managed bean: 托管bean中的globalDD所在的位置:
private GlobalDocumentDetails globalDD;
public GlobalDocumentDetails getGlobalDD() {
return SessionBeanUtility.getGlobalDD();
}
public void setGlobalDD(GlobalDocumentDetails globalDD) {
this.globalDD = globalDD;
}
And SessionBeanUtility.getGlobalDD() is 和SessionBeanUtility.getGlobalDD()是
public static GlobalDocumentDetails getGlobalDD(){
if (FacesUtil.getPortletSession().getAttribute(GLOBAL_DD_BEAN_KA, PortletSession.APPLICATION_SCOPE) == null)
{
new GlobalDocumentDetails();
FacesUtil.getPortletSession().setAttribute(GLOBAL_DD_BEAN_KA, new GlobalDocumentDetails(), PortletSession.APPLICATION_SCOPE);
}
return (GlobalDocumentDetails)FacesUtil.getPortletSession().getAttribute(GLOBAL_DD_BEAN_KA, PortletSession.APPLICATION_SCOPE);
}
The datatable B contains the items of a shopping cart and the cart is a static object. 数据表B包含购物车中的商品,并且该购物车是静态对象。 I use the code that i wrote in the question in the actionListeners methods of the two datatables to refresh both.
我使用我在两个数据表的actionListeners方法中的问题中编写的代码来刷新两者。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.