遇到如下的问题,
切换view的时候,老是提示“请先关闭当前表单”,
代码如下
//判断当前view是否有打开
if (currentRecId != recId)
{
//获取已打开的view
IDynamicFormView view = this.View.GetView(this.View.PageId + "_" + currentRecId);
if (view != null)
{
//关闭已打开view
view.Close();
this.View.SendDynamicFormAction(view);
}
//打开新的view
BillShowParameter showParam = new BillShowParameter();
showParam.FormId = formId;
showParam.OpenStyle.ShowType = Kingdee.BOS.Core.DynamicForm.ShowType.InContainer;
showParam.OpenStyle.TagetKey = "FShowFormPanel";
showParam.PageId = this.View.PageId + "_" + strId;
//showParam.Caption = strPlanDate;
showParam.Status = showStatus;
//showParam.Height = 450;
//showParam.Width = 720;
//showParam.CustomComplexParams.Add("FUPATIENT", CurrentFuPatientInfo);
showParam.CustomComplexParams.Add("FUREC", rec);
if (showStatus != OperationStatus.ADDNEW)
showParam.PKey = strPKey;
//记住当前view
currentRecId = recId;
this.View.ShowForm(showParam);
}
代码中如何才能彻底关闭到过往打开的view呢?
推荐阅读