一个屏幕,两个网格,两个查询,一个表,奇怪的行为 [英] one screen, two grids, two queries, one table, strange behaviour

查看:95
本文介绍了一个屏幕,两个网格,两个查询,一个表,奇怪的行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



您好,


我有一个带两个网格的可编辑屏幕。让我们说Grid1与Query1和Grid2与Query2。


两个查询指向同一个表,但Query1有一个过滤器在Field1 ='X'(例如),而Query2有一个过滤器在相同的字段上但使用过滤器Field1 ='Y'


在第一个网格grid1上,当创建新实体时(通过输入字段中的第一个字符),记录显示在grid2中立即启动。


它只在刷新后消失


为什么?


谢谢


Bart

解决方案

刷新屏幕重新执行过滤2个数据网格后面的查询记录刚刚添加的内容。


屏幕上的2个网格绑定到各自的查询以及CHANGESET中的所有内容。因此,当您在客户端上添加新记录时,您的网格会显示数据。您也会看到类似的行为 用于编辑和删除。


那么为什么在您为新记录提交更改后,网格2中的记录不会消失?这是因为在保存时不会重新执行网格后面的查询。


您可以覆盖保存行为以明确允许,但默认情况下不会刷新。要在保存后刷新屏幕,请执行以下操作:


1。从屏幕设计器中,右键单击保存屏幕命令并选择编辑保存代码

2.您可以调用this.Refresh();或者Me.Refresh()(取决于您的编程语言),这应该可以解决问题。


HTH,

Babar



Hi,

I have an editable screen with two grids. Lets say Grid1 with Query1 and Grid2 with Query2.

Both queries point to the same table, but Query1 has a filter on Field1='X' (for example), and Query2 has a filter on the same field but with filter Field1='Y'

On the first grid, grid1, when a new entity is created (by entering the first character in a field), the record shows up immediately in grid2.

It only disappears after a refresh

How come?

Thanks

Bart

解决方案

Refreshing the screen re-executes the query behind the 2 data grids that filters the record you just added.

the 2 grids on your screen are bound to their respective queries AND EVERYTHING IN THE CHANGESET. So when you add a new record on the client, your grids show the data. You will see similar behavior for edit and delete as well.

So why doesn't the record in grid 2 go away once you have committed the changes for a new record? This is because the queries behind the grids are not re-executed on save.

You can override your save behavior to explicitly allow that but it will not refresh by default. In order to refresh your screen after save, do the following:

1. From screen designer, right click the save screen command and select Edit Saved Code
2. you can call this.Refresh(); or Me.Refresh() (depending on your programming language) here and that should do the trick.

HTH,
Babar


这篇关于一个屏幕,两个网格,两个查询,一个表,奇怪的行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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