ICEFaces 1.8渲染不同的portlet(liferay)

时间:2013-03-21 17:08:06

标签: java liferay-6 icefaces-1.8

我有两个Portlet: 第一个包含:数据表A 第二个:数据表B 。 这两个portlet显示在同一页面中。 我点击数据表B 中的命令按钮后,我想刷新数据表A

命令按钮调用的方法包含以下代码:

OnDemandRenderer onDemandRenderer = getRenderManager().getOnDemandRenderer("RENDER_GROUP");
onDemandRenderer.requestRender();

但它不起作用。 有人可以帮我吗?一些提示? 提前感谢您的帮助!!

1 个答案:

答案 0 :(得分:0)

我使用静态变量解决了这个问题。 Datatable A使用在托管bean中以这种方式填充的dataModel对象:

dataModel=new ListDataModel(globalDD.getDetailsList());

托管bean中的globalDD:

private GlobalDocumentDetails globalDD;
public GlobalDocumentDetails getGlobalDD() {
  return SessionBeanUtility.getGlobalDD();
}
public void setGlobalDD(GlobalDocumentDetails globalDD) {
  this.globalDD = globalDD;
}

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);
}

数据表B包含购物车的项目,购物车是静态对象。 我使用我在两个数据表的actionListeners方法中的问题中编写的代码来刷新它们。