Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 542
  • Last Modified:

Application data (Edit Box) not refreshing when data is changed remotely by a Browse window.

Sorry about "long title".  Here is the issue.  My Foxpro application is running properly.  Sometime I have to change / correct data using Foxpro command from development PC.  Doing so, corrected data not showing on application unless I quit application.  
Application opens table in SHARED mode.  When connecting to a table using Foxpro commands, also connecting SHARED.  Application still does not show updated data even after closing table from Foxpro command.  Updated data will only be shown by Application after quit and restart.
Any ideas !?
0
meep_meep
Asked:
meep_meep
  • 6
  • 5
  • 2
1 Solution
 
pcelbaCommented:
It could mean the Edit box or its source data is not refreshed. What is the Edit box ControlSource?

Did you try to skip to another record and back?
0
 
pcelbaCommented:
Also to refresh Edit box by actual data from the current record you have to issue Refresh method of the Edit box or you may refresh the whole form

Appropriate SET REFRESH setting is also required.
0
 
meep_meepAuthor Commented:
Yes I tried to skip to another record and back as I also, for testing purposes, add a specific button to "force" Edit box refresh.  Still no updates on application form.  Foxpro help is referring to Data Session.  My form is DataSession = 1.  There is some weird situation, however.  If 2 application are started, sharing same data, changing grid data on one form will make other application refreshed record moves.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
Olaf DoschkeSoftware DeveloperCommented:
Are you binding to tables or views or queried data? Changes in the table will not take effect if what you display rather is a view. You'd need to requery the view, refreshing the controls does not help then.

Bye, Olaf.
0
 
meep_meepAuthor Commented:
I'm not exactly sure what you mean by Binding to tables but I'm making text control source = TableName.FieldName so I assume I am binding to table.  Edit box have ControlSource same way as TableName.FieldName.  I point: if I change value of a grid cell in App "A", changing recno in App "B" will make change visible on App "B".  If I change EditBox content in App "A", change will not reflect in App "B" unless I quit and restart App "B".
It looks like App "B" is assuming no changes done on EditBox object (with ControlSource = TableName.FieldName) while it is noticed when change is done by App A Grid.  Sounds like DataSession ...
0
 
pcelbaCommented:
Lets assume

SET REFRESH TO 0,5  && VFP default value

Set some record in "App A"
Set same record in "App B"
Change the Editbox contents in "App A"
Skip to another record in "App A"  -  this will release possible locks and flushes buffers to disk
Wait 5 seconds -  this will update buffers (but nothing else) in "App B"
"App B" should still display the original value  (because Edit box was not refreshed yet)
Skip to another record and back in "App B"  -  the Edit box value should be updated at this point.

Above scenario does not suppose any table/row bufferring. If your form contains some kind of data bufferring then you just have to ensure data saving in "App A" after data change.

If all above steps were done but "App B" data still remain unchanged then you don't have table data directly binded to your form controls but they are using e.g. cursors etc.

Data sessions should not have such bad influence to your form behavior.
0
 
meep_meepAuthor Commented:
Ok.  App "A" is application running on "A" PC.  App "B" is application running on "B" PC.  So both PC run same application (on their C:\Program Files\...)  Data are located, let say on a "C" PC.  Using Foxpro programming software to open table in "C" PC, browse table.  App "A" form is showing a Grid and an EditBox (grid has controlSource to one table while EditBox has another table as ControlSource).  EditBox is related to Grid Table.  So, as rec change in Grid, edit box is showing something different (according to the Set relation).  From "A" PC, change EditBox content while "B" PC is located somewhere else.  Wait a minute then place REC on "B" PC to show same REC as "A" PC.  "B" PC EditBox not updated.  
From that point, open table in "C" PC and browse content of the Edit Box: content updated un browse but still not updated on "B" PC.
Looks like example in Help (VFP 9.0 SP2): How to: Manage Multiple Instances of a form... :S

As you are saying, how can I find out if my form has the EditBox ControlSource not directly binded but buffered ?!
0
 
meep_meepAuthor Commented:
Other info.  Does same result in Edit Box if I have only one application running and Visual Foxpro on another PC modifying EditBox content.   However, if Foxpro is modifying Grid content, application is updated as soon as RECNO is changed (on application).
0
 
pcelbaCommented:
So, if the browse window shows the right data then the problem is in Edit box refresh.

The Edit box seems to be binded directly to the table field. The only remaining possibility is SET REFRESH settings. What value do you use in your app?

Table and/or row buffering is easily recongnisable if you search for following commands (or their parts) in your source code:

TABLEUPDATE( ...
CURSORSETPROP("Buffering", ...

0
 
meep_meepAuthor Commented:
WOW, you're making my day today !!!  Set refresh was set to 0,0.  What values would you recommend?  We're looking to place application on a Terminal Server (which is making multiuser approach serious boost).  For testing, I place Set Refresh 1,5
0
 
pcelbaCommented:
SET REFRESH 1,5  means  1 second refresh in Browse window (which you probably don't use in your app) and 5 seconds for common data buffers refreshing. It should be OK but you could even use higher value to reduce network traffic.

Terminal Server can also reduce network traffic but it consumes server resources a lot, so everything depends on your server hardware. Standard file server topology on a reliable network hardware can serve more users on weaker hardware but everything depends on your company rules and plans.
0
 
Olaf DoschkeSoftware DeveloperCommented:
You can actually stay with REFRESH 0,0 as long as you skip from the record in PC A and refresh by skipping back and forth in PC B the value would also refresh. As pcelba said it much depends on buffering settings. There's also SYS(1104) or FLUSH to flush buffers (on A).

Bye, Olaf.
0
 
meep_meepAuthor Commented:
With REFRESH 0,0, Grid data was updating properly while skipping back and forth either PC.  However, EditBox data was not updating.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 6
  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now