简体   繁体   English

ADF JDeveloper 11g中的“ inputFile”组件问题

[英]'inputFile' component issue in ADF JDeveloper 11g

I am using an inputFile component in jsff page where the user can browse the file system, select the file in order to store it in the database. 我在jsff页面中使用了inputFile组件,用户可以在其中浏览文件系统,选择文件以将其存储在数据库中。

I created a ValueChangeListener method for this component which deal with this file and store it in db. 我为此组件创建了一个ValueChangeListener方法,该方法处理该文件并将其存储在db中。

The problem is, once the user select the file it appears for a second in the page and it disappears and the ValueChangeListener is not called. 问题是,一旦用户选择了文件,该文件就会在页面中显示一秒钟,然后消失,并且不会调用ValueChangeListener

Note: the AutoSubmit property is set to true for this component. 注意:此组件的AutoSubmit属性设置为true I am using JDeveloper 11g with ADF. 我正在将JDeveloper 11g与ADF一起使用。

If autsubmit set to true, then your file is being submit as soon as user chooses it. 如果autsubmit设置为true,则用户选择文件后即会提交您的文件。 You may want to turn it off and submit it when user clicks the submit button. 您可能需要关闭它并在用户单击“ 提交”按钮时提交

If your value property ain't preserved after submit (for example if you point to bean in backingBean scope), you will have no value as soon as submit completes. 如果提交后未保留您的value属性(例如,如果您指向backingBean范围内的bean),则提交完成后将没有任何价值。 You can save it in viewscope variable for example. 您可以将其保存在例如viewscope变量中。

Here is nice sample of how file uploads should be done. 这是一个很好的文件上传方式示例

Don't forget to set <af:form usesUpload="true"> . 不要忘记设置<af:form usesUpload="true">

And one more link with Demo App included . 并包含一个与演示应用程序的链接

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM