UploadItem:文件上传成功后如何获取事件?
我是 SmartGWT 的新手。我正在使用 SmartGWT(LGPL) 2.2 和 FF 3.6。 我已经成功完成了 GWT-Ext 项目中的文件上传模块。因为我使用的是 FormPanel & FileUpload 控件。文件上传后,我处理了如下事件:
代码:
formPanel.addFormListener(new FormListenerAdapter(){
@Override
public void onActionComplete(Form form, int httpStatus,
String responseText) {
MessageBox.alert("Succesful");
}
@Override
public void onActionFailed(Form form, int httpStatus,
String responseText) {
MessageBox.alert("Failed");
}
});
我使用 Struts 向我的 Action Class & 发送请求。将其重定向回侦听器,如下所示:
代码:
<package name="default" extends="struts-default">
<action name="FileUploadAction" class="com.nextenders.server.actions.FileUploadAction" >
<result name="success" type="redirect">SUCCESS</result>
<result name="fail">FAIL</result>
<result name="none">NONE</result>
<result name="blank">BLANK</result>
<result name="size">SIZE</result>
</action>
</package>
我正在使用 SmartGWT 的 DynamicForm 和 UploadItem。 谁能告诉我SmartGWT的DynamicForm中是否有类似formPanel.addFormListener()
的功能?
I'm new to SmartGWT. I'm using SmartGWT(LGPL) 2.2 with FF 3.6.
I've done the file upload module in my GWT-Ext project successfully. In that I was using a FormPanel & a FileUpload control. After the file is uploaded I handled the event like this:
Code:
formPanel.addFormListener(new FormListenerAdapter(){
@Override
public void onActionComplete(Form form, int httpStatus,
String responseText) {
MessageBox.alert("Succesful");
}
@Override
public void onActionFailed(Form form, int httpStatus,
String responseText) {
MessageBox.alert("Failed");
}
});
I used Struts to send request to my Action Class & redirect it back to the listener like this:
Code:
<package name="default" extends="struts-default">
<action name="FileUploadAction" class="com.nextenders.server.actions.FileUploadAction" >
<result name="success" type="redirect">SUCCESS</result>
<result name="fail">FAIL</result>
<result name="none">NONE</result>
<result name="blank">BLANK</result>
<result name="size">SIZE</result>
</action>
</package>
I'm using DynamicForm and UploadItem of SmartGWT.
can anyone tell me if there is a similar functionality like formPanel.addFormListener()
in DynamicForm of SmartGWT?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
没有可用于此的内置回调。
您需要创建一些代码来实现回调功能。
你可以得到一些想法
http://forums.smartclient.com/showthread.php?t= 5477
There is no in built callback available for this.
You need to create some code to implement callback feature.
You can get some idea
http://forums.smartclient.com/showthread.php?t=5477