Subject: Argh! Embedded Editors?
Check out InterfaceMatters.com or Escape Velocity for some great examples of how to use embedded views and editors. Chris provides numerous links to other blogs that demo other variations.
I love/hate these things. In an app I’m doing, I have a form with a two row table - top row = embedded editor, displays only actions, and the lower row is an embedded view. Click a doc, hit an action, doc updates.
BUT…
I need the doc in edit mode because I have some QuerySave code that generates an audit trail. If I do something like:
@Command([EditDocument];“1”);
@SetField(“abc”;“MyValue”);
@PostedCommand([FileSave]);
@PostedCommand([EditDocument];“0”);
Magic…
If I do:
@Command([EditDocument];“1”);
tmp := @Prompt([okcanceledit];“Enter value”;“What value do you want?”;“”);
@SetField(“abc”;tmp);
@PostedCommand([FileSave]);
@PostedCommand([EditDocument];“0”);
NO magic. The Prompt pulls focus away from the selected document and NOTHING gets updated. That only took about a week to figure out.
I’ve also run into numerous problems with order of execution and how it ties to document locking (or not) when you want to execute several actions in sequence in the front end (again because of the audit trail requirement). I had to make each field update a separate ‘edit-on, update, save, edit-off’ events so the document didn’t step on itself.
HTH and hang in - these things really are pretty cool.
Doug