You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by "Valentina Sirkova (JIRA)" <ji...@apache.org> on 2007/01/04 16:41:27 UTC

[jira] Commented: (OFBIZ-542) Unnecessary extra cells on list based tables

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

Valentina Sirkova commented on OFBIZ-542:
-----------------------------------------

Hi,
The first patch was causing a bug because of this line in it:

if  (!displayHyperlinkFieldIter.hasNext())  {    // if the first while loop of the method renderHeaderRow in ModelForm.java (for example) gets into the break
   listEnd = true;                                                // condition at the very last cell of the list, then the boolean condition will evaluate
   }                                                                       // to false and the extra (header)cell for the fields different from display, display_entity and
                                                                          // hyperlink will not be opened and so a column will be lost.

I have overlooked this situation in my first patch.
My patch ModelForm.patch handles such kinds of situations.
The general idea and solution behind this new patch is the same as the first, with a small fix of the described situation.
Thanks: Valentina

> Unnecessary  extra cells on list based tables
> ---------------------------------------------
>
>                 Key: OFBIZ-542
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-542
>             Project: Apache OFBiz (The Open for Business Project)
>          Issue Type: Bug
>          Components: framework
>            Reporter: Valentina Sirkova
>         Assigned To: David E. Jones
>             Fix For: SVN trunk
>
>         Attachments: ModelForm2.patch
>
>
> Hey guys!
>  I noticed tables that are list - based, have one extra header cell and one extra row cell. The header cell is generated by the methods renderFormatHeaderRowFormCellOpen and renderFormatHeaderRowFormCellClose (HtmlFormRenderer.java). The row cell is generated by the methods renderFormatItemRowFormCellOpen and renderFormatItemRowFormCellClose (HtmlFormRenderer.java). These two cells appear no matter if they should or should not. I browsed through the java implementation of the list form and reached the following conclusion:
> For the extra header cell:
> The method renderFormatHeaderRowFormCellOpen for example, is called in renderHeaderRow(ModelForm.java). As far as I got, there are 3 loops that are responsible for the cells generation.
> The first one visualizes the display,display_entity and hyperlink fields.
> The second one viusalizes the other fields and if there are some they are put in that extra cell.
> But if for example the list has only display,display_entity and hyperlink fields then after the second loop the extra cell is generated though it is not necessary.
> My solution to that problem is to add one boolean variable which is set to true if after the first loop the end of the list is reached. This flags the situation when all of the fields are of type display, display_entity or hyperlink.
>  
> For the extra row cell the situation and solution is the same.
> My patch fixes that problem.
> Thanks: Valentina

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira