【发布时间】:2013-08-02 06:47:06
【问题描述】:
我正在使用 jsf、primefaces 和 jpa 开发一个应用程序。我面临的一个问题是我在对话框窗口中使用单选按钮和数据表。我的条件是选择单选按钮,它从操作中调用一个方法并检索数据列表,但我需要加载数据表中的值。但它没有加载数据表中的值
这是我的 xhtml 代码
<p:dialog header="RxnNo" widgetVar="dlg3" height="500" width="800">
<p:selectOneRadio id="series" value="#{curation.series}">
<f:selectItem itemLabel="SGML" itemValue="1" />
<f:selectItem itemLabel="9000" itemValue="2" />
<f:selectItem itemLabel="8500" itemValue="3" />
<p:ajax listener="#{curation.getSeries9000}" update="seriesDataTable" />
</p:selectOneRadio>
<p:dataTable id="seriesDataTable" var="series" value="#{homePage.reactionsList}" widgetVar="seriesTable" scrollRows="20" scrollable="true" rowIndexVar="rowIndex">
<p:column headerText="Id" filterBy="#{rowIndex+1}">
<h:outputText value="#{rowIndex+1}" />
</p:column>
</p:dataTable>
</p:dialog>
这是我的java代码
public void getSeries9000() throws Exception {
try {
if (series.equals("2")) {
series9000List = cationController.getAllSeries9000();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
谁能帮我解决这个问题。
【问题讨论】:
-
你如何打开对话框[dialogWidget.show()]。如果您使用的是 commandButton,请同时发布该代码。
标签: jsf primefaces dialog datatable