p:dataTable
에 문제가있어 단일 행 선택에서 열을 제외했습니다.Primefaces : p : dataTable의 행 선택에서 열 제외
내 dataTable에 4 개의 열이 있습니다. fileId, fileName 및 uploadDate를 표시하려면 처음 3자가 필요합니다. 네 번째 열에는 파일 처리 작업을 시작하는 각 행에 대한 명령 단추가 있습니다. 또한 파일 세부 정보 페이지로 이동하는 행 선택 (이벤트의 경우 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");
}
}
은? 나를 다른 페이지로 이동하지 않고 파일 처리 만 시작하면됩니다.
처리중인 파일은 무엇입니까? –
스프링 배치로 txt 파일 처리를 시작합니다. – Rozart
행을 클릭 할 때마다 다음 수신기를 실행하는 dataTable에 rowSelect Primefaces Ajax 이벤트가 있습니다.''# {billingService.selectBillingFileRow} "'이 메소드가 코드를 리다이렉트 또는 전달하는지 확인합니다. 페이지. –