p:dataTable
に問題があり、1行選択から列を除外しています。Primefaces:p:dataTableの行選択から列を除外する
私は自分のdataTableに4列あります。 fileId、fileName、uploadDateを表示するには、最初の3つが必要です。第4列には、ファイル処理の動作を開始する各行のコマンドボタンがあります。 また、ファイルの詳細ページに移動する行選択(イベントの場合はajaxアクション)もあります。 今、(ボタンを含む)行のどこかをクリックすると、詳細ページに移動します。
私の現在のコードがあります:
<h:form>
<p:dataTable id="billingFiles" value="#{billingFiles}"
var="billingFile"
rowKey="#{billingFile.billingFile.idBillingFile}"
filteredValue="#{billingService.filteredBillingFileDataModels}"
selectionMode="single" paginator="true" rows="10">
<p:ajax event="rowSelect" listener="#{billingService.selectBillingFileRow}" />
<p:column sortBy="#{billingFile.id}"
filterBy="#{billingFile.id}" id="idFile"
headerText="#{msg['billing.file.id']}"
filterMatchMode="contains">
<h:outputText value="#{billingFile.id}" />
</p:column>
<p:column sortBy="#{billingFile.uploadDate}"
filterBy="#{billingFile.uploadDate}" id="uploadDate"
headerText="#{msg['billing.file.upload_date']}"
filterMatchMode="contains">
<h:outputText value="#{billingFile.uploadDate}" />
</p:column>
<p:column sortBy="#{billingFile.fileName}"
filterBy="#{billingFile.fileName}" id="fileName"
headerText="#{msg['billing.file.file_name']}"
filterMatchMode="contains">
<h:outputText value="#{billingFile.fileName}" />
</p:column>
<p:column id="loadBillingFile">
<p:commandButton id="loadBillingFileButton"
rendered="#{billingFile.fileStatus.equals('UPLOADED')}"
value="#{msg['billing.load_billing_file']}"
action="#{billingService.loadBillingFile(billingFile.billingFile)}"
update=":form" />
</p:column>
</p:dataTable>
</h:form>
はまた、詳細ページをファイルにナビゲートする方法があります:
public void selectBillingFileRow(SelectEvent event) {
BillingFileDataModel billingFileDataModel = (BillingFileDataModel) event.getObject();
if (billingFileDataModel != null) {
selectedBillingFile = billingFileDAO.findBillingFileById(billingFileDataModel.getBillingFile().getIdBillingFile());
FacesContext.getCurrentInstance().getExternalContext()
.getRequestMap().put(JsfView.EVENT_KEY, "viewBillingFile");
}
}
は、行選択からボタンの列を除外する方法はありますか?他のページに移動せずに、ファイルの処理を開始する必要があります。
処理するファイルは何ですか、それはdbですか? –
Springバッチでtxtファイルの処理を開始します。 – Rozart
行をクリックするたびに、次のリスナを実行するdataTableにrowSelect Primefaces Ajaxイベントがあります。 ''#{billingService.selectBillingFileRow} "'このメソッドのリダイレクトまたはフォワードを確認するコードを探しますページ。 –