Giving up on embedded record editing; back to square one
Posted by mholmes on 23 Jun 2009 in Activity log
Time is running out, and I have too many other projects eating up time, so I've had to abandon embedded record editing "in-place". I've moved most of that code (JavaScript anyway) to a separate file, and I'm now simplifying a little, while trying to retain enough of the substructure to be able to re-implement embedded editing later if I have time. So today:
- Commented out the related table field which was part of the JwDocument object, and replaced it with a multi-line edit (where file links can be added one per line). I might just make a special descendant of the MdhTextField object to handle this in a more elegant way, turning each line into a link.
- Went back over the record saving code, which has now been severely complicated by the provision of possibly-nesting unique ids. The intrusion of ids had broken the original save code.
- Got the save code working, after I eventually realized two things about PHP which were screwing the whole thing up:
- PHP variable names, including
$_REQUESTfields, cannot contain periods. - If you submit them as periods, PHP will simply silently convert them to underscores. This wasted more than an hour of my time.
- PHP variable names, including
- Saving changes to an existing record works fine, in that the correct modified table row is returned.
- REMAINING BUG: Saving a new record results in the save going through, but the returning table not being constructed, for some reason I haven't pinned down yet. It appears to be in the
MdhRecordList::populateFromDb()method. - NEWLY-NOTICED BUG: Date fields which are truncated in form (e.g. 1700 instead of 1700-01-01) are not being saved correctly. This must be a bug in
MdhDateField.
Not enjoying PHP at all. Must take a closer look at Python. I say this every time I find myself writing a PHP project.