移动表单,子表单关闭返回数据后不刷新父表单单据体
金蝶云社区-zhouyi5362
zhouyi5362
0人赞赏了该文章 986次浏览 未经作者许可,禁止转载编辑于2016年03月22日 17:06:21

写了一个测试方法,分别放在AfterBindData方法和获取子表单返回的委托里,结果关闭子表单后,父表单的单据体没有刷新,而AfterBindData事件正常。[code] public class MobileEFSTFHeadBillPlugIn : AbstractMobilePlugin
{

public override void OnInitialize(InitializeEventArgs e)
{
base.OnInitialize(e);
}

public override void AfterBindData(EventArgs e)
{
base.AfterBindData(e);
testBindListView();
}

public override void ButtonClick(ButtonClickEventArgs e)
{
if (e.Key.ToUpper() == ("F_ZHY_AddPaths").ToUpper())
{
MobileShowParameter parameter = new MobileShowParameter();
parameter.FormId = "ZHY_MOBILE_CCSQD_E";
parameter.ParentPageId = this.View.PageId;
Action frt = new Action(getReturnData);
this.View.ShowForm(parameter, frt);
}
}

///


/// 获取子窗体的返回值
///

///
void getReturnData(FormResult frt)
{
testBindListView();
}

private void testBindListView()
{
this.View.Model.DeleteEntryData("FMobileListViewEntity");
this.Model.BeginIniti();
//创建数据行并赋值
int currentrowindex = this.Model.GetEntryRowCount("FMobileListViewEntity");
this.View.Model.CreateNewEntryRow("FMobileListViewEntity");
this.Model.SetValue("F_ZHY_StartDate", DateTime.Now, currentrowindex);
this.Model.SetValue("F_ZHY_EndDate", DateTime.Now.AddHours(5), currentrowindex);
this.Model.SetValue("F_ZHY_FromPlace", "A", currentrowindex);
this.Model.SetValue("F_ZHY_ToPlace", "B", currentrowindex);
this.Model.EndIniti();
IEntryState state = this.View.GetEntryState("FMobileListViewEntity");
state.CurrentPageIndex = 0;
this.View.UpdateView("FMobileListViewEntity");
this.View.GetControl("FMobileListViewEntity").setSelection(200);
}
}[/code]