Synchronizing a TextList

I have a list that displays several fields from within a database. As I edit data in a separate form, the list fails to update with the new information. I’ve tried several ways to force it to refresh but so far no luck. It would seem though that connecting every data cell to a procedure to refresh the list would be a bit burdensome. FillList doesn’t work, even when the list is in the active window. Have I overlooked a setting in the list object that keeps it in synch?

Perhaps I do not understand your setup but the list should refresh if you Tab out of your edited field in the separate form. If that fails just Save the database.

I woud ahve expected tabbing to work but it doesn’t, nor do any of the commands I’ve tried to force a refresh. I’m not sure why you think Save would make any difference on refreshing.

Okay, my response above works only if there is no code linking the TextList with fields displayed on a form. In other works, clicking on a record in the list does not bring up that record in the form. Usually this is what you want to do, so you need to refresh the linking code.

I solved this problem in Pan6 with a button (above the TextList) which when clicked ran the following procedure:

Field last
SortUp
Field first
SortUpWithin

SuperObject "ClientList","FillList"

currentclient=last+", "+first
find currentclient match last+", "+first
ShowVariables currentclient
SuperObject "ClientList","AutoScroll"

Where last is the last name and first is the first name displayed in the ClientList TextList.

I have not converted this Pan6 database to PanX yet so I have not come up with the best way of doing this in PanX but it should not be too difficult.

I have been interested in finding a solution to this problem for some time. I posted this issue on Bitbucket, jimrea / PanoramaX / issues / #625 - Updating a textlist with changed data — Bitbucket. I am not sure what Jim’s thinking is on this issue. I have found some kluge strategies that work in some conditions, such a procedure that executes an uprecord then downrecord command will cause the text list to update but only if the data sheet is open. If someone knows how to do this, I would be very interested in knowing this. Going into and out of Graphics mode always works, but that’s a terrible solution.

I’m finding the same issue exists in a database I converted from Pan 6. The code is similar to Tom’s. I’ve tried many things, but have yet to find a solution.

Upon further examination, the code I posted above appears be of little use in solving this problem in PanX. It fails to take advantage of the more powerful and different tools now available. A more elegant and easy solution is needed to match the other Text List Options available in the TextList property pane.

An “automatic, always on” refresh of a TextList may be fine for the majority of databases with a relatively small number of records. However, a user-triggerred refresh may be more appropriate for databases with a large number of records to avoid tying up other database operations.

The only way I could force the list to update the entry is by using a “Refresh List” button with this code:

if info("eof")
    uprecord
    downrecord
else
    downrecord
    uprecord
endif

Using objectaction "myList","FillList" seemed to occasionally work if repeatedly executed over time but was very unreliable (there seemed to be a time delay after entry and before the command was issued successfully). The above code was all that I was left with that seemed to work reliably.

Ok, just added to the code:

noshow
if info("eof")
    uprecord
    downrecord
else
    downrecord
    uprecord
endif
showpage
endnoshow

Now the list will update the entry and not visibly move up or down records.

I realize I may be misunderstanding the problem, but appears if your text list is tied to a text array stored in a variable, and a .ModifyRecord procedure updates the array then shows the variable containing the array, the display of the text list updates in real time.

Demo here: https://dl.dropboxusercontent.com/u/95490672/TextListUpdateDemo.pandb.zip

The root of the problem is that TextLists can do so much more now. In my case I’ve got a TextList with multiple, adjustable columns with headings. It’s absolutely marvelous - until I edit data in an adjacent form and the list remains as it was. What’s needed (Jim Rea: we’re never there yet) is something along the lines of the other options in the Text List Options. Text List Linking To the Database needs an option to automatically refresh the list whenever the data changes.

I’m with you on what an advance the new text lists are! I’m no longer using view as list forms as text lists are so much slicker and quicker!

The comments on this thread talking about the work-arounds to the updating problem that haven’t worked is what got me to try the work-around that came to my mind that did seem to work in my simple example.

There is definitely additional work needed on Text Lists and Matrixes in this area. I believe I mentioned this when teaching the class. At a minimum it would be good if Text Lists had a redraw command like Matrix objects do – I thought I had done this but I checked and I have not. Ultimately it would be very cool if updates were automatic when the Database Navigator mode is being used. However, it will probably be a while before I can tackle these projects. Maybe I can get the redraw command done fairly soon.

Jim, did you ever do a redraw for Text Lists? I’m trying to update a list when an entry is made in a Text Display object on the same form. I created a work around, but I’m not sure how well iit will work with large lists.