FoundSetUpdater

When I use the FoundSetUpdater it messes with my foundsets. I have more than one record visible in my form but I limit the Updater to updating the current record as follows:

var fsUpdater = databaseManagerg.getFoundSetUpdater(PrimaryKey_PrimaryKey)
fsUpdater.setColumn(‘bells_phenomenonod’,null)
fsUpdater.performUpdate()

The proper record gets updated but after the last step it takes me to record index 1. If I flip the form to the desired record index I notice that the form is now on a different record index than other forms that use the same foundset. Even though all forms share the same foundset they remain on record index 1 till flipped to the desired record index. I found a work around but it would be better if it did not do this.

John McCann

I think you have to look here: http://forum.servoy.com/viewtopic.php?t=1944&highlight=

(see the fifth reply of jcompagner!!)
You always have take the foundset with you, when you go to another form.!

HJK:
I think you have to look here: http://forum.servoy.com/viewtopic.php?t … ighlight=t

(see the fifth reply of jcompagner!!)
I jsut want to give you one hint.
Always Always Always give the foundset with the show command ..
Or always set the foundset before showing in a dialog.

Never just show the form. (maybe that method shouldn’t never have been there…)

I understand and agree with what jcompagner says about always loading a foundset before displaying it. This does not really explain the problematic behavior of the foundsetupdater.

Prior to displaying a form I load the rows onto a form with a tabpanel. I have multiple forms on the tabpanel all with the same base table and all sharing the same foundset. Up to the point I use the foundsetupdater I have no problems with all forms sharing the same foundset. When I use the foundsetupdater to update one of the rows it gives the form I am executing the method from a different foundset than the other forms on the same tabpanel. This should not happen if all forms on the tabpanel are set to share a foundset. Also, executing the foundsetupdater on one row of a foundset should not cause the record index to revert to 1. This can be worked around by saving the record index, duplicating the foundset, loading the record to update, and then loading the duplicate foundset and then setting the record index. It would better if it did not require the extra steps and that is what this is about, making Servoy even better.

John McCann

We are unable to reproduce this the selected record stays in place, could you post a small sample solution demonstrating this issue?
BTW using the founsetUpdater to update 1 row is less efficient than setting the field, like done with bells_phenomenonod = null

I’ll send an example. I only use the foundsetupdater if I have >40 fields to update. It is much faster to use it on 40 fields than just assigning the values.

John McCann

I have a complex solution that I have no problem reproducing the problem within. I have a work around for the problem. Do you want me to send you a complex of example of this behavior?

John McCann

yes, please