af:inputFile is not calling valueChangeListener method

心不动则不痛 提交于 2020-01-16 14:24:13

问题


Summarize the problem

I'm trying to upload an image to a blob in the database and have been following various blogs online to do so.

Provide background including what you've already tried

I've tried enclosing the input file on a form but I get the warning:- "Only one af:form is supported per page. This warning later escalates to a server exception error and I can't enter said page.

Show some code

 <af:panelFormLayout id="pfl1">
      <f:facet name="footer"/>
      <af:form id="f1" usesUpload="true">
        <af:inputFile label="Label 1" id="if1"  value="#NewUploadImageBean.file}"
                      valueChangeListener="#{NewUploadImageBean.upLoadValueChangeListener}"/>
      </af:form>
    </af:panelFormLayout>

I only have this one form in the entire page.

Describe expected and actual results including any error messages

Would like to the valueChangeListner to call my method. Currently I get the ADF_FACES-60097 error which then translates to : java.lang.IllegalStateException: ADF_FACES-30124:Multiple forms detected on viewId: /test_pages/employement.jsf. Rich client currently has some limitations in dealing with multiple forms.


回答1:


How to fix ADF_FACES-30124:Multiple forms detected on viewId ?

To do so remove all the af:forms inside your jsf view expecially the one containing your inputFile and add only one af:form useupload="true" at the highest view tag level :

<af:document > 
 <af:form usesUpload="true" id="f1">
... ALL YOUR VIEW TAGS ...
</af:form>
</af:document>


来源:https://stackoverflow.com/questions/57761903/afinputfile-is-not-calling-valuechangelistener-method

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!