2015-11-02 93 views
0

您好我正在使用PrimeFaces 5.2,并使用图表作为数据表。在页面加载时,图表为空,仅在刷新时显示图表。在搜索时,图表不会在刷新时再次更改,或者在新搜索中显示之前搜索的图表。对不起我的英语不好。 我的JSF页面:DonutChart没有更新

<h:form id="statisfationFilterForm"> 
    <h:outputText value="#{msg['media.reports.filter.date.from']}" /> 

    <p:calendar id="dateFrom" 
       value="#{statisfationController.model.currentSatisfation.filter.startDate}" 
       pattern="dd/MM/yyyy"/> 
    . 
    . 
    . 

    <p:commandButton value="#{msg['button.search']}" 
        ajax="true" 
        action="#{statisfationController.model.getLazyModel()}" 
        update=":statisfationTableForm"/> 

    <p:commandButton value="#{msg['button.clear']}" 
        ajax="true" 
        action="#{statisfationController.clear()}" 
        update=":statisfationTableForm :statisfationFilterForm"/> 
</h:form> 

<h:form id="statisfationTableForm"> 
    <p:chart id="chart" type="donut" 
      model="#{statisfationController.model.donutModel}" 
      style="width:400px;height:300px" /> 

    <p:dataTable value="#{statisfationController.model.lazyModel}" 
       . 
       . 
       . 

和我satisfationmodel:

@PostConstruct 
public void init() { 
    LOGGER.debug("Initialize 'satisfationModel' bean."); 
    try { 
     statisticsService.setClazz(E_CMS_STATISTICS_CROSSELER.class, Integer.class); 
     userInteractionService.setClazz(E_CMS_USER_INTERACTION.class, Integer.class); 
     satisfationDataModel = new DataGridModel<E_CMS_USER_INTERACTION>(); 
     satisfationDataModel.setGridRendered(false); 
     currentSatisfation = new E_CMS_USER_INTERACTION(); 
     currentSatisfation.setFilter(new UserSatisfactionReportFilter()); 
     currentSatisfation.getFilter().setBenutzers(statisticsService.getAllBenutzers()); 
     donutModel = new DonutChartModel(); 
    } catch (Exception e) { 
     LOGGER.error("Exceptions while initializing 'customerstatisfation' bean!", e); 
    } 
} 

public LazyDataModel<E_CMS_USER_INTERACTION> getLazyModel(){ 
. 
. 
. 
@Override 
public List<E_CMS_USER_INTERACTION> load(int first, int pageSize, String sortField, SortOrder sortOrder, Map<String, Object> filters) { 
. 
. 
. 
List<E_CMS_USER_INTERACTION> list = response.getList(); 
         donutModel = new DonutChartModel(); 
         createDonutModels(list); 
         return list; 
. 
. 
. 
} 

donutModel包含良好的价值观,但网页上显示之前的图。

任何想法我怎么能解决这个问题?

+0

是的,我试过了,但它是同样的事情。我也尝试从表格中移出,并再次做同样的事情。 – FAndrew

+0

如果它不填充数据表加载函数然后工作正常,但我需要填充数据表值 – FAndrew

+0

感谢您试图帮助我,我发现我的回答:) – FAndrew

回答