在我的进度应用程序中使用浏览器时,滚动条无法正常工作。它将表明我只能向下滚动一点然后继续前进。这是一个正在进行的错误还是我可以做些什么来解决这个问题?
/* Connected Databases
sports2000 PROGRESS
*/
&Scoped-define WINDOW-NAME wWin
{adecomm/appserv.i}
CREATE WIDGET-POOL.
{src/adm2/widgetprto.i}
&Scoped-define PROCEDURE-TYPE SmartWindow
&Scoped-define DB-AWARE no
&Scoped-define ADM-CONTAINER WINDOW
&Scoped-define ADM-SUPPORTED-LINKS Data-Target,Data-Source,Page-Target,Update-Source,Update-Target,Filter-target,Filter-Source
&Scoped-define FRAME-NAME fMain
&Scoped-define BROWSE-NAME BROWSE-2
&Scoped-define INTERNAL-TABLES Order
&Scoped-define FIELDS-IN-QUERY-BROWSE-2 Order.PO Order.OrderDate ~
Order.Ordernum
&Scoped-define ENABLED-FIELDS-IN-QUERY-BROWSE-2 Order.PO Order.OrderDate ~
Order.Ordernum
&Scoped-define ENABLED-TABLES-IN-QUERY-BROWSE-2 Order
&Scoped-define FIRST-ENABLED-TABLE-IN-QUERY-BROWSE-2 Order
&Scoped-define QUERY-STRING-BROWSE-2 FOR EACH Order NO-LOCK INDEXED-REPOSITION
&Scoped-define OPEN-QUERY-BROWSE-2 OPEN QUERY BROWSE-2 FOR EACH Order NO-LOCK INDEXED-REPOSITION.
&Scoped-define TABLES-IN-QUERY-BROWSE-2 Order
&Scoped-define FIRST-TABLE-IN-QUERY-BROWSE-2 Order
&Scoped-define OPEN-BROWSERS-IN-QUERY-fMain ~
~{&OPEN-QUERY-BROWSE-2}
&Scoped-Define ENABLED-OBJECTS BROWSE-2
DEFINE VAR wWin AS WIDGET-HANDLE NO-UNDO.
DEFINE QUERY BROWSE-2 FOR
Order SCROLLING.
DEFINE BROWSE BROWSE-2
QUERY BROWSE-2 NO-LOCK DISPLAY
Order.PO FORMAT "x(20)":U
Order.OrderDate FORMAT "99/99/99":U
Order.Ordernum FORMAT "zzzzzzzzz9":U
ENABLE
Order.PO
Order.OrderDate
Order.Ordernum
WITH NO-ROW-MARKERS SEPARATORS SIZE 59 BY 8.1 FIT-LAST-COLUMN.
/* ************************ Frame Definitions *********************** */
DEFINE FRAME fMain
BROWSE-2 AT ROW 4.81 COL 13 WIDGET-ID 200
WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
SIDE-LABELS NO-UNDERLINE THREE-D
AT COL 1 ROW 1
SIZE 80 BY 17 WIDGET-ID 100.
IF SESSION:DISPLAY-TYPE = "GUI":U THEN
CREATE WINDOW wWin ASSIGN
HIDDEN = YES
TITLE = "<insert SmartWindow title>"
HEIGHT = 17
WIDTH = 80
MAX-HEIGHT = 28.81
MAX-WIDTH = 146.2
VIRTUAL-HEIGHT = 28.81
VIRTUAL-WIDTH = 146.2
RESIZE = no
SCROLL-BARS = no
STATUS-AREA = no
BGCOLOR = ?
FGCOLOR = ?
THREE-D = yes
MESSAGE-AREA = no
SENSITIVE = yes.
ELSE {&WINDOW-NAME} = CURRENT-WINDOW.
{src/adm2/containr.i}
IF SESSION:DISPLAY-TYPE = "GUI":U AND VALID-HANDLE(wWin)
THEN wWin:HIDDEN = yes.
&Scoped-define SELF-NAME wWin
ON END-ERROR OF wWin /* <insert SmartWindow title> */
OR ENDKEY OF {&WINDOW-NAME} ANYWHERE DO:
/* This case occurs when the user presses the "Esc" key.
In a persistently run window, just ignore this. If we did not, the
application would exit. */
IF THIS-PROCEDURE:PERSISTENT THEN RETURN NO-APPLY.
END.
ON WINDOW-CLOSE OF wWin /* <insert SmartWindow title> */
DO:
/* This ADM code must be left here in order for the SmartWindow
and its descendents to terminate properly on exit. */
APPLY "CLOSE":U TO THIS-PROCEDURE.
RETURN NO-APPLY.
END.
&Scoped-define BROWSE-NAME BROWSE-2
&UNDEFINE SELF-NAME
/* *************************** Main Block *************************** */
/* Include custom Main Block code for SmartWindows. */
{src/adm2/windowmn.i}
/* ********************** Internal Procedures *********************** */
PROCEDURE adm-create-objects :
END PROCEDURE.
PROCEDURE disable_UI :
/* Delete the WINDOW we created */
IF SESSION:DISPLAY-TYPE = "GUI":U AND VALID-HANDLE(wWin)
THEN DELETE WIDGET wWin.
IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
END PROCEDURE.
PROCEDURE enable_UI :
ENABLE BROWSE-2
WITH FRAME fMain IN WINDOW wWin.
{&OPEN-BROWSERS-IN-QUERY-fMain}
VIEW wWin.
END PROCEDURE.
PROCEDURE exitObject :
APPLY "CLOSE":U TO THIS-PROCEDURE.
RETURN.
END PROCEDURE.
当我使用这样的浏览器时,我将滚动条向下拉到底部,然后单击滚动条上的向下箭头,仍然有行(即使滚动条位于屏幕的底部)。 / p>
答案 0 :(得分:3)
我重新设计了示例代码以使用“sports2000”数据库,我可以看到发生了什么。
define query browse-4 for customer.
DEFINE BROWSE BROWSE-4
QUERY BROWSE-4 NO-LOCK DISPLAY
custNum name
/* ENABLE name */
WITH NO-ROW-MARKERS SEPARATORS SIZE 32 BY 6.46 FIT-LAST-COLUMN.
.
open query browse-4 preselect each customer no-lock.
enable browse-4.
wait-for window-close of current-window.
关键更改是在OPEN QUERY中使用PRESELECT。否则只返回部分结果集。这是一个众所周知的功能。
但请注意 - 如果您的查询涉及数千条记录,则PRESELECT的效果不会很好。当然,在UI中显示许多记录可能是一个糟糕的主意。