zoukankan      html  css  js  c++  java
  • [K/3Cloud] 如何从被调用的动态表单界面返回数据

    在需要返回数据的地方调用表单返回方法完成数据返回

    this.View.ReturnToParentWindow(retData);

    在调用界面的回调函数中取出返回结果的ReturnData即可使用。


    例如:

    在动态表单的按钮事件中调用此方法

     //确定按钮事件
            private void SaveClaimerAndDate()
            {
                string errMsg = Check();
                if (!string.IsNullOrWhiteSpace(errMsg))
                {
                    this.View.ShowErrMessage(errMsg);
                }
                else
                {
                    this.View.ReturnToParentWindow(SetDateAndClaimer());
                    this.View.Close();
                }
            }


    在调用界面的回调函数中取数:

    private void GetSale()
            {
                ListShowParameter listpara = new ListShowParameter();
                listpara.FormId = Topview.FT.Common.Core.FTConst.SALECONTRACT_FORMID;//外销合同
                listpara.ParentPageId = this.View.PageId;
                listpara.MultiSelect = false;
                listpara.IsShowApproved = true;
                listpara.OpenStyle.CacheId = listpara.PageId;
                listpara.IsLookUp = true;   //F7
                this.View.ShowForm(listpara, new Action<FormResult>((result) =>
                {
                    object data = result.ReturnData;
                    if (data is ListSelectedRowCollection)
                    {
                        ListSelectedRowCollection listData = data as ListSelectedRowCollection;
                        if (listData != null && listData.Count > 0)
                        {
                            DynamicObject dy = CommonCoreUtils.GetDateFromFID(this.Context, Topview.FT.Common.Core.FTConst.RECEIVEREGISTRATION, "FID", listData[0].PrimaryKeyValue, "FBILLNO");
                            this.Model.SetValue("FSaleContractId", dy["FBILLNO"]);
                        }
                    }
                }
                ));
            }


  • 相关阅读:
    HTTP状态码及其含义
    c和python解决各种字符串反转问题的不同思路
    Python找出一串字符中出现最多的字符
    3个基本算法的实现技巧
    一种字符串搜索方法
    数据库开发经典总结
    apt、dpkg参数整理
    Python集合(set)类型的操作
    Python和Decorator(装饰器)模式
    Git使用基础
  • 原文地址:https://www.cnblogs.com/james1207/p/3318099.html
Copyright © 2011-2022 走看看