Creates a dynamic read-only browse widget or a dynamic updateable browse widget. Add browse columns to the widget with the ADD-LIKE-COLUMN, ADD-COLUMNS-FROM, and ADD-CALC-COLUMN methods. Specify the query for the widget with the QUERY attribute.The dynamic updateable browse can only be a NO-ASSIGN browse—you must make all data assignments to the database.
CREATE BROWSE handleIN WIDGET-POOL widget-pool-nameASSIGN attribute=expressiontrigger-phraseIN WIDGET-POOL widget-pool-nameSpecifies the widget pool in which the object is created. If you do not specify a widget pool, the object is created in the current default widget pool. The browse will go away when its widget pool goes away, or when you delete it with the DELETE OBJECT statement.ASSIGN attribute = expressionAssigns specified values to attributes of the object. The attribute parameter must be the name of a valid attribute for the object and expression must evaluate to a valid value for that attribute.A trigger phrase associated with the object. For more information, see the Trigger phrase reference entry.
/* r-dynbrws */DEFINE VARIABLE name-hdl AS HANDLE NO-UNDO.DEFINE VARIABLE num-hdl AS HANDLE NO-UNDO.DEFINE VARIABLE address-hdl AS HANDLE NO-UNDO.DEFINE VARIABLE calc-col-hdl AS HANDLE NO-UNDO.DEFINE VARIABLE browse-hdl AS HANDLE NO-UNDO.DEFINE VARIABLE buff-field-hdl AS HANDLE NO-UNDO.DEFINE VARIABLE brws-col-hdl AS HANDLE NO-UNDO.DEFINE VARIABLE jx AS INTEGER NO-UNDO.DEFINE BUTTON btn-delete LABEL "Delete".DEFINE BUTTON btn-quit LABEL "&Quit" AUTO-ENDKEY.DEFINE FRAME MyFrame SKIP(10)btn-delete btn-quitWITH SIZE 80 BY 22.DEFINE QUERY q1 FOR Customer SCROLLING.OPEN QUERY q1 FOR EACH Customer NO-LOCK.CREATE BROWSE browse-hdlASSIGNTITLE = "Dynamic Browse"FRAME = FRAME MyFrame:HANDLEQUERY = QUERY q1:HANDLEX = 2Y = 2WIDTH = 74DOWN = 10VISIBLE = YESSENSITIVE = TRUEREAD-ONLY = NO.ON ROW-DISPLAY OF browse-hdl DO:IF VALID-HANDLE(calc-col-hdl) THENcalc-col-hdl:SCREEN-VALUE =STRING(Customer.CreditLimit - Customer.Balance).END. ASSIGNnum-hdl = browse-hdl:ADD-LIKE-COLUMN("Customer.CustNum").name-hdl = browse-hdl:ADD-LIKE-COLUMN("Customer.Name").address-hdl = browse-hdl:ADD-LIKE-COLUMN("Customer.Address").calc-col-hdl = browse-hdl:ADD-CALC-COLUMN("INT","->,>>>,>>9.99","","Credit Left")./* Refresh needs to be done if ADD-CALC-COLUMN is done after the browse isdisplayed. In ROW-DISPLAY trigger, we can only set the calc field’sscreen-value if the handle is set. And the handle is set after theADD-CALC-COLUMN method is done. */browse-hdl:refresh().browse-hdl:EXPANDABLE = YES.ON ROW-LEAVE OF browse-hdl DO:IF browse-hdl:CURRENT-ROW-MODIFIED THEN DO:REPEAT jx = 1 TO browse-hdl:NUM-COLUMNS:brws-col-hdl = browse-hdl:GET-BROWSE-COLUMN(jx).IF brws-col-hdl:MODIFIED THEN DO:buff-field-hdl = brws-col-hdl:BUFFER-FIELD./* If buff-field-hdl is unknown, this is a calculated field and cannotbe updated */IF buff-field-hdl NE ? THENbuff-field-hdl:BUFFER-VALUE = brws-col-hdl:SCREEN-VALUE.END.END.END.END.ON CHOOSE OF btn-delete DO: /* LABEL "DeleteDynBrowse". */DELETE WIDGET browse-hdl.END.ON CHOOSE OF btn-quit DO:QUIT.END.ENABLE ALL WITH FRAME MyFrame.WAIT-FOR CLOSE OF CURRENT-WINDOW.
![]()
If the browse’s height is set using the DOWN attribute and a browse column is added, the browse’s height may change to ensure that the number of DOWN is preserved. This may be due to the addition of the horizontal scrollbar or the growth of the column header.
![]()
If the browse’s height is set using the HEIGHT-CHARS or HEIGHT-PIXELS attributes, or through direct manipulation, and a browse column is added, the DOWN attribute may change to ensure that the specified height is preserved. This may be due to the addition of the horizontal scrollbar or the growth of the column header.
![]()
The DISPLAY . . . WITH BROWSE browse-name statement cannot be used with a dynamic browse. Instead, the user must set the SCREEN-VALUE attributes.
![]()
A dynamic browse’s validation expression is restricted. It may not contain a CAN-FIND function. To reference the field, the FRAME-VALUE function must be used. The CAN-FIND function will still work for a static browse column.
![]()
If a buffer-field is associated with a dynamic browse column, set the buffer-field’s VALIDATE-EXPRESSION attribute before the dynamic browse column is added to the browse (via the ADD-LIKE-COLUMN( ) method). The validation expression is compiled at this time. If the VALIDATE-EXPRESSION attribute is changed later, it is ignored.
![]()
You can use the ASSIGN option to assign a widget ID value to the WIDGET-ID attribute for this object. If you have enabled application-defined widget IDs in your ABL GUI application, by specifying the Use Widget ID (–usewidgetid) startup parameter, then the AVM uses this widget ID when it creates the widget at run time, instead of using the widget ID it normally generates by default. If you have not enabled application-defined widget IDs, then the AVM ignores this option setting at run time.For more information about the WIDGET-ID attribute, see its reference entry in the “Handle Attributes and Methods Reference” section. For more information about the Use Widget ID (–usewidgetid) startup parameter, see OpenEdge Deployment: Startup Command and Parameter Reference.
© 2012 Progress Software Corporation and/or its subsidiaries or affiliates. |