Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refresh in browse when using a filter

Status
Not open for further replies.

ShortyII

Programmer
Sep 8, 2003
57
0
0
NL
Hello,

Could you please help me with the following.
I have a browse on a table and when i say SET FILTER TO ...
He doesn't refresh my browser until i go page-up or page-down.

This i tryed
SET REFRESH TO 0
SHOW GETS WINDOW nameWindow

But it dosn't refresh my browse anyone???
 
Try setting your refresh to 1,1 instead of 0.
However some behavior I noticed, is that if when in a BROWSE window, and the first page or screenful of records is what is shown, the browse doesn't change the record set to the filter condition. If the record pointer is on any other set of records, like the second page, it does.
Here's my test:

set refresh to 1, 1
on key label f11 set filter to some filter condition
on key label f12 set filter to
browse

Alternate f11 and f12 a couple times. Then press the 'Page Down' key and alternate f11 and f12 keys.

So, in the end, to display the records matching the filter condition on the first screenful, you may have to reissue the BROWSE statement.


-Dave S.-
[cheers]
Even more Fox stuff at:
 
Thanx dave for the fast response but will give another issue

This is then wath you get


-----------------
|________________|
|__1_| |
|__2_| |
| |
| |
|________________|

FUNCTION Selection
Do Browser
RETURN

FUNCTION Browser
BROWSE
RETURN

Via menu option
SET FILTER TO ...
Now doing again BROWSE will give me a DO NESTING ERROR because the function and browse is never closed

 
When something has changed such as applying a new and/or different FILTER....

If your Browse screen is named "BrwsWin"

SHOW WINDOW BrwsWin REFRESH

You can read your Foxpro Help on SHOW WINDOW for more information on this command.

Good Luck,


JRB-Bldr
VisionQuest Consulting
Business Analyst & CIO Consulting Services
CIOServices@yahoo.com
 
Hi ShortyII,

Try this,

on key labe f2 do DF2
on key labe f3 do DF3
USE \fpw26\customer
browse
on key labe f2
on key labe f3
RETURN

function Df2
set filt to company="J"
go top
RETURN

function Df3
set filt to
go top
RETURN

my idea is, only GO TOP command works insted of set refresh to 1,1 and SHOW WINDOW BrwsWin REFRESH in above post.

NOTE : if problem not solved type in details, we can try some other way.
 
Thanx for your help:

Show window ... REFRESH
i can't use because when i do this i lose the browse that was active in that screen :( No option to reissue the browse because if this happens more then 10 times i get a fatal error

NoWait in the browse statement
i can't do this because i use a menubar and when you use nowait in a browse he won't give away the focus so you can select a sort option :(

Go Top
It refreshes but i lose the record i was on so you have to go manualy to your record. Can't do a search after the go top because the where you where standing on hasn't a unique index. giving a unique index then search and set to selected index he dosn't :( refresh.

I know it is a flow problem but how can i solve it ????
I wan't a browser with a menubar on top to change sort/filter. when sort/filter is changed the pointer has to stay on the previous selected record.

Thanx for your help
 
Hi ShortyII,

Go Top refreshes the browse but you loss the record where you on.

ON my above example of customer.dbf

you browse with no filteration, you are on 1st record which starts from "A" if you type F2 for filteration and filter by company="J"
and browse gets filtered & refresh and shows records company="J"

How can you rest on record 1, when you filter by "J" ?

you will lose the record where you on & how do you choose it by manualy ?

I think, it is not cleard, what you want exactly !



 
A couple of questions to better clarify the problem:

You say: "Show window ... REFRESH
I can't use because when I do this I lose the browse that was active in that screen :( No option to reissue the browse because if this happens more then 10 times I get a fatal error"


1. "lose the browse that was active in that screen" ??
I thought that the whole point was that you were changing something and wanted a new Browse Result to show - thereby intentionally changing the "browse that was active".
If you mean that you are changing the focus record, then prior to the change do a mnRec = RECNO and after the change issue a GO mnRec.

2. "if this happens more then 10 times I get a fatal error" ??
Why would you do this 10 times? Could it be that you are attempting to do something like an incremental seek/browse for which there are MUCH better ways of doing. If so, perhaps you should consider one of these better approachs.

Good Luck,


JRB-Bldr
VisionQuest Consulting
Business Analyst & CIO Consulting Services
CIOServices@yahoo.com
 
Thanx everyone for your great help.
For the time beeing i will do go top and i made a seek so they can manualy search for the customer.

So thanx it's not perfect but for the time beeing it will do.

till Next time
 
Using BROWSE is a very powerful command, so it is relatively simple to use, just a one line command. On the other hand, its disadvantage is you don't have total control over a user's edits as you might in a custom entry screen. If an unexpected or accidental change is made but not noticed at the time, it may not be detected without a lot of additional coding before and after, or worse, possibly days or months later.
 
HI ShortyII,

I worked on your question many ways, after all GO TOP I found the best even before filtering.

Anyway, good luck.
 
Hi ShortyII

Try this code i think this will solve your problem

on key labe f2 do ReFresh
use customer
brow
on key labe f2
retu

function ReFresh
mrec = recno()
set filt to cname='K'
go top
go mrec
retu
 
Hi ShortyII

Try this code i think this will solve your problem

on key labe f2 do ReFresh
use customer
brow
on key labe f2
retu

function ReFresh
mrec = recno()
set filt to cname='K'
go top
go mrec
retu

Kunti
 
Hi kunti

Subject to the thread is SHOULD REFRESH BROWSE , are you sure above code refreshes browse with go mrec ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top