Consultor Eletrônico



Kbase P30414: How to dynamically set the sort by in a v8 smartbrowser?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   25/11/2003
Status: Unverified

GOAL:

How to dynamically set the sort by in a v8 smartbrowser?

FACT(s) (Environment):

Windows

FACT(s) (Environment):

Progress 8.x

FIX:

In the browser you must create a procedure that will reopen the query. If you want to sort multiple ways the best method is to create a Procedure with a input parameter then pass in the method by which you want to sort by into a case statement.

Procedure Sample Syntax;
DEFINE VARIABLE currentval as ROWID.
DEFINE INPUT PARAMETER srtvalue AS c.
currentval = ROWID(customer).


CASE srtvalue:
WHEN "name" THEN
OPEN QUERY br_table FOR EACH customer BY NAME.
WHEN "State" THEN
OPEN QUERY br_table FOR EACH customer BY state.
OTHERWISE
OPEN QUERY br_table FOR EACH customer BY custnum.
END CASE.


REPOSITION br_table TO ROWID currentval NO-ERROR.


END PROCEDURE.

Then you can just run this procedure in the handle of the browser.

Syntax Sample;

RUN resorter in h_browse([what to sort by]).