gpt4 book ai didi

java - com.google.gwt.user.client.ui.FileUpload 如何设置文本?

转载 作者:行者123 更新时间:2023-12-02 06:44:52 27 4
gpt4 key购买 nike

我想使用此类 com.google.gwt.user.client.ui.FileUpload 进行文件上传,但我遇到了下一个问题。我找不到如何以编程方式设置文本。我的意思是在 TextBox 中我有 setText 方法来做到这一点。我怎样才能在FileUpload中做到这一点?

最佳答案

无法设置,因为GWT文件上传是用html input type="file"换行的。所以无法设置set filename or path (text) to那个。

当然,这应该仅由用户选择。

你只能从中获取。

如果您正在讨论为控件设置一些名称,例如“选择文件”,请使用标签并添加。

http://en.wikipedia.org/wiki/JavaScript#Security

JavaScript and the DOM provide the potential for malicious authors to deliver scripts to run on a client computer via the web. Browser authors contain this risk using two restrictions. First, scripts run in a sandbox in which they can only perform web-related actions, not general-purpose programming tasks like creating files. Second, scripts are constrained by the same origin policy: scripts from one web site do not have access to information such as usernames, passwords, or cookies sent to another site

关于java - com.google.gwt.user.client.ui.FileUpload 如何设置文本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18761427/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com