Commit Graph
3 Commits
Author SHA1 Message Date
Nicolas Malin 3770cdbb38 Implemented: Keep paginate list query on dynamic refresh (OFBIZ-12261)
Complete previous commit with adding CommonDynamicGrid and CommonDynamicSingle form on common-theme previously forgot
2021-07-07 10:10:27 +02:00
Nicolas Malin 7120cf7d5f Implemented: Keep paginate list query on dynamic refresh (OFBIZ-12261)
When you display a list with search criteria, pagination information and/or sort parameters, if you update an element of this list with a update area, you loose all of them.

Example:

<form name="ListProductMeters" type="list" list-name="productMeters" target="updateProductMeter" paginate-target="ListProductMeters">
    <actions>
       <entity-condition entity-name="ProductMeter">...
    </actions>
    <auto-fields-service service-name="updateProductMeter"/>
    <field name="meterName"><text size="20"/></field>
    <field name="updateButton"><submit/></field>
    <on-event-update-area event-type="paginate"/>
    <on-event-update-area event-type="sort-column"/>
    <on-event-update-area event-type="submit"/>
</form>

Or this works well if you move an next page sort the list.
I realize the same principle for each event which do a modification of element in the list and after refresh it.

I also introduce the possibility to submit a form on modal (for edition) when you press 'enter' that will refresh the origin list.

Last point, the queryString element use to propage pagination state is also forwarded on callback element to keep this on update the list.

Thanks to Gil Portenseigne is help.
2021-07-02 17:27:21 +02:00
Nicolas Malin 38f972a0d0 Improved: Add CommonForms as template pattern configured by theme
(OFBIZ-11335)

Currently on OFBiz we implemented a process to define some different
screen and menu that can be implemented by the theming.
But for the form we have nothing. All style are hard coded on each

    <grid name="ListEntities" ...
      odd-row-style="alternate-row" default-table-style="basic-table hover-bar">

I extend the theming implementation principle to forms element with adding :
 * a new xsd element common-forms (like common-screens)
 * some default form templates to extend :
   * grid CommonSimpleGrid
   * grid CommonBasicGrid
   * form CommonSimpleList
   * form CommonBasicList
   * form CommonInLineEditList
   * form CommonBasicSingle

We can use its like :

    <form name="LayoutDemoList" extends="CommonBasicList"
          extends-resource="component://common/widget/CommonForms.xml"

The main difficulty raise to this task was propage the visualTheme during
the ModelForm intanciation, because we need to load wiget style
(and some other information wanted on the template) on model load in memory.
This is cover by commit 1941a05a34.

Forms present on the screen https://localhost:8443/webtools/control/WebtoolsLayoutDemo
are now extend through with theme.

Finally with this we can extend style form (pagination, header, line and so on ...)
directly by your theme without change the framework.
2020-02-20 14:49:11 +01:00