文本字段点击弹出动态表单,选择数据后回填至文本内
首先文本字段若要实现点击弹框需要先将控件的编辑风格设置为“标准”如下图
代码层面跟传统的调用动态表单方法一样
public void ToShowREQORDER()
{
ListShowParameter listShowParameter = new ListShowParameter();
listShowParameter.FormId = "SUB_SUBREQORDER";
//是否可多选
listShowParameter.MultiSelect = true;
listShowParameter.IsLookUp = true;
listShowParameter.PageId = Guid.NewGuid().ToString();
listShowParameter.ParentPageId = base.View.PageId;
listShowParameter.OpenStyle.ShowType = Kingdee.BOS.Core.DynamicForm.ShowType.Modal;
//过滤条件
listShowParameter.ListFilterParameter.Filter = string.Format("FDocumentStatus='C' AND FStatus!=5 AND FStatus!=6 AND FStatus!=7 AND FBillType!='603ee704a1cfc2'");
//方法2,传result返回
this.View.ShowForm(listShowParameter, delegate (FormResult result)
{
//读取返回值
object returnData = result.ReturnData;
//判断是否是RowCollection
if (returnData is ListSelectedRowCollection)
{
//如果是,执行,转换格式
ListSelectedRowCollection listSelectedRowCollection = returnData as ListSelectedRowCollection;
//如果不是空值,说明有返回值
if (listSelectedRowCollection != null)
{
string BILLNO = "";
string BILLNO1 = "";
for (int i = 0; i < listSelectedRowCollection.Count; i++)
{
//获取值.i代表第几行值
DynamicObjectDataRow datarow = (DynamicObjectDataRow)listSelectedRowCollection[i].DataRow;
if (i != 0)
{
BILLNO = BILLNO + ";" + datarow.DynamicObject["FBillNo"].ToString();
}
else
{
BILLNO = datarow.DynamicObject["FBillNo"].ToString();
}
}
Array stringArray = BILLNO.Split(';');
List<string> listString = new List<string>();
foreach (string eachString in stringArray)
{
if (!listString.Contains(eachString))
listString.Add(eachString);
}
foreach (string string1 in listString)
{
BILLNO1 = BILLNO1 + string1 + ";";
}
this.View.Model.SetValue("F_KFS_REMARKS", BILLNO1);
}
}
});
}
若有抄袭请及时联系本人进行删除
文本字段点击弹出动态表单,选择数据后回填至文本内
本文2024-09-16 17:21:44发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-15217.html