Consultor Eletrônico



Kbase 19401: How to use the SortBy-Case option in a V8 SmartObject
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   1/10/2000
Title: How to use the SortBy-Case option in a V8 SmartObject

KnowledgeBase number: 19401
Creation Date: 10-January-2000
Modified Date:

This document applies to : Progress Provision or Progress 4GL
Version and Release Number: Progress 8.2, 8.3

Details:

This kbase describes step by step the creation of a SmartWindow with a SmartBrowser using the SortBy-Case option using the Option SmartPanel and also using a radio-set widget in the SmartWindow to perform the same function.

The following steps assumes that you are in the UIB and are connected to a copy of the SPORTS database.

1) Create the SmartBrowser
You can use the SmartBrowser Template or the SmartBrowser Template
with Wizard.
- Create a SmartBrowser on the table customer using fields
cust-num, name and credit-limit.
- Open the Section Editor window for the SmartBrowser.
- Select the List option to display the available code sections.
- Select XFTR - Advanced Query Options (XFTR - Extended Features)
- In the Advanced Query Options dialog, insert two sort cases, one
for the cust-num field, and another for the name field.
- Save and close the SmartBrowser, name it b-cust.w.

2) Connect the SmartObjects
- CReate a SmartWindow.
- Add the SmartBrowser to the window.
- Add the Option SmartPanel to the window. Change the Style option
to Horizontal Radio-Set. Leave the other parameters by default.
Accept the PROGRESS Advisor link suggestion, which is to Add.
Create link to the SmartBrowser.

3) Run the SmartWindow
Notice that the Option SmartPanel is initialized with the
SortBy-Case options that you defined.
Select Name or Cust-Num at the radio-set to change the sorting of
the SmartBrowser.

You are done. You have now a running example using the SortBy-Case
option.
The following steps are optional. They use a radio-set widget at the window to show
how to control the SortBy-Case from a simple widget, without using
the Option SmartPanel.


4) Adding a radio-set to control the SortBy-Case option
- Add a radio-set widget to the SmartWindow.
- Change the radio-set to be defined as Character and to use the
Horizontal layout.
- Change the radio Buttons to:

"Cust Num", "Cust-Num",
"Name", "Name"

- Add the following code to the value-changed trigger of the
radio-set widget using the Section Editor:

RUN set-attribute-list IN h_b-cust
(INPUT "SortBy-Case=" + SELF:SCREEN-VALUE).
RUN dispatch IN h_b-cust ('open-query':U).


5) Run the SmartWindow
Select Name or Cust-Num at the radio-set widget to change the
sorting of the SmartBrowser.

Advanced Note:
The SortBy-Case option generates an adm-open-query-cases procedure in the SmartBrowser. This procedure does not need to be called directly since the ADM open-query procedure calls it instead.


Reference to written documentation
- Progress User Interface Builder Developer's Guide
- Kbase 16512 Examples of Using the Option SmartPanel