我在这里缺少什么? valueChangeListener不会触发方法。
屏幕代码:
<h:form>
<p:fileUpload id="filePath"
writeToMB="relationCompanyFileReferenceMB"
writePathTo="setFilePath"
writeSubjectTo="setFileName"
fileUploadListener="#{fileUploadController.handleDocumentUpload}"
valueChangeListener="#{companyController.onSaveRelationCompanyFileReference}"
mode="advanced"
auto="true"
onchange="submit();"
process="@this"
update=":editorCompanyFinancials:pnlFilePath"
sizeLimit="50000000"
allowTypes="/(\.|\/)(pdf|docx?|xlsx?)$/" locale="#{sessionBean.language}" label="Upload"
value="#{relationCompanyFileReferenceMB.model.filePath}"/>
</h:form>
Java代码:
public void onSaveRelationCompanyFileReference(ValueChangeEvent e){
relationCompanyFileReferenceMB.getModel().setLookupCompany(lookupCompany);
relationCompanyFileReferenceMB.getModel().setYear(year);
relationCompanyFileReferenceMB.save();
}