本文介绍了浏览器中的值更改事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
define variable hOrderQuery as handle no-undo.
define variable browseOrder-hdl as handle no-undo.
define variable browse-hdl as handle no-undo.
define variable CNumber as integer no-undo.
CREATE QUERY hQuery.
hQuery:SET-BUFFERS(BUFFER Customer:HANDLE).
hQuery:QUERY-PREPARE("FOR EACH Customer").
hQuery:QUERY-OPEN().
CREATE BROWSE browse-hdl
ASSIGN
TITLE = "Customer Browser"
FRAME = FRAME MyFrame:HANDLE
QUERY = hQuery
X = 2
Y = 2
WIDTH = 74
DOWN = 10
VISIBLE = YES
SENSITIVE = TRUE
READ-ONLY = yes.
browse-hdl:ADD-COLUMNS-FROM(BUFFER Customer:HANDLE,"SalesRep,email,fax,comments,address,City,State,PostalCode").
on value-changed of browse-hdl
do:
FIND CURRENT Customer.
cNumber = Customer.CustNum.
CREATE QUERY hOrderQuery.
hOrderQuery:SET-BUFFERS(BUFFER Order:HANDLE).
hOrderQuery:QUERY-PREPARE("FOR EACH Order where Order.CustNum = " + string(cNumber)) no- error.
hOrderQuery:QUERY-OPEN().
CREATE BROWSE browseOrder-hdl
ASSIGN
TITLE = "Order Browser"
FRAME = FRAME MyFrame:HANDLE
QUERY = hOrderQuery
X = 2
Y = 240
WIDTH = 74
DOWN = 10
VISIBLE = YES
SENSITIVE = TRUE
READ-ONLY = yes.
browseOrder-hdl:ADD-COLUMNS-FROM(BUFFER Order:HANDLE,"warehousenum,CustNum").
end.
on value-changed of browseOrder-hdl
do:
message "hai" view-as alert-box.
end.
这是我的问题.我有3个浏览器.现在我只创建了2个.当我单击第一个客户浏览器的一行时,它应该选择当前客户,并在第二个浏览器订单浏览器中显示其订单.当我单击订单浏览器值时,它应该在第三个订单行浏览器(我现在没有创建)中显示相应的订单行表值.
this is my issue.I have 3 browsers.Now i created only two. When I click on first customer browser's one row it should select the current customer and should show his order in the second browser-order browser.When I click on order browser value it should show the corresponding orderline table values in the 3rd orderline browser(which i didnt create now).
因此,当我尝试使用browserOrder-hdl创建第二个值更改的事件时,它表明它已被删除.如何解决这个问题?请回复.
So when I tried to take the browseOrder-hdl to create second value-changed event, it is showing it is already deleted.How to overcome this issue??Please reply.
推荐答案
DEFINE FRAME MyFrame
WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
SIDE-LABELS NO-UNDERLINE THREE-D
AT COL 1 ROW 1
SIZE 80 BY 16.
define variable hOrderQuery as handle no-undo.
define variable browseOrder-hdl as handle no-undo.
define variable browse-hdl as handle no-undo.
define variable CNumber as integer no-undo.
DEFINE VARIABLE hQuery AS HANDLE NO-UNDO.
CREATE QUERY hQuery.
hQuery:SET-BUFFERS(BUFFER Customer:HANDLE).
hQuery:QUERY-PREPARE("FOR EACH Customer").
hQuery:QUERY-OPEN().
CREATE BROWSE browse-hdl
ASSIGN
TITLE = "Customer Browser"
FRAME = FRAME MyFrame:HANDLE
QUERY = hQuery
X = 2
Y = 2
WIDTH = 74
DOWN = 10
VISIBLE = TRUE
SENSITIVE = TRUE
READ-ONLY = TRUE
TRIGGERS:
ON VALUE-CHANGED DO:
RUN ShowOrderBrowser.
END.
END.
browse-hdl:ADD-COLUMNS-FROM(BUFFER Customer:HANDLE,"SalesRep,email,fax,comments,address,City,State,PostalCode").
WAIT-FOR CLOSE OF THIS-PROCEDURE.
/* ********************** Internal Procedures *********************** */
PROCEDURE ShowOrderBrowser:
/*------------------------------------------------------------------------------
Purpose:
Notes:
------------------------------------------------------------------------------*/
FIND CURRENT Customer.
cNumber = Customer.CustNum.
CREATE QUERY hOrderQuery.
hOrderQuery:SET-BUFFERS(BUFFER Order:HANDLE).
hOrderQuery:QUERY-PREPARE("FOR EACH Order WHERE Order.CustNum = " + STRING(cNumber)).
hOrderQuery:QUERY-OPEN().
CREATE BROWSE browseOrder-hdl
ASSIGN
TITLE = "Order Browser"
FRAME = FRAME MyFrame:HANDLE
QUERY = hOrderQuery
X = 2
Y = 240
WIDTH = 74
DOWN = 10
VISIBLE = TRUE
SENSITIVE = TRUE
READ-ONLY = TRUE
TRIGGERS:
ON VALUE-CHANGED DO:
MESSAGE "hai"
VIEW-AS ALERT-BOX.
END.
END.
browseOrder-hdl:ADD-COLUMNS-FROM(BUFFER Order:HANDLE,"warehousenum,CustNum").
WAIT-FOR VALUE-CHANGED OF browseOrder-hdl.
END PROCEDURE.
这篇关于浏览器中的值更改事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!