我正在编写一个 PrimeFaces 应用程序。我的 XHTML 中有以下代码:
<p:selectOneMenu value="#{lottoCheckerBean.selectedPowerBallDrawingDate}">
<f:selectItems value="#{lottoCheckerBean.powerBallDrawingDates}" />
</p:selectOneMenu>
我期待在LottoCheckerBean
选择一个值时在我的值中执行以下代码:
public void setSelectedPowerBallDrawingDate(String selectedPowerBallDrawingDate) {
//get drawing
PowerBallDrawing currentDrawing = null;
for (int d = 0; d < powerBallDrawings.size(); d++) {
if (powerBallDrawings.get(d).getDrawingDate().equals(selectedPowerBallDrawingDate)) {
currentDrawing = powerBallDrawings.get(d);
break;
}
}
if (currentDrawing == null) {
try {
//create new drawing;
currentDrawing = new PowerBallDrawing(selectedPowerBallDrawingDate);
powerBallDrawings.add(currentDrawing);
Arrays.sort(powerBallDrawings.toArray());
} catch (Exception ex) {
//will not happen so ignore
}
}
this.selectedPowerBallDrawingDate = selectedPowerBallDrawingDate;
}
但是,如果我在上述方法的开头设置了断点,则没有到达断点。
我错过了什么?