创建一个弹出窗口(而不是表单)来上传ADF中的文件



我想创建一个具有af:inputfile组件的弹出窗口/对话框,并使用托管bean将其保存在服务器路径中。当我使用弹出窗口时,点击上传按钮后文件变空

我使用表单完成了这项工作,但问题是页面已经使用了另一个表单,因此出现了多个表单错误。

网页:

<af:popup id="p1" contentDelivery="lazyUncached" >
<af:dialog id="d3" type="none" title=""
closeIconVisible="false">
<f:facet name="buttonBar">
<af:group id="g3">
<af:commandButton text="Save" id="cb2" 
partialSubmit="true"
actionListener="#{myMB.onSaveAl}"/>
</af:group>
</f:facet>
<af:panelFormLayout id="pfl2">
<af:inputFile  value="" id="if1" autoSubmit="true" required="true"
valueChangeListener="#{myMB.browseAndUpload}"  showRequired="true"/>
</af:panelFormLayout>
</af:dialog>

托管bean:

public void browseAndUpload(ValueChangeEvent event) 
{
// The event give access to an Uploade dFile which contains data about the file and its content
UploadedFile file = (UploadedFile)event.getNewValue();
}

相关内容

最新更新