Solved

remember the sort criteria of a datawindow

Posted on 2004-03-23
6
309 Views
Last Modified: 2013-12-26
Hi!

How to save the current sort criteria of a datawindow to aply another and later return to the first sort?

Thank you!
0
Comment
Question by:tsirakua
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 14

Accepted Solution

by:
sandeep_patel earned 125 total points
ID: 10664520
hi,
let's take an example that your datawindow has two columns emp_code and emp_name and you specified the sort criteria while designing the datawindow so your sort criteria is say
'emp_name A'.
now through script u can get this value by using

String is_sort  // instance variable
is_sort = dw_1.Object.datawindow.table.sort

you can store this value in instance variable, before applying another sort scriteria and can reapply later with
dw_1.setsort(is_sort) and
dw_1.sort()

hope it will work for u..if not reply...
-sandeep
0
 
LVL 18

Expert Comment

by:diasroshan
ID: 10664616
hi  tsirakua,
try the following code in the clicked event of a button...assuming that ur dw has retrieved....

String ls_sort, ls_caption

ls_caption = cb_sort.Text
If Upper(ls_caption) = 'SORT' Then
      is_oldsort = dw_1.Object.DataWindow.Table.Sort  // remember old sort criteria
      SetNull(ls_sort )
      dw_1.SetSort(ls_sort)   // ask user for sort criteria
      dw_1.Sort()
      cb_sort.Text = 'Release'
Elseif Upper(ls_caption) = 'RELEASE' Then
      dw_1.SetSort(is_oldsort)  // apply old sort criteria
      dw_1.Sort()
      cb_sort.Text = 'Sort'
End If      

let me know for further clarifications......

Cheers...
Rosh
0
 
LVL 18

Expert Comment

by:diasroshan
ID: 10664626
...oops ...a bit late....

...anyways just forgot to mention is_oldsort is an instance variable...

Cheers,,
Rosh
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 14

Expert Comment

by:sandeep_patel
ID: 10664667
Hi! Rosh,

don't worry man...better luck for next time..and still it's not closed....it's open........:)

-sandeep
0
 
LVL 8

Expert Comment

by:Vikas_Dixit
ID: 10666986
Hey this EE should have something like "Row (Page) changed between retrieve and update" :))
--Vikas
0
 

Author Comment

by:tsirakua
ID: 10669943
Thank you
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand column That will then direct you to their download page. From that p…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question