ofbiz-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Yong (Jira)" <j...@apache.org>
Subject [jira] [Updated] (OFBIZ-11409) POC for Dynamic Screen Using MVVM
Date Fri, 20 Mar 2020 14:44:00 GMT

     [ https://issues.apache.org/jira/browse/OFBIZ-11409?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

James Yong updated OFBIZ-11409:
-------------------------------
    Description: 
Proof of concept for Model–view–viewmodel (MVVM) in form widgets.

Added data-bind attribute to the field, form and grid tag.

Example 1:

Go to [https://localhost:8443/humanres/control/NewEmployee] and try the following field:
 # First name
 # Middle name
 # Last name

Added Full Name field to demonstrate computed observable/property.

Example 2:

Page at [https://localhost:8443/ordermgr/control/ListQuoteItemsDemo?quoteId=CQ0001] duplicated
the functionality of Quote Items page, but done using data-binding way. 

mbrohl: here is a link to the discussion on the dev mailing list: [https://lists.apache.org/thread.html/r1cddbc8041e5a6559bfad979bc8570581a3d1f662a0f8692c7ee9e59%40%3Cdev.ofbiz.apache.org%3E]

*15th March 2020* 
 Updated the patch with more concrete examples for form and grid.

1) A javascript viewmodel function will be generated for the form / grid widgets when its
data-bind attribute is defined. 

2) First row of the grid is generated by the ofbiz renderer at the server side. Subsequent
rows will be generated by knockout at the browser side.

3) Naming convention of the viewmodel is Vm<Name of Form or Grid>. There is a viewmodel
for the Grid widget at row level; naming convention is RowVm<Name of Grid>.

4) Viewmodel can be extended. See the *.js.ftl files in the patch. 

5) The following javascript files are used:
 * big/big.js - for basic mathematics operation
 * knockout/knockout-3.5.1.js - knockout library
 * knockout/knockout-config.js - extending the library and some code to configure knockout-secure-binding
 * knockout/knockout-secure-binding - allow knockout js to be used with a Content Security
Policy that disables eval and new Function.

 

  was:
Proof of concept for Model–view–viewmodel (MVVM) in form widgets.

Added data-bind attribute to the field, form and grid tag.

Example 1:

Go to [https://localhost:8443/humanres/control/NewEmployee] and try the following field:
 # First name
 # Middle name
 # Last name

Added Full Name field to demonstrate computed observable/property.

Example 2:

Page at [https://localhost:8443/ordermgr/control/ListQuoteItemsDemo?quoteId=CQ0001] duplicated
the functionality of Quote Items page, but done using data-binding way. 

mbrohl: here is a link to the discussion on the dev mailing list: [https://lists.apache.org/thread.html/r1cddbc8041e5a6559bfad979bc8570581a3d1f662a0f8692c7ee9e59%40%3Cdev.ofbiz.apache.org%3E]


> POC for Dynamic Screen Using MVVM
> ---------------------------------
>
>                 Key: OFBIZ-11409
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-11409
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: base
>    Affects Versions: Trunk
>            Reporter: James Yong
>            Priority: Minor
>             Fix For: Trunk
>
>         Attachments: OFBIZ-11409.patch, OFBIZ-11409.patch, OFBIZ-11409.patch
>
>
> Proof of concept for Model–view–viewmodel (MVVM) in form widgets.
> Added data-bind attribute to the field, form and grid tag.
> Example 1:
> Go to [https://localhost:8443/humanres/control/NewEmployee] and try the following field:
>  # First name
>  # Middle name
>  # Last name
> Added Full Name field to demonstrate computed observable/property.
> Example 2:
> Page at [https://localhost:8443/ordermgr/control/ListQuoteItemsDemo?quoteId=CQ0001] duplicated
the functionality of Quote Items page, but done using data-binding way. 
> mbrohl: here is a link to the discussion on the dev mailing list: [https://lists.apache.org/thread.html/r1cddbc8041e5a6559bfad979bc8570581a3d1f662a0f8692c7ee9e59%40%3Cdev.ofbiz.apache.org%3E]
> *15th March 2020* 
>  Updated the patch with more concrete examples for form and grid.
> 1) A javascript viewmodel function will be generated for the form / grid widgets when
its data-bind attribute is defined. 
> 2) First row of the grid is generated by the ofbiz renderer at the server side. Subsequent
rows will be generated by knockout at the browser side.
> 3) Naming convention of the viewmodel is Vm<Name of Form or Grid>. There is a viewmodel
for the Grid widget at row level; naming convention is RowVm<Name of Grid>.
> 4) Viewmodel can be extended. See the *.js.ftl files in the patch. 
> 5) The following javascript files are used:
>  * big/big.js - for basic mathematics operation
>  * knockout/knockout-3.5.1.js - knockout library
>  * knockout/knockout-config.js - extending the library and some code to configure knockout-secure-binding
>  * knockout/knockout-secure-binding - allow knockout js to be used with a Content Security
Policy that disables eval and new Function.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message