0
您好我在改變時間方面存在問題,但是知道點擊xhtml頁面內容的buttone沒有改變。如何通過點擊<p:commandButton>刷新<p:graphicImage>
<h:form id="f">
<h:panelGrid columns="2" cellpadding="2">
<p:commandButton value="Click " actionListener="# {graphicImageView.test()}" >
<p:ajax update="img" immediate="true"/>
</p:commandButton>
<p:graphicImage id="img" value="#{graphicImageView.chart}" cache="true" rendered="true" />
</h:panelGrid>
</h:form>
public PieDataset test() throws ParseException, IOException {
DefaultPieDataset dataset = new DefaultPieDataset();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
Date datee1;
Date datee2;
String date1 = "2014-06-01";
String date2 = "2014-10-05";
datee1 = simpleDateFormat.parse(date1);
datee2 = simpleDateFormat.parse(date2);
dataset.setValue("corectif", ifl.countexterne(true, datee1, datee2));
dataset.setValue("Preventif", ifl.countexterne(false, datee1, datee2));
return dataset;
}
我測試過但不是結果pleeez幫助我.. – 2014-11-03 14:57:35