Updating a record with unbound controls on a form (OpenInsight Specific)
At 06 APR 2001 02:52:08AM Scott, LMS wrote:
Hi all
I have a form used to update part of a record. It used to have a edittable with a bunch of columns bound to associated multivalue fields (schedule) in the table.
We ran into problems with the number of rows we could have in the edittable blowing limits all over the place. We made a temporary cure by changing the row limit on the edittable to "-1" - weird but it seems to help.
In order to allow more lines to be added, I changed the edittable to an unbound paging system. On form create I put a "copy" of the schedule into a hidden "TEXT" box, to avoid problems with rows, and displayed a limited number of lines from the table . So users can enter stuff into the paging edittable and change pages, and adding and editting keeps the corresponding TEXT box containing everything to do with the associated fields up to date.
Which is fine until we execute the form write event. Now since nothing is linked to the associated fields, it doesn't update them with the new schedule. Do I trash all the links (including the key) and manage the form to table updating manually or is there some way I can load the contents of the schedule into @RECORD (or similar) before it gets written? In the write script maybe? Remember, it's not going in the EDITTABLE because of unpleasant size limits.
Scott, LMS
At 06 APR 2001 04:18AM Simon Wilmot wrote:
Janet,
a) -1 is standard functionality for unlimited edit-tables
b) Can you not bind the hidden control to the required control and then copy the data to the edit-table. You could then compare contents in the write script and update the bound control if it had changed ..
Regards,
Simon
Rebus
At 06 APR 2001 09:38AM Donald Bakke wrote:
Janet,
The problem is that your hidden editbox is not databound. If you must go with this method then I suggest keeping multiple hidden editboxes (or editlines would be better), one for each data column in your edittable, on the form. Then transfer each column of information to the respective editlines just prior to the system's WRITE event.
At 09 APR 2001 02:28AM Scott, LMS wrote:
Hmm, sounds like an overload. The whole thing (associated multivalues) should probably be in their own table. And I am thinking about making that work.
I'd have to add and manage 13 or so editboxes for the columns. No wonder I run out of space.
Scott
At 09 APR 2001 09:55AM Donald Bakke wrote:
Janet,
You can also use Sent_Message(CtrlEntId, "INSERT", RowIndex, Text) to add data to edittables which have reached their max.
At 09 APR 2001 08:27PM Scott, LMS wrote:
Hi Don
It's an old and nasty problem. What happens is: Lines load up into edittable and because we made three new columns in it (for our GST), suddenly things that used to fit, no longer do. So it looks ok, but a few lines have actually been eaten. When the record is updated and saved, the problem is set in concrete - lines missing. Because these lines are used to generate charges, this affects our client's income, which is really bad.
So now I am trying to write a fix. I make the edittable show "pages" of information from the (hidden) textbox, and allow lines on a page to be editted or new lines to be added, and the page and textbox to be updated accordingly. All works really well except for the save part.
So given that the page-edittable is now unbound, and the write/save doesn't actually update anything, I can probably now create a great big update in my commuter event, which includes the validation and handles loading up the columns from the textbox.
I really don't like the idea of loading up 13 boxes even if I name them so that I can load them programmatically.
Janet
(aka Scott, LMS)