plomino / Plomino

Powerful and flexible web-based application builder
33 stars 37 forks source link

Enable getting events from subforms #301

Open jean opened 11 years ago

jean commented 11 years ago

At the moment, it's possible to add fields to sets of forms using subforms. This helps for example to maintain relationships between documents by ensuring that they all share reference fields. It would be great if events on subforms were also executed for the forms that contain them. This would enable adding behaviours to sets of forms by adding a subform. To do this, execute e.g. runFormulaScript('form_%s_onsave') for all subforms encountered during rendering (after rendering finishes, of course). Note that Computed on save fields on subforms are not a workaround, as they are executed before the document has been persisted. So for example if an existing document should be re-saved after creating a new document, this re-save cannot be triggered from a field (as the new document is not stored yet).

jean commented 11 years ago

Complementary suggestion: enable adding event objects on forms (in addition to field/hidewhen/action objects). This would make them more visible and easy to copy or move around. The drawback is having many duplicated event objects across forms: easy to get out of sync, hassle to update. When the same event is used across forms, better to put it in a subform.