一、继承表单事件
二、重写CustomEvents()方法
public override void CustomEvents(CustomEventsArgs e)
{
if (e.Key.EqualsIgnoreCase("FBatchUploadFile"))
{
this.View.GetControl("FBatchUploadFile").SetCustomPropertyValue("NeedCallback", true);
this.View.GetControl("FBatchUploadFile").SetCustomPropertyValue("IsRequesting", false);
if (e.EventName.EqualsIgnoreCase("FileChanged"))
{ // 文件上传完毕
// 取文件上传参数,文件名
JSONObject uploadInfo = KDObjectConverter.DeserializeObject<JSONObject>(e.EventArgs);
if (uploadInfo != null)
{
JSONArray json = new JSONArray(uploadInfo["NewValue"].ToString());
if (json.Count > 0)
{
FileNameList.Clear();
foreach (object item in json) {
Hashtable FileNameTb = new Hashtable();
//FileNameTb.Clear();
// 取上传的文件名
string ServerFileName = (item as Dictionary<string, object>)["ServerFileName"].ToString();
string FileName = (item as Dictionary<string, object>)["FileName"].ToString();
this._fullFileName = this.GetFullFileName(ServerFileName);
FileNameTb.Add("FileName", FileName);
FileNameTb.Add("FullFileName", this._fullFileName);
FileNameList.Add(FileNameTb);
}
// 解锁确定按钮
this.View.GetControl("FButtonConfirm").Enabled = true;
}
else
{
// 锁定确定按钮
this.View.GetControl("FButtonConfirm").Enabled = false;
}
}
}
}
}
推荐阅读