public override void CustomEvents(CustomEventsArgs e)
        {
            if (e.Key.EqualsIgnoreCase("F_JD_FileUpdate"))
            {
                this.View.GetControl("F_JD_FileUpdate").SetCustomPropertyValue("NeedCallback", true);
                this.View.GetControl("F_JD_FileUpdate").SetCustomPropertyValue("IsRequesting", false);
                if (e.EventName.EqualsIgnoreCase("FileChanged"))
                {
                    FileNameList.Clear();
                    _FileList.Clear();

                    JSONObject uploadInfo = KDObjectConverter.DeserializeObject <JSONObject>(e.EventArgs);
                    if (uploadInfo != null)
                    {
                        JSONArray json = new JSONArray(uploadInfo["NewValue"].ToString());
                        if (json.Count < 1)
                        {
                            this.View.GetControl("F_JD_BTNOK").Enabled = false;
                        }
                        else
                        {
                            for (int i = 0; i < json.Count; i++)
                            {
                                string fileName  = (json[i] as Dictionary <string, object>)["ServerFileName"].ToString();
                                string _FileName = (json[i] as Dictionary <string, object>)["FileName"].ToString();
                                FileNameList.Add(this.GetFullFileName(fileName));
                                _FileList.Add(_FileName);
                            }

                            this.View.GetControl("F_JD_BTNOK").Enabled = true;
                        }
                    }
                }
            }
        }
Пример #2
0
 /// <summary>
 /// 自定义事件,获取文件上传控件中文件的名称,以便提交后进行文件上传
 /// </summary>
 /// <param name="e"></param>
 public override void CustomEvents(CustomEventsArgs e)
 {
     if (this.Context.ClientType.ToString() != "Mobile")
     {
         if (e.Key.ToUpper() == "FFileUpdate".ToUpper())
         {
             //触发事件是上传文件有变化
             if (e.EventName.ToUpper() == "FILECHANGED")
             {
                 jSONObject = KDObjectConverter.DeserializeObject <JSONObject>(e.EventArgs);
             }
         }
         base.CustomEvents(e);
     }
 }