无法将焦点转移到“装运”屏幕上的“装运Nbr”字段 [英] Not able to shift focus to Shipment Nbr field on Shipments screen

查看:91
本文介绍了无法将焦点转移到“装运”屏幕上的“装运Nbr”字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用内置的Acumatica浏览器命令通过按功能键来插入新的货运记录。函数Key通过 px.searchFrame(window.top, main)['px_alls']。ds.executeCommand( Insert); 触发命令,它会触发插入命令,但不会将焦点转移到Shipment Nbr输入字段。此外,如果尝试使用 var field = px_alls [ edShipmentNbr]手动移动焦点; field.focus(); 也不起作用。我已经能够将焦点转移到其他字段,所以我知道代码是正确的,但是我无法弄清楚为什么不能将焦点转移到Shipment Nbr输入。关于还有什么可以做的任何想法?也不只是插入命令。调用取消命令(该命令应该转移焦点)也不起作用。

I'm using the built in Acumatica browser commands to insert a new shipment record by pressing a function key. The function Key triggers the command with px.searchFrame(window.top,"main")['px_alls'].ds.executeCommand("Insert"); For some reason, it triggers the insert command, but it doesn't shift the focus to the Shipment Nbr input field. Also, if you try to shift the focus manually using var field=px_alls["edShipmentNbr"]; field.focus(); that doesn't work either. I've been able to shift the focus to other fields, so I know the code is correct, but I can't figure out why the focus can't be shifted to the Shipment Nbr input. Any ideas on what else can be done? It's not just the Insert command either. Calling the Cancel command, which should shift the focus, doesn't work either.

奇怪的是,可以通过按Ctrl + Insert来调用Insert命令,并且

What's strange is that the Insert command can be called by pressing Ctrl+Insert, and it works perfectly.

我构建了一些代码,将焦点移至发货日期字段,然后向后切换5次,从而正确模拟了insert命令应该执行的操作,但是

I built some code that shifts the focus to the ship date field and then tabs backwards 5 times, which emulates correctly what the insert command should do, but it only works intermittently on the client's computer.

谢谢

推荐答案

Acumatica Framework通过 PXButtonAttribute 中定义的以下属性为键盘快捷键提供内置支持:

The Acumatica Framework provides built-in support for keyboard shortcuts via the following properties defined in PXButtonAttribute:


  • ShortcutShift = true / false :确定Shift键是否存在

  • ShortcutCtrl = true / false :确定控制键存在

  • ShortcutChar = 'x':确定快捷字符

  • ShortcutShift = true/false : Determines Shift key presence
  • ShortcutCtrl = true/false : Determines Control key presence
  • ShortcutChar = ‘x’ : Determines shortcut character

下面是插入新货件的示例当用户按下s F2 。由于下面的代码段利用了框架的功能,因此通过按 F2 ,用户可以从 SOShipmentEntry 执行 Insert 命令。 > BLC,而不是模拟JavaScript中的按钮单击。这种方法可确保正确执行嵌入在 Insert 命令中的所有逻辑,包括将焦点设置为 Shipment Nbr 输入。

Below is the sample to insert new Shipment when the user presses F2. Since the code snippet below utilizes capabilities of the framework, by pressing F2 the user executes the Insert command from the SOShipmentEntry BLC instead of simulating button click in JavaScript. This approach guarantees that all logic embedded into the Insert command, including setting focus to the Shipment Nbr input, is properly executed.

public class SOShipmentEntryExt : PXGraphExtension<SOShipmentEntry>
{
    public class PXInsertShortCut<TNode> : PXInsert<TNode> 
        where TNode : class, IBqlTable, new()
    {
        public PXInsertShortCut(PXGraph graph, string name)
        : base(graph, name)
        {
        }
        public PXInsertShortCut(PXGraph graph, Delegate handler)
            : base(graph, handler)
        {
        }
        [PXUIField(DisplayName = ActionsMessages.Insert, MapEnableRights = PXCacheRights.Insert, MapViewRights = PXCacheRights.Insert)]
        [PXInsertButton(ShortcutChar = (char)113)]
        protected override IEnumerable Handler(PXAdapter adapter)
        {
            return base.Handler(adapter);
        }
    }

    public PXInsertShortCut<SOShipment> Insert;
}

这篇关于无法将焦点转移到“装运”屏幕上的“装运Nbr”字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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