HTML客户端-按下保存按钮时,加载新的添加/编辑屏幕 [英] HTML Client - Load new add/edit screen when save button pressed

查看:87
本文介绍了HTML客户端-按下保存按钮时,加载新的添加/编辑屏幕的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的客户正在执行一项重复性任务,他们希望其中的一些任务根据之前的输入对他们有所自动化.

My client is doing a repetitive task an they'd like some of it somewhat automated for them based on previous inputs.

我们有一个屏幕,允许他们在库存盘点中输入库存盘点项目.库存计数项目添加/编辑屏幕具有组和类别下拉菜单,允许他们过滤产品下拉列表中显示的产品.当保存按钮 在添加/编辑弹出窗口上按,我想记住这些组和类别选择,并且立即有一个新的添加/编辑屏幕弹出窗口,而不是返回列表.

We have a screen that allows them to enter a stock count item into a stock count. The stock count item add/edit screen has group and category drop downs that allows them to filter the products that are displayed in the product drop down. When the save button is pressed on the add/edit popup I'd like these group and category selections to be remembered and a new add/edit screen popup straight away rather than going back to the list.

这是我到目前为止所拥有的:

This is what I have so far:

myapp.AddEditStockCountItem.beforeApplyChanges = function (screen) {
    if (screen.StockCountItem.details.entityState == msls.EntityState.added) {
        myapp.showAddEditStockCountItem(null, {
            beforeShown: function (addNewScreen) {
                addNewScreen.SearchProductGroup = screen.SearchProductGroup;
            }
        });
    };
};

当我收到错误消息时此方法不起作用:"

This doesn't work as I get an error: "Cannot perform this action while a navigation is in progress."

I understand the cause of the error but don't really know where to go from here. If I have to wait until this window has closed before automatically opening a new one where will I get the entityState from and the screen's product group or category? The entityState is important as I don't want this new windows to open if we're only editing a record. Also, the product group and category are not properties of the stock count item entity. They're purely used to filter the products.

推荐答案

The beauty of beforeShown and afterClosed is that before you open any screen you can determine what will happen after the screen is closed. So the screen that opens this screen that you are having an issue with should have a afterClosed method that will run after the screen is closed. In it you can determine what happened and take the appropriate action.


这篇关于HTML客户端-按下保存按钮时,加载新的添加/编辑屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆