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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

looking for generic refresh for pageframe

Status
Not open for further replies.

Nifrabar

Programmer
Mar 16, 2003
1,343
0
0
NL
Hi to all !

Is there a generic way to refresh the content of a page of the pageframe once selected at run-time?
As far as I can see it's not possible to do that in the class though ?

Would the only solution be to put a refresh on every page of the pageframe ?

-Bart
 
Hi

1. You can havee your own PageClass which can have code to refresh that page when the Activate event takes place.

2. Another generic way is to put in the forms refresh event..

LOCAL oThis, oPage
FOR EACH oThis IN ThisForm.Controls
IF oThis.BaseClass == "Pageframe"
FOR EACH oPage IN oThis.Pages
oPage.Refresh()
ENDFOR
ENDIF
ENDFOR

However if you have PageFrames within PageFrames, you may have to make this as a method and and then cycle thru this.

So whenever you refresh the form, the pages will get refreshed.
:)

____________________________________________
ramani - (Subramanian.G) :)
 
Hi Ramani,
Your first solution sounds most good to me.
But how do you manage that, for during developing you might add additional pages to the pageframe. I am wondering about code (in class) to handle the refresh for these additional pages.

Regarding your second solution:
I did not test, but will all pages be refreshed once I skip a record? So fresh data for the skipped record will be available at all pages of a pageframe ?

-Bart
 
Nifrabar

As you can only view one page at a time, refreshing them all pages at once can be an extravagent use of processing resources.

It's more efficent to refresh a page on activation and better still only refresh the controls that need it.

FAQ184-2483 - answering getting answered.​
Chris [pc2]
PDFcommander[sup]tm[/sup].com
PDFcommander[sup]tm[/sup].co.uk


 
Hi Chris,
Yes I agree about refreshing of all pages at once is not needed. But than stil the Q remains how to refresh the pages without explicite put refresh code in the activate method of the page on a frame.
Or, just a brainwave, should I create a class with max. expected pages and than at the form reduce the the number of pages ?
That case I only need to put the refresh code in the pages of the class.
-Bart
 
Nifrabar
Nifrabar said:
Or, just a brainwave, should I create a class with max. expected pages and than at the form reduce the number of pages?
I would think that would work well for you
Code:
[COLOR=blue]THISFORM.pgfFrame1.RemoveObject([Page6])[/color]
would take out the sixth page.


FAQ184-2483 - answering getting answered.​
Chris [pc2]
PDFcommander[sup]tm[/sup].com
PDFcommander[sup]tm[/sup].co.uk


 
In your Pageframe class, Create an ActivePage_Access Method (To create this method while modifying your class, Under the 'Class' menu, Select 'Edit Property/Method', Click on the 'ActivePage' property, and Check the 'Access Method' box and apply changes.)

Place the following code in the ActivePage_Access method:

THIS.Objects(THIS.ActivePage).Refresh
RETURN THIS.ActivePage

This should refresh each page as it gets selected by the user.


-Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top