Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Here is the solution that I use for now:</p> <p>First some facts:</p> <ol> <li>I will have to cover multiple R/W operations (in particular after every field that changed and looses focus)</li> <li>I always get all data back on each request</li> <li>I have to cover a huge amount of data (field data, store data, labels and configurations)</li> <li>I have to optimize this mess to be performance critical</li> <li>There is no way to store anything in a server side session</li> <li>The forms are nested wildly one into another and may also be split up or exists twice</li> </ol> <p>Here's what I do for now:</p> <p>I drop all associations and decided to go with just one Model extended from a Model with a modified <code>getData</code> method which supports a custom root property like <code>someSubForm</code> (see my example code in the question). The fields are configured as auto so so changes to the reader or writer are needed. Maybe not rock solid but it works.</p> <p>Next big problem are the forms. The form will always try to set each field even if it is in another form. In addition I need to set quite a lot standalone labels. So the default form cannot be used, should I extend? But how and where should I start? After a long look at the source it seems to me that I cannot extend so I decided to create a totally custom form class along with a custom mixin class and custom form.basic class. Why? Because I need to form to look only at the field directly placed into this form, be able to set labels and hand the model instance to any nested form.</p> <p>With that I can now register my own monitor instances with a custom selector each. Oh,I forgot the first thing about my new form; it is bound to a entity by a property which contains the name (like <code>someSubForm</code>). </p> <p>This is used when</p> <ol> <li>A Item is added to the form <ul> <li>any field get a formId </li> <li>any label get a formId (not the labels that are bound to a form)</li> <li>any form get a parentFormId and the instance</li> </ul></li> <li>The Monitor selectors are setted</li> <li>A model is load into a form</li> <li>Data is fetched from a model</li> </ol> <p>Second is that there are now 3 monitor instances</p> <ol> <li>Collect all fields by using the new selector which also looks for the Entity. By that any subform fields get ignored, cause they have their own entity</li> <li>All the same for labels</li> <li>Collect all forms</li> </ol> <p>The third is the modified <code>loadRecord</code> method which uses the new <code>getData()</code> method of the model and sets the specific data to fields, labels and the whole model to any form.</p> <p>All in all I have a performance boost of 800% with that. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload