简体   繁体   English

rich:fileUpload设置文件的初始列表

[英]rich:fileUpload set initial list of files

I need to initialize an rich:fileUpload component with a default file I looked at the component's documentation and did not find anything related, in my case i need to show the file only on client-side operation (i already got the file on server-side) Looking at the component's library i notice that when we click on "add file", the component uses the following syntax to create file on list: 我需要使用默认文件初始化rich:fileUpload组件,我查看了该组件的文档,但没有找到任何相关的内容,就我而言,我只需要在客户端操作上显示该文件(我已经在服务器上获取了该文件,在查看组件库时,我注意到当我们单击“添加文件”时,组件使用以下语法在列表上创建文件:

$(<component_name>).component.add(this)

But i've tried create a class of object with the atributes "fileName", "state" etc (just like the documentation says) and insert when click on js script, but still didn't work. 但是我尝试用属性“ fileName”,“ state”等创建类对象(就像文档中所说的那样),并在单击js脚本时插入,但是仍然没有用。 Anyone has any ideia of how to solve my problem? 任何人都对如何解决我的问题有任何想法?

Thank's. 谢谢。

PS: I'm using richfaces 3.3. PS:我正在使用richfaces 3.3。

To everyone interested, I could not find a way to insert default file on the component, but i found a workaround for this problem. 对于每个感兴趣的人,我都找不到在组件上插入默认文件的方法,但是我找到了解决此问题的方法。 I just remove the native list with "listHeight=0" and develop my own list using datatables. 我只是使用“ listHeight = 0”删除本机列表,并使用数据表开发自己的列表。

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

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