Primefaces fileUpload valueChangeListener不触发方法

时间:2014-01-17 08:56:41

标签: java jsf file-upload primefaces valuechangelistener

我在这里缺少什么? 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();
}

0 个答案:

没有答案