[jira] [Commented] (OFBIZ-7598) Empty header row should not render if list to render in file is empty

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (OFBIZ-7598) Empty header row should not render if list to render in file is empty

Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-7598?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16589145#comment-16589145 ]

Gil Portenseigne commented on OFBIZ-7598:
-----------------------------------------

Hello [~suraj.khurana],

For the ‘empty-form-data-message’, it's ok to add it in the modelForm since it is a parameters defined by the developer in the xml form (declared as private and final like you did, you ensure that no other thread will modify it == thread safe).

But i'm sorry to insist that containsData should not be set in modelForm.

You must understand that ModelForm is a java translation of the xml form that should be immutable after its instantiation to ensure thread safety. In our case the fact that there is data to be displayed is not defined directly in xml form definition, but each time the form is rendered (depending on search criteria for instance), indicates that it should not appear in modelForm.

The way you can do it simpler is by changing {{checkFormDataAndSetHeader}} to return boolean indicating if data is to be displayed, instead of using {{setContainsData}}.

Finally calling {{checkFormDataAndSetHeader}} (may be good to simplify its name) in place of {{getContainsData}} and Voilà :)

I hope i'm a clearer

Thanks for you work

 

> Empty header row should not render if list to render in file is empty
> ---------------------------------------------------------------------
>
>                 Key: OFBIZ-7598
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-7598
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>    Affects Versions: Trunk
>            Reporter: Suraj Khurana
>            Assignee: Suraj Khurana
>            Priority: Major
>             Fix For: Upcoming Branch
>
>         Attachments: Image 002.png, OFBIZ-7598.patch, OFBIZ-7598.patch, OFBIZ-7598.patch, OFBIZ-7598.patch, OFBIZ-7598.patch, OFBIZ-7598.png, OFBIZ-7598_improvement.patch
>
>
> If list inside form doesn't contain data, then header row should not render from better UI perspective and proper message should be shown to user.
> Please refer screenshot for details.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)