ADF JDeveloper 11g中的“inputFile”组件问题('inputFile' component issue in ADF JDeveloper 11g)

编程入门 行业动态 更新时间:2024-10-27 02:23:38
ADF JDeveloper 11g中的“inputFile”组件问题('inputFile' component issue in ADF JDeveloper 11g)

我在jsff页面中使用inputFile组件,用户可以在其中浏览文件系统,选择文件以将其存储在数据库中。

我为这个组件创建了一个ValueChangeListener方法,它处理这个文件并将其存储在db中。

问题是,一旦用户选择文件,它在页面中显示一秒钟,它就会消失,并且不会调用ValueChangeListener 。

注意:此组件的AutoSubmit属性设置为true 。 我正在使用JDeveloper 11g和ADF。

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.

I created a ValueChangeListener method for this component which deal with this file and store it in 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.

Note: the AutoSubmit property is set to true for this component. I am using JDeveloper 11g with ADF.

最满意答案

如果autsubmit设置为true,那么只要用户选择了您的文件,就会立即提交。 您可能希望将其关闭并在用户单击提交按钮时提交

如果在提交后未保留value属性(例如,如果指向backingBean范围中的bean),则提交完成后您将没有任何值。 例如,您可以将其保存在viewscope变量中。

以下是应该如何完成文件上传的很好的示例 。

不要忘记设置<af:form usesUpload="true"> 。

还有一个与Demo App的链接 。

If autsubmit set to true, then your file is being submit as soon as user chooses it. 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. You can save it in viewscope variable for example.

Here is nice sample of how file uploads should be done.

Don't forget to set <af:form usesUpload="true">.

And one more link with Demo App included.

更多推荐

本文发布于:2023-04-27 20:52:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1329044.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:组件   ADF   JDeveloper   issue   component

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!