You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Jacopo Cappellato <ti...@sastau.it> on 2007/01/08 18:34:09 UTC

Please review the attached patch fro the HtmlFormRenderer class

Please review the attached patch fro the HtmlFormRenderer class:

it simply changes the <td> elements to <th> elements when used in 
headers (for list based forms) and as field names for single forms.

Can I commit it?

Jacopo

Re: Please review the attached patch fro the HtmlFormRenderer class

Posted by Adrian Crum <ad...@hlmksw.com>.
Will do!

David E Jones wrote:

> 
> On Jan 9, 2007, at 8:58 AM, Adrian Crum wrote:
> 
>> One of the things I noticed about this java file is that it doesn't  
>> follow the current OFBiz formatting guidelines. I would like to  
>> reformat the entire file to bring it up to standard. What do you  think?
> 
> 
> If you do anything like this, please try to make it a separate  
> submission from any functional changes.
> 
> -David
> 

Re: Please review the attached patch fro the HtmlFormRenderer class

Posted by David E Jones <jo...@undersunconsulting.com>.
On Jan 9, 2007, at 8:58 AM, Adrian Crum wrote:

> One of the things I noticed about this java file is that it doesn't  
> follow the current OFBiz formatting guidelines. I would like to  
> reformat the entire file to bring it up to standard. What do you  
> think?

If you do anything like this, please try to make it a separate  
submission from any functional changes.

-David


Re: Please review the attached patch fro the HtmlFormRenderer class

Posted by Jacques Le Roux <ja...@les7arts.com>.
Adrian,

From: "Adrian Crum" <ad...@hlmksw.com>
> Jacopo,
> 
> Thanks for taking a look at this! Comments inline:
> 
> Jacopo Cappellato wrote:
> > in your patch there are many lines changed just to suppress unnecessary 
> > blanks; this is fine but it could hide the real mods you did and make 
> > the review a bit more complex... I hope that this will not refrain the 
> > other committers, and most of all David Jones, that is the master of 
> > widgets :-) to read your patch and comment.
> 
> I'm not doing any reformatting manually - my editor must be doing that without 
> my knowledge. I don't know how to make it stop. I apologize for any confusion it 
> causes.

If you are using AnyEdit in Eclipse, you might take a look at Preferences/General/Editors/AnyEditTools

You may also look at http://docs.ofbiz.org/display/OFBADMIN/Coding+Conventions?focusedCommentId=693#comment-693 and sequel

HTH

Jacques

Re: Please review the attached patch fro the HtmlFormRenderer class

Posted by Adrian Crum <ad...@hlmksw.com>.
Jacopo,

Thanks for taking a look at this! Comments inline:

Jacopo Cappellato wrote:
> in your patch there are many lines changed just to suppress unnecessary 
> blanks; this is fine but it could hide the real mods you did and make 
> the review a bit more complex... I hope that this will not refrain the 
> other committers, and most of all David Jones, that is the master of 
> widgets :-) to read your patch and comment.

I'm not doing any reformatting manually - my editor must be doing that without 
my knowledge. I don't know how to make it stop. I apologize for any confusion it 
causes.

One of the things I noticed about this java file is that it doesn't follow the 
current OFBiz formatting guidelines. I would like to reformat the entire file to 
bring it up to standard. What do you think?

> 2) when we have to specify a non-standard style property (such as 
> different align properties for the th elements discussed before) we 
> should move them to a css class and hardcode the class name if one is 
> not passed; for example:
> 
> if (UtilValidate.isNotEmpty(titleStyle)) {
>     buffer.append(" class=\"");
>     buffer.append(titleStyle);
>     buffer.append("\"");
> }
> 
> should be changed to:
> 
> if (UtilValidate.isNotEmpty(titleStyle)) {
>     buffer.append(" class=\"");
>     buffer.append(titleStyle);
>     buffer.append("\"");
> } else {
>     buffer.append(" class=\"defaultTitleStyle\"");
> }

That's exactly the approach I had in mind!

I'll work on this today and get it submitted.

Re: Please review the attached patch fro the HtmlFormRenderer class

Posted by Jacopo Cappellato <ti...@sastau.it>.
Adrian, all,

first of all a very minor point:

in your patch there are many lines changed just to suppress unnecessary 
blanks; this is fine but it could hide the real mods you did and make 
the review a bit more complex... I hope that this will not refrain the 
other committers, and most of all David Jones, that is the master of 
widgets :-) to read your patch and comment.

Second, about the refactoring, here is what I think:

1) it's fine to move all the styling info (as you suggested in your 
comments) to the css
2) when we have to specify a non-standard style property (such as 
different align properties for the th elements discussed before) we 
should move them to a css class and hardcode the class name if one is 
not passed; for example:

if (UtilValidate.isNotEmpty(titleStyle)) {
     buffer.append(" class=\"");
     buffer.append(titleStyle);
     buffer.append("\"");
}

should be changed to:

if (UtilValidate.isNotEmpty(titleStyle)) {
     buffer.append(" class=\"");
     buffer.append(titleStyle);
     buffer.append("\"");
} else {
     buffer.append(" class=\"defaultTitleStyle\"");
}

3) as a general rule, if the html element should be rendered with the 
default OFBiz style, there is no need to specify the hardcoded class as 
done in #2

4) as a future step: we should consider to change the single form html 
from table-based to div-based

Jacopo




Adrian Crum wrote:
> Jacopo,
> 
> I've attached a patch for the HtmlFormRenderer class that has your patch 
> applied. I have also added comments on what changes need to be made to 
> use css classes instead of hard-coded style properties. Search the 
> patched file for "// css upgrade:" to see my comments. If my 
> suggestestions seem okay, then I will create the necessary css classes 
> and update the HtmlFormRenderer.java file.
> 
> I know this is more than what you intended, but my thinking is to fix it 
> all while we're at it.
> 
> -Adrian
> 
> Jacopo Cappellato wrote:
>> Adrian,
>>
>> about combining the two files into one file, for me it would be fine.
>>
>> I'd like to get a bit more feedback before applying this patch, but in 
>> the meantime, if you want to test it, here is the 'correct' one 
>> (attached).
>>
>> Thanks for your help.
>>
>> Jacopo


Re: Please review the attached patch fro the HtmlFormRenderer class

Posted by Adrian Crum <ad...@hlmksw.com>.
Oops, I forgot the patch.

I'll be glad when this Monday is over. *sigh*


Adrian Crum wrote:

> Jacopo,
> 
> I've attached a patch for the HtmlFormRenderer class that has your patch 
> applied. I have also added comments on what changes need to be made to 
> use css classes instead of hard-coded style properties. Search the 
> patched file for "// css upgrade:" to see my comments. If my 
> suggestestions seem okay, then I will create the necessary css classes 
> and update the HtmlFormRenderer.java file.
> 
> I know this is more than what you intended, but my thinking is to fix it 
> all while we're at it.
> 
> -Adrian
> 
> Jacopo Cappellato wrote:
> 
>> Adrian,
>>
>> about combining the two files into one file, for me it would be fine.
>>
>> I'd like to get a bit more feedback before applying this patch, but in 
>> the meantime, if you want to test it, here is the 'correct' one 
>> (attached).
>>
>> Thanks for your help.
>>
>> Jacopo
> 
> 
> 

Re: Please review the attached patch fro the HtmlFormRenderer class

Posted by Adrian Crum <ad...@hlmksw.com>.
Jacopo,

I've attached a patch for the HtmlFormRenderer class that has your patch 
applied. I have also added comments on what changes need to be made to use css 
classes instead of hard-coded style properties. Search the patched file for "// 
css upgrade:" to see my comments. If my suggestestions seem okay, then I will 
create the necessary css classes and update the HtmlFormRenderer.java file.

I know this is more than what you intended, but my thinking is to fix it all 
while we're at it.

-Adrian

Jacopo Cappellato wrote:
> Adrian,
> 
> about combining the two files into one file, for me it would be fine.
> 
> I'd like to get a bit more feedback before applying this patch, but in 
> the meantime, if you want to test it, here is the 'correct' one (attached).
> 
> Thanks for your help.
> 
> Jacopo


Re: Please review the attached patch fro the HtmlFormRenderer class

Posted by Tim Ruppert <ti...@hotwaxmedia.com>.
Yep - I just got the zipped version - I wonder what the issue with  
the .patch is?  Thanks for checking, Jacopo and Adrian.

Cheers,
Tim
--
Tim Ruppert
HotWax Media
http://www.hotwaxmedia.com

o:801.649.6594
f:801.649.6595


On Jan 8, 2007, at 12:31 PM, Jacopo Cappellato wrote:

> Tim,
>
> that's odd.
> Can you get the zipped version attached?
> If so, maybe your mail client is doing something funny with the  
> taxt attachments...
>
> Jacopo
>
>
> Tim Ruppert wrote:
>> Hmm - now that's something to figure out for sure.   The  
>> attachment certainly didn't come thru for me.  I'm on Mac Mail -  
>> what client are you using?
>> Cheers,
>> Tim
>> -- 
>> Tim Ruppert
>> HotWax Media
>> http://www.hotwaxmedia.com
>
> <HtmlFormRenderer.patch.zip>


Re: Please review the attached patch fro the HtmlFormRenderer class

Posted by Jacopo Cappellato <ti...@sastau.it>.
Tim,

that's odd.
Can you get the zipped version attached?
If so, maybe your mail client is doing something funny with the taxt 
attachments...

Jacopo


Tim Ruppert wrote:
> Hmm - now that's something to figure out for sure.   The attachment 
> certainly didn't come thru for me.  I'm on Mac Mail - what client are 
> you using?
> 
> Cheers,
> Tim
> -- 
> Tim Ruppert
> HotWax Media
> http://www.hotwaxmedia.com
> 


Re: Please review the attached patch fro the HtmlFormRenderer class

Posted by Adrian Crum <ad...@hlmksw.com>.
Mozilla.

Tim Ruppert wrote:
> Hmm - now that's something to figure out for sure.   The attachment  
> certainly didn't come thru for me.  I'm on Mac Mail - what client are  
> you using?
> 
> Cheers,
> Tim
> -- 
> Tim Ruppert
> HotWax Media
> http://www.hotwaxmedia.com
> 
> o:801.649.6594
> f:801.649.6595
> 
> 
> On Jan 8, 2007, at 12:17 PM, Adrian Crum wrote:
> 
>> It was attached to my copy.
>>
>>
>> Tim Ruppert wrote:
>>
>>> Nothing attached my friend.
>>> -- 
>>> Tim Ruppert
>>> HotWax Media
>>> http://www.hotwaxmedia.com
>>> o:801.649.6594
>>> f:801.649.6595
>>> On Jan 8, 2007, at 12:10 PM, Jacopo Cappellato wrote:
>>>
>>>> Adrian,
>>>>
>>>> about combining the two files into one file, for me it would be  fine.
>>>>
>>>> I'd like to get a bit more feedback before applying this patch,  
>>>> but  in the meantime, if you want to test it, here is the  'correct' 
>>>> one  (attached).
>>>>
>>>> Thanks for your help.
>>>>
>>>> Jacopo
>>>>
>>>>
>>>> Adrian Crum wrote:
>>>>
>>>>> Jacopo,
>>>>> I would like to help with this. I could spend some time going   
>>>>> through the HtmlFormRenderer.java file and testing the changes.
>>>>> Did you see the comments made earlier about combining the two  css  
>>>>> files into one file? If we could get that committed, then I  could  
>>>>> apply the necessary patches to the single file.
>>>>> -Adrian
>>>>> Jacopo Cappellato wrote:
>>>>>
>>>>>> Adrian, Chris,
>>>>>>
>>>>>> I agree with you that the align attributes should be removed.
>>>>>> However, since there were already many of them in that file,  
>>>>>> this  would require a bit more of work (that must be done but  
>>>>>> maybe at  a later task) on the css styles definition.
>>>>>>
>>>>>> Jacopo
>>>>>>
>>>>>>
>>>>>> Chris Howe wrote:
>>>>>>
>>>>>>> Won't the lines that follow the first change:
>>>>>>>
>>>>>>>         if (UtilValidate.isNotEmpty(areaStyle)) {
>>>>>>>             buffer.append(" class=\"");
>>>>>>>             buffer.append(areaStyle);
>>>>>>>             buffer.append("\"");
>>>>>>>         }
>>>>>>> handle any additional styling information, including
>>>>>>> text alignment (ie in css: text-align: right;)? And
>>>>>>> then locale specific css can be added to handle
>>>>>>> Adrian's concern. Does the th align=\"right\" simply
>>>>>>> provide a default alignment that the css will be able
>>>>>>> to override or will the attributes for the <th> tag
>>>>>>> take priority over css?  I forget the answer at the
>>>>>>> moment.
>>>>>>>
>>>>>>> --- Adrian Crum <ad...@hlmksw.com> wrote:
>>>>>>>
>>>>>>>> Oops, ight-to-Left languages would want it
>>>>>>>> RIGHT-aligned.
>>>>>>>>
>>>>>>>> Adrian Crum wrote:
>>>>>>>>
>>>>>>>>> It would be nice if the 'align' property was
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> removed too. Right-to-Left
>>>>>>>>
>>>>>>>>> languages would want it left-aligned.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Jacopo Cappellato wrote:
>>>>>>>>>
>>>>>>>>>> Please review the attached patch fro the
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> HtmlFormRenderer class:
>>>>>>>>
>>>>>>>>>> it simply changes the <td> elements to <th>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> elements when used in
>>>>>>>>
>>>>>>>>>> headers (for list based forms) and as field names
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> for single forms.
>>>>>>>>
>>>>>>>>>> Can I commit it?
>>>>>>>>>>
>>>>>>>>>> Jacopo
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>> ----------------------------------------------------------------- 
>>>>>>> -- -----
>>>>>>>
>>>>>>>>>> Index:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java
>>>>>>> ================================================================= ==
>>>>>>>
>>>>>>>>>> ---
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java
>>>>>>>
>>>>>>>>
>>>>>>>>>> (revision 494101)
>>>>>>>>>> +++
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java
>>>>>>>
>>>>>>>>
>>>>>>>>>> (working copy)
>>>>>>>>>> @@ -1170,7 +1170,7 @@
>>>>>>>>>>       * @see
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> org.ofbiz.widget.form.FormStringRenderer#renderFormatHeaderRowCel 
>>>>>>> lO pen(java.lang.StringBuffer,
>>>>>>>
>>>>>>>>>> java.util.Map, org.ofbiz.widget.form.ModelForm,   
>>>>>>>>>> org.ofbiz.widget.form.ModelFormField)
>>>>>>>>>>       */
>>>>>>>>>>      public void
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> renderFormatHeaderRowCellOpen(StringBuffer buffer,
>>>>>>>>
>>>>>>>>>> Map context, ModelForm modelForm, ModelFormField
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> modelFormField) {
>>>>>>>>
>>>>>>>>>> -        buffer.append("<td");
>>>>>>>>>> +        buffer.append("<th align=\"right\"");
>>>>>>>>>>          String areaStyle =
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> modelFormField.getTitleAreaStyle();
>>>>>>>>
>>>>>>>>>>          if (UtilValidate.isNotEmpty(areaStyle))
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> {
>>>>>>>>
>>>>>>>>>>              buffer.append(" class=\"");
>>>>>>>>>> @@ -1185,12 +1185,12 @@
>>>>>>>>>>       * @see
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> org.ofbiz.widget.form.FormStringRenderer#renderFormatHeaderRowCel 
>>>>>>> lC lose(java.lang.StringBuffer,
>>>>>>>
>>>>>>>>>> java.util.Map, org.ofbiz.widget.form.ModelForm,   
>>>>>>>>>> org.ofbiz.widget.form.ModelFormField)
>>>>>>>>>>       */
>>>>>>>>>>      public void
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> renderFormatHeaderRowCellClose(StringBuffer buffer,
>>>>>>>>
>>>>>>>>>> Map context, ModelForm modelForm, ModelFormField
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> modelFormField) {
>>>>>>>>
>>>>>>>>>> -        buffer.append("</td>");
>>>>>>>>>> +        buffer.append("</th>");
>>>>>>>>>>          this.appendWhitespace(buffer);
>>>>>>>>>>      }
>>>>>>>>>>       public void
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> renderFormatHeaderRowFormCellOpen(StringBuffer
>>>>>>>>
>>>>>>>>>> buffer, Map context, ModelForm modelForm) {
>>>>>>>>>> -        buffer.append("<td align=\"center\"");
>>>>>>>>>> +        buffer.append("<th align=\"center\"");
>>>>>>>>>>          String areaStyle =
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> modelForm.getFormTitleAreaStyle();
>>>>>>>>
>>>>>>>>>>          if (UtilValidate.isNotEmpty(areaStyle))
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> {
>>>>>>>>
>>>>>>>>>>              buffer.append(" class=\"");
>>>>>>>>>> @@ -1205,7 +1205,7 @@
>>>>>>>>>>       * @see
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> org.ofbiz.widget.form.FormStringRenderer#renderFormatHeaderRowFor 
>>>>>>> mC ellClose(java.lang.StringBuffer,
>>>>>>>
>>>>>>>>>> java.util.Map, org.ofbiz.widget.form.ModelForm)
>>>>>>>>>>       */
>>>>>>>>>>      public void
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> renderFormatHeaderRowFormCellClose(StringBuffer
>>>>>>>>
>>>>>>>>>> buffer, Map context, ModelForm modelForm) {
>>>>>>>>>> -        buffer.append("</td>");
>>>>>>>>>> +        buffer.append("</th>");
>>>>>>>>>>          this.appendWhitespace(buffer);
>>>>>>>>>>      }
>>>>>>>>>>  @@ -1348,7 +1348,7 @@
>>>>>>>>>>       * @see
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> org.ofbiz.widget.form.FormStringRenderer#renderFormatFieldRowTitl 
>>>>>>> eC ellOpen(java.lang.StringBuffer,
>>>>>>>
>>>>>>>>>> java.util.Map,
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> org.ofbiz.widget.form.ModelFormField)
>>>>>>>>
>>>>>>>>>>       */
>>>>>>>>>>      public void
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> renderFormatFieldRowTitleCellOpen(StringBuffer
>>>>>>>>
>>>>>>>>>> buffer, Map context, ModelFormField
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> modelFormField) {
>>>>>>>>
>>>>>>>>>> -        buffer.append("<td width=\"20%\"
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> align=\"right\"");
>>>>>>>>
>>>>>>>>>> +        buffer.append("<th width=\"20%\"
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> align=\"right\"");
>>>>>>>>
>>>>>>>>>>          String areaStyle =
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> modelFormField.getTitleAreaStyle();
>>>>>>>>
>>>>>>>>>>          if (UtilValidate.isNotEmpty(areaStyle))
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> {
>>>>>>>>
>>>>>>>>>>              buffer.append(" class=\"");
>>>>>>>>>> @@ -1363,7 +1363,7 @@
>>>>>>>>>>       * @see
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> org.ofbiz.widget.form.FormStringRenderer#renderFormatFieldRowTitl 
>>>>>>> eC ellClose(java.lang.StringBuffer,
>>>>>>>
>>>>>>>>>> java.util.Map,
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> org.ofbiz.widget.form.ModelFormField)
>>>>>>>>
>>>>>>>>>>       */
>>>>>>>>>>      public void
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> renderFormatFieldRowTitleCellClose(StringBuffer
>>>>>>>>
>>>>>>>>>> buffer, Map context, ModelFormField
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> modelFormField) {
>>>>>>>>
>>>>>>>>>> -        buffer.append("</td>");
>>>>>>>>>> +        buffer.append("</th>");
>>>>>>>>>>          this.appendWhitespace(buffer);
>>>>>>>>>>      }
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>
>>>>>>
>>>>
>>>> Index: framework/widget/src/org/ofbiz/widget/html/  
>>>> HtmlFormRenderer.java
>>>> ===================================================================
>>>> --- framework/widget/src/org/ofbiz/widget/html/  
>>>> HtmlFormRenderer.java    (revision 494101)
>>>> +++ framework/widget/src/org/ofbiz/widget/html/  
>>>> HtmlFormRenderer.java    (working copy)
>>>> @@ -1170,7 +1170,7 @@
>>>>       * @see   
>>>> org.ofbiz.widget.form.FormStringRenderer#renderFormatHeaderRowCellOp 
>>>> en (java.lang.StringBuffer, java.util.Map,   
>>>> org.ofbiz.widget.form.ModelForm,  org.ofbiz.widget.form.ModelFormField)
>>>>       */
>>>>      public void renderFormatHeaderRowCellOpen(StringBuffer  
>>>> buffer,  Map context, ModelForm modelForm, ModelFormField  
>>>> modelFormField) {
>>>> -        buffer.append("<td");
>>>> +        buffer.append("<th align=\"left\"");
>>>>          String areaStyle = modelFormField.getTitleAreaStyle();
>>>>          if (UtilValidate.isNotEmpty(areaStyle)) {
>>>>              buffer.append(" class=\"");
>>>> @@ -1185,12 +1185,12 @@
>>>>       * @see   
>>>> org.ofbiz.widget.form.FormStringRenderer#renderFormatHeaderRowCellCl 
>>>> os e(java.lang.StringBuffer, java.util.Map,   
>>>> org.ofbiz.widget.form.ModelForm,  org.ofbiz.widget.form.ModelFormField)
>>>>       */
>>>>      public void renderFormatHeaderRowCellClose(StringBuffer   
>>>> buffer, Map context, ModelForm modelForm, ModelFormField   
>>>> modelFormField) {
>>>> -        buffer.append("</td>");
>>>> +        buffer.append("</th>");
>>>>          this.appendWhitespace(buffer);
>>>>      }
>>>>
>>>>      public void renderFormatHeaderRowFormCellOpen(StringBuffer   
>>>> buffer, Map context, ModelForm modelForm) {
>>>> -        buffer.append("<td align=\"center\"");
>>>> +        buffer.append("<th align=\"center\"");
>>>>          String areaStyle = modelForm.getFormTitleAreaStyle();
>>>>          if (UtilValidate.isNotEmpty(areaStyle)) {
>>>>              buffer.append(" class=\"");
>>>> @@ -1205,7 +1205,7 @@
>>>>       * @see   
>>>> org.ofbiz.widget.form.FormStringRenderer#renderFormatHeaderRowFormCe 
>>>> ll Close(java.lang.StringBuffer, java.util.Map,   
>>>> org.ofbiz.widget.form.ModelForm)
>>>>       */
>>>>      public void renderFormatHeaderRowFormCellClose(StringBuffer   
>>>> buffer, Map context, ModelForm modelForm) {
>>>> -        buffer.append("</td>");
>>>> +        buffer.append("</th>");
>>>>          this.appendWhitespace(buffer);
>>>>      }
>>>>
>>>> @@ -1348,7 +1348,7 @@
>>>>       * @see   
>>>> org.ofbiz.widget.form.FormStringRenderer#renderFormatFieldRowTitleCe 
>>>> ll Open(java.lang.StringBuffer, java.util.Map,   
>>>> org.ofbiz.widget.form.ModelFormField)
>>>>       */
>>>>      public void renderFormatFieldRowTitleCellOpen(StringBuffer   
>>>> buffer, Map context, ModelFormField modelFormField) {
>>>> -        buffer.append("<td width=\"20%\" align=\"right\"");
>>>> +        buffer.append("<th width=\"20%\" align=\"right\"");
>>>>          String areaStyle = modelFormField.getTitleAreaStyle();
>>>>          if (UtilValidate.isNotEmpty(areaStyle)) {
>>>>              buffer.append(" class=\"");
>>>> @@ -1363,7 +1363,7 @@
>>>>       * @see   
>>>> org.ofbiz.widget.form.FormStringRenderer#renderFormatFieldRowTitleCe 
>>>> ll Close(java.lang.StringBuffer, java.util.Map,   
>>>> org.ofbiz.widget.form.ModelFormField)
>>>>       */
>>>>      public void renderFormatFieldRowTitleCellClose(StringBuffer   
>>>> buffer, Map context, ModelFormField modelFormField) {
>>>> -        buffer.append("</td>");
>>>> +        buffer.append("</th>");
>>>>          this.appendWhitespace(buffer);
>>>>      }
>>>>
> 
> 

Re: Please review the attached patch fro the HtmlFormRenderer class

Posted by Tim Ruppert <ti...@hotwaxmedia.com>.
Hmm - now that's something to figure out for sure.   The attachment  
certainly didn't come thru for me.  I'm on Mac Mail - what client are  
you using?

Cheers,
Tim
--
Tim Ruppert
HotWax Media
http://www.hotwaxmedia.com

o:801.649.6594
f:801.649.6595


On Jan 8, 2007, at 12:17 PM, Adrian Crum wrote:

> It was attached to my copy.
>
>
> Tim Ruppert wrote:
>
>> Nothing attached my friend.
>> -- 
>> Tim Ruppert
>> HotWax Media
>> http://www.hotwaxmedia.com
>> o:801.649.6594
>> f:801.649.6595
>> On Jan 8, 2007, at 12:10 PM, Jacopo Cappellato wrote:
>>> Adrian,
>>>
>>> about combining the two files into one file, for me it would be  
>>> fine.
>>>
>>> I'd like to get a bit more feedback before applying this patch,  
>>> but  in the meantime, if you want to test it, here is the  
>>> 'correct' one  (attached).
>>>
>>> Thanks for your help.
>>>
>>> Jacopo
>>>
>>>
>>> Adrian Crum wrote:
>>>
>>>> Jacopo,
>>>> I would like to help with this. I could spend some time going   
>>>> through the HtmlFormRenderer.java file and testing the changes.
>>>> Did you see the comments made earlier about combining the two  
>>>> css  files into one file? If we could get that committed, then I  
>>>> could  apply the necessary patches to the single file.
>>>> -Adrian
>>>> Jacopo Cappellato wrote:
>>>>
>>>>> Adrian, Chris,
>>>>>
>>>>> I agree with you that the align attributes should be removed.
>>>>> However, since there were already many of them in that file,  
>>>>> this  would require a bit more of work (that must be done but  
>>>>> maybe at  a later task) on the css styles definition.
>>>>>
>>>>> Jacopo
>>>>>
>>>>>
>>>>> Chris Howe wrote:
>>>>>
>>>>>> Won't the lines that follow the first change:
>>>>>>
>>>>>>         if (UtilValidate.isNotEmpty(areaStyle)) {
>>>>>>             buffer.append(" class=\"");
>>>>>>             buffer.append(areaStyle);
>>>>>>             buffer.append("\"");
>>>>>>         }
>>>>>> handle any additional styling information, including
>>>>>> text alignment (ie in css: text-align: right;)? And
>>>>>> then locale specific css can be added to handle
>>>>>> Adrian's concern. Does the th align=\"right\" simply
>>>>>> provide a default alignment that the css will be able
>>>>>> to override or will the attributes for the <th> tag
>>>>>> take priority over css?  I forget the answer at the
>>>>>> moment.
>>>>>>
>>>>>> --- Adrian Crum <ad...@hlmksw.com> wrote:
>>>>>>
>>>>>>> Oops, ight-to-Left languages would want it
>>>>>>> RIGHT-aligned.
>>>>>>>
>>>>>>> Adrian Crum wrote:
>>>>>>>
>>>>>>>> It would be nice if the 'align' property was
>>>>>>>
>>>>>>>
>>>>>>> removed too. Right-to-Left
>>>>>>>
>>>>>>>> languages would want it left-aligned.
>>>>>>>>
>>>>>>>>
>>>>>>>> Jacopo Cappellato wrote:
>>>>>>>>
>>>>>>>>> Please review the attached patch fro the
>>>>>>>
>>>>>>>
>>>>>>> HtmlFormRenderer class:
>>>>>>>
>>>>>>>>> it simply changes the <td> elements to <th>
>>>>>>>
>>>>>>>
>>>>>>> elements when used in
>>>>>>>
>>>>>>>>> headers (for list based forms) and as field names
>>>>>>>
>>>>>>>
>>>>>>> for single forms.
>>>>>>>
>>>>>>>>> Can I commit it?
>>>>>>>>>
>>>>>>>>> Jacopo
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>> ----------------------------------------------------------------- 
>>>>>> -- -----
>>>>>>
>>>>>>>>> Index:
>>>>>>
>>>>>>
>>>>>> framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java
>>>>>> ================================================================= 
>>>>>> ==
>>>>>>
>>>>>>>>> ---
>>>>>>
>>>>>>
>>>>>> framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java
>>>>>>
>>>>>>>
>>>>>>>>> (revision 494101)
>>>>>>>>> +++
>>>>>>
>>>>>>
>>>>>> framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java
>>>>>>
>>>>>>>
>>>>>>>>> (working copy)
>>>>>>>>> @@ -1170,7 +1170,7 @@
>>>>>>>>>       * @see
>>>>>>
>>>>>>
>>>>>> org.ofbiz.widget.form.FormStringRenderer#renderFormatHeaderRowCel 
>>>>>> lO pen(java.lang.StringBuffer,
>>>>>>
>>>>>>>>> java.util.Map, org.ofbiz.widget.form.ModelForm,   
>>>>>>>>> org.ofbiz.widget.form.ModelFormField)
>>>>>>>>>       */
>>>>>>>>>      public void
>>>>>>>
>>>>>>>
>>>>>>> renderFormatHeaderRowCellOpen(StringBuffer buffer,
>>>>>>>
>>>>>>>>> Map context, ModelForm modelForm, ModelFormField
>>>>>>>
>>>>>>>
>>>>>>> modelFormField) {
>>>>>>>
>>>>>>>>> -        buffer.append("<td");
>>>>>>>>> +        buffer.append("<th align=\"right\"");
>>>>>>>>>          String areaStyle =
>>>>>>>
>>>>>>>
>>>>>>> modelFormField.getTitleAreaStyle();
>>>>>>>
>>>>>>>>>          if (UtilValidate.isNotEmpty(areaStyle))
>>>>>>>
>>>>>>>
>>>>>>> {
>>>>>>>
>>>>>>>>>              buffer.append(" class=\"");
>>>>>>>>> @@ -1185,12 +1185,12 @@
>>>>>>>>>       * @see
>>>>>>
>>>>>>
>>>>>> org.ofbiz.widget.form.FormStringRenderer#renderFormatHeaderRowCel 
>>>>>> lC lose(java.lang.StringBuffer,
>>>>>>
>>>>>>>>> java.util.Map, org.ofbiz.widget.form.ModelForm,   
>>>>>>>>> org.ofbiz.widget.form.ModelFormField)
>>>>>>>>>       */
>>>>>>>>>      public void
>>>>>>>
>>>>>>>
>>>>>>> renderFormatHeaderRowCellClose(StringBuffer buffer,
>>>>>>>
>>>>>>>>> Map context, ModelForm modelForm, ModelFormField
>>>>>>>
>>>>>>>
>>>>>>> modelFormField) {
>>>>>>>
>>>>>>>>> -        buffer.append("</td>");
>>>>>>>>> +        buffer.append("</th>");
>>>>>>>>>          this.appendWhitespace(buffer);
>>>>>>>>>      }
>>>>>>>>>       public void
>>>>>>>
>>>>>>>
>>>>>>> renderFormatHeaderRowFormCellOpen(StringBuffer
>>>>>>>
>>>>>>>>> buffer, Map context, ModelForm modelForm) {
>>>>>>>>> -        buffer.append("<td align=\"center\"");
>>>>>>>>> +        buffer.append("<th align=\"center\"");
>>>>>>>>>          String areaStyle =
>>>>>>>
>>>>>>>
>>>>>>> modelForm.getFormTitleAreaStyle();
>>>>>>>
>>>>>>>>>          if (UtilValidate.isNotEmpty(areaStyle))
>>>>>>>
>>>>>>>
>>>>>>> {
>>>>>>>
>>>>>>>>>              buffer.append(" class=\"");
>>>>>>>>> @@ -1205,7 +1205,7 @@
>>>>>>>>>       * @see
>>>>>>
>>>>>>
>>>>>> org.ofbiz.widget.form.FormStringRenderer#renderFormatHeaderRowFor 
>>>>>> mC ellClose(java.lang.StringBuffer,
>>>>>>
>>>>>>>>> java.util.Map, org.ofbiz.widget.form.ModelForm)
>>>>>>>>>       */
>>>>>>>>>      public void
>>>>>>>
>>>>>>>
>>>>>>> renderFormatHeaderRowFormCellClose(StringBuffer
>>>>>>>
>>>>>>>>> buffer, Map context, ModelForm modelForm) {
>>>>>>>>> -        buffer.append("</td>");
>>>>>>>>> +        buffer.append("</th>");
>>>>>>>>>          this.appendWhitespace(buffer);
>>>>>>>>>      }
>>>>>>>>>  @@ -1348,7 +1348,7 @@
>>>>>>>>>       * @see
>>>>>>
>>>>>>
>>>>>> org.ofbiz.widget.form.FormStringRenderer#renderFormatFieldRowTitl 
>>>>>> eC ellOpen(java.lang.StringBuffer,
>>>>>>
>>>>>>>>> java.util.Map,
>>>>>>>
>>>>>>>
>>>>>>> org.ofbiz.widget.form.ModelFormField)
>>>>>>>
>>>>>>>>>       */
>>>>>>>>>      public void
>>>>>>>
>>>>>>>
>>>>>>> renderFormatFieldRowTitleCellOpen(StringBuffer
>>>>>>>
>>>>>>>>> buffer, Map context, ModelFormField
>>>>>>>
>>>>>>>
>>>>>>> modelFormField) {
>>>>>>>
>>>>>>>>> -        buffer.append("<td width=\"20%\"
>>>>>>>
>>>>>>>
>>>>>>> align=\"right\"");
>>>>>>>
>>>>>>>>> +        buffer.append("<th width=\"20%\"
>>>>>>>
>>>>>>>
>>>>>>> align=\"right\"");
>>>>>>>
>>>>>>>>>          String areaStyle =
>>>>>>>
>>>>>>>
>>>>>>> modelFormField.getTitleAreaStyle();
>>>>>>>
>>>>>>>>>          if (UtilValidate.isNotEmpty(areaStyle))
>>>>>>>
>>>>>>>
>>>>>>> {
>>>>>>>
>>>>>>>>>              buffer.append(" class=\"");
>>>>>>>>> @@ -1363,7 +1363,7 @@
>>>>>>>>>       * @see
>>>>>>
>>>>>>
>>>>>> org.ofbiz.widget.form.FormStringRenderer#renderFormatFieldRowTitl 
>>>>>> eC ellClose(java.lang.StringBuffer,
>>>>>>
>>>>>>>>> java.util.Map,
>>>>>>>
>>>>>>>
>>>>>>> org.ofbiz.widget.form.ModelFormField)
>>>>>>>
>>>>>>>>>       */
>>>>>>>>>      public void
>>>>>>>
>>>>>>>
>>>>>>> renderFormatFieldRowTitleCellClose(StringBuffer
>>>>>>>
>>>>>>>>> buffer, Map context, ModelFormField
>>>>>>>
>>>>>>>
>>>>>>> modelFormField) {
>>>>>>>
>>>>>>>>> -        buffer.append("</td>");
>>>>>>>>> +        buffer.append("</th>");
>>>>>>>>>          this.appendWhitespace(buffer);
>>>>>>>>>      }
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>
>>>>>
>>>
>>> Index: framework/widget/src/org/ofbiz/widget/html/  
>>> HtmlFormRenderer.java
>>> ===================================================================
>>> --- framework/widget/src/org/ofbiz/widget/html/  
>>> HtmlFormRenderer.java    (revision 494101)
>>> +++ framework/widget/src/org/ofbiz/widget/html/  
>>> HtmlFormRenderer.java    (working copy)
>>> @@ -1170,7 +1170,7 @@
>>>       * @see   
>>> org.ofbiz.widget.form.FormStringRenderer#renderFormatHeaderRowCellOp 
>>> en (java.lang.StringBuffer, java.util.Map,   
>>> org.ofbiz.widget.form.ModelForm,  
>>> org.ofbiz.widget.form.ModelFormField)
>>>       */
>>>      public void renderFormatHeaderRowCellOpen(StringBuffer  
>>> buffer,  Map context, ModelForm modelForm, ModelFormField  
>>> modelFormField) {
>>> -        buffer.append("<td");
>>> +        buffer.append("<th align=\"left\"");
>>>          String areaStyle = modelFormField.getTitleAreaStyle();
>>>          if (UtilValidate.isNotEmpty(areaStyle)) {
>>>              buffer.append(" class=\"");
>>> @@ -1185,12 +1185,12 @@
>>>       * @see   
>>> org.ofbiz.widget.form.FormStringRenderer#renderFormatHeaderRowCellCl 
>>> os e(java.lang.StringBuffer, java.util.Map,   
>>> org.ofbiz.widget.form.ModelForm,  
>>> org.ofbiz.widget.form.ModelFormField)
>>>       */
>>>      public void renderFormatHeaderRowCellClose(StringBuffer   
>>> buffer, Map context, ModelForm modelForm, ModelFormField   
>>> modelFormField) {
>>> -        buffer.append("</td>");
>>> +        buffer.append("</th>");
>>>          this.appendWhitespace(buffer);
>>>      }
>>>
>>>      public void renderFormatHeaderRowFormCellOpen(StringBuffer   
>>> buffer, Map context, ModelForm modelForm) {
>>> -        buffer.append("<td align=\"center\"");
>>> +        buffer.append("<th align=\"center\"");
>>>          String areaStyle = modelForm.getFormTitleAreaStyle();
>>>          if (UtilValidate.isNotEmpty(areaStyle)) {
>>>              buffer.append(" class=\"");
>>> @@ -1205,7 +1205,7 @@
>>>       * @see   
>>> org.ofbiz.widget.form.FormStringRenderer#renderFormatHeaderRowFormCe 
>>> ll Close(java.lang.StringBuffer, java.util.Map,   
>>> org.ofbiz.widget.form.ModelForm)
>>>       */
>>>      public void renderFormatHeaderRowFormCellClose(StringBuffer   
>>> buffer, Map context, ModelForm modelForm) {
>>> -        buffer.append("</td>");
>>> +        buffer.append("</th>");
>>>          this.appendWhitespace(buffer);
>>>      }
>>>
>>> @@ -1348,7 +1348,7 @@
>>>       * @see   
>>> org.ofbiz.widget.form.FormStringRenderer#renderFormatFieldRowTitleCe 
>>> ll Open(java.lang.StringBuffer, java.util.Map,   
>>> org.ofbiz.widget.form.ModelFormField)
>>>       */
>>>      public void renderFormatFieldRowTitleCellOpen(StringBuffer   
>>> buffer, Map context, ModelFormField modelFormField) {
>>> -        buffer.append("<td width=\"20%\" align=\"right\"");
>>> +        buffer.append("<th width=\"20%\" align=\"right\"");
>>>          String areaStyle = modelFormField.getTitleAreaStyle();
>>>          if (UtilValidate.isNotEmpty(areaStyle)) {
>>>              buffer.append(" class=\"");
>>> @@ -1363,7 +1363,7 @@
>>>       * @see   
>>> org.ofbiz.widget.form.FormStringRenderer#renderFormatFieldRowTitleCe 
>>> ll Close(java.lang.StringBuffer, java.util.Map,   
>>> org.ofbiz.widget.form.ModelFormField)
>>>       */
>>>      public void renderFormatFieldRowTitleCellClose(StringBuffer   
>>> buffer, Map context, ModelFormField modelFormField) {
>>> -        buffer.append("</td>");
>>> +        buffer.append("</th>");
>>>          this.appendWhitespace(buffer);
>>>      }
>>>


Re: Please review the attached patch fro the HtmlFormRenderer class

Posted by Adrian Crum <ad...@hlmksw.com>.
It was attached to my copy.


Tim Ruppert wrote:

> Nothing attached my friend.
> -- 
> Tim Ruppert
> HotWax Media
> http://www.hotwaxmedia.com
> 
> o:801.649.6594
> f:801.649.6595
> 
> 
> On Jan 8, 2007, at 12:10 PM, Jacopo Cappellato wrote:
> 
>> Adrian,
>>
>> about combining the two files into one file, for me it would be fine.
>>
>> I'd like to get a bit more feedback before applying this patch, but  
>> in the meantime, if you want to test it, here is the 'correct' one  
>> (attached).
>>
>> Thanks for your help.
>>
>> Jacopo
>>
>>
>> Adrian Crum wrote:
>>
>>> Jacopo,
>>> I would like to help with this. I could spend some time going  
>>> through the HtmlFormRenderer.java file and testing the changes.
>>> Did you see the comments made earlier about combining the two css  
>>> files into one file? If we could get that committed, then I could  
>>> apply the necessary patches to the single file.
>>> -Adrian
>>> Jacopo Cappellato wrote:
>>>
>>>> Adrian, Chris,
>>>>
>>>> I agree with you that the align attributes should be removed.
>>>> However, since there were already many of them in that file, this  
>>>> would require a bit more of work (that must be done but maybe at  a 
>>>> later task) on the css styles definition.
>>>>
>>>> Jacopo
>>>>
>>>>
>>>> Chris Howe wrote:
>>>>
>>>>> Won't the lines that follow the first change:
>>>>>
>>>>>         if (UtilValidate.isNotEmpty(areaStyle)) {
>>>>>             buffer.append(" class=\"");
>>>>>             buffer.append(areaStyle);
>>>>>             buffer.append("\"");
>>>>>         }
>>>>> handle any additional styling information, including
>>>>> text alignment (ie in css: text-align: right;)? And
>>>>> then locale specific css can be added to handle
>>>>> Adrian's concern. Does the th align=\"right\" simply
>>>>> provide a default alignment that the css will be able
>>>>> to override or will the attributes for the <th> tag
>>>>> take priority over css?  I forget the answer at the
>>>>> moment.
>>>>>
>>>>> --- Adrian Crum <ad...@hlmksw.com> wrote:
>>>>>
>>>>>> Oops, ight-to-Left languages would want it
>>>>>> RIGHT-aligned.
>>>>>>
>>>>>> Adrian Crum wrote:
>>>>>>
>>>>>>> It would be nice if the 'align' property was
>>>>>>
>>>>>>
>>>>>> removed too. Right-to-Left
>>>>>>
>>>>>>> languages would want it left-aligned.
>>>>>>>
>>>>>>>
>>>>>>> Jacopo Cappellato wrote:
>>>>>>>
>>>>>>>> Please review the attached patch fro the
>>>>>>
>>>>>>
>>>>>> HtmlFormRenderer class:
>>>>>>
>>>>>>>> it simply changes the <td> elements to <th>
>>>>>>
>>>>>>
>>>>>> elements when used in
>>>>>>
>>>>>>>> headers (for list based forms) and as field names
>>>>>>
>>>>>>
>>>>>> for single forms.
>>>>>>
>>>>>>>> Can I commit it?
>>>>>>>>
>>>>>>>> Jacopo
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>> ------------------------------------------------------------------- 
>>>>> -----
>>>>>
>>>>>>>> Index:
>>>>>
>>>>>
>>>>> framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java
>>>>> ===================================================================
>>>>>
>>>>>>>> ---
>>>>>
>>>>>
>>>>> framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java
>>>>>
>>>>>>
>>>>>>>> (revision 494101)
>>>>>>>> +++
>>>>>
>>>>>
>>>>> framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java
>>>>>
>>>>>>
>>>>>>>> (working copy)
>>>>>>>> @@ -1170,7 +1170,7 @@
>>>>>>>>       * @see
>>>>>
>>>>>
>>>>> org.ofbiz.widget.form.FormStringRenderer#renderFormatHeaderRowCellO 
>>>>> pen(java.lang.StringBuffer,
>>>>>
>>>>>>>> java.util.Map, org.ofbiz.widget.form.ModelForm,  
>>>>>>>> org.ofbiz.widget.form.ModelFormField)
>>>>>>>>       */
>>>>>>>>      public void
>>>>>>
>>>>>>
>>>>>> renderFormatHeaderRowCellOpen(StringBuffer buffer,
>>>>>>
>>>>>>>> Map context, ModelForm modelForm, ModelFormField
>>>>>>
>>>>>>
>>>>>> modelFormField) {
>>>>>>
>>>>>>>> -        buffer.append("<td");
>>>>>>>> +        buffer.append("<th align=\"right\"");
>>>>>>>>          String areaStyle =
>>>>>>
>>>>>>
>>>>>> modelFormField.getTitleAreaStyle();
>>>>>>
>>>>>>>>          if (UtilValidate.isNotEmpty(areaStyle))
>>>>>>
>>>>>>
>>>>>> {
>>>>>>
>>>>>>>>              buffer.append(" class=\"");
>>>>>>>> @@ -1185,12 +1185,12 @@
>>>>>>>>       * @see
>>>>>
>>>>>
>>>>> org.ofbiz.widget.form.FormStringRenderer#renderFormatHeaderRowCellC 
>>>>> lose(java.lang.StringBuffer,
>>>>>
>>>>>>>> java.util.Map, org.ofbiz.widget.form.ModelForm,  
>>>>>>>> org.ofbiz.widget.form.ModelFormField)
>>>>>>>>       */
>>>>>>>>      public void
>>>>>>
>>>>>>
>>>>>> renderFormatHeaderRowCellClose(StringBuffer buffer,
>>>>>>
>>>>>>>> Map context, ModelForm modelForm, ModelFormField
>>>>>>
>>>>>>
>>>>>> modelFormField) {
>>>>>>
>>>>>>>> -        buffer.append("</td>");
>>>>>>>> +        buffer.append("</th>");
>>>>>>>>          this.appendWhitespace(buffer);
>>>>>>>>      }
>>>>>>>>       public void
>>>>>>
>>>>>>
>>>>>> renderFormatHeaderRowFormCellOpen(StringBuffer
>>>>>>
>>>>>>>> buffer, Map context, ModelForm modelForm) {
>>>>>>>> -        buffer.append("<td align=\"center\"");
>>>>>>>> +        buffer.append("<th align=\"center\"");
>>>>>>>>          String areaStyle =
>>>>>>
>>>>>>
>>>>>> modelForm.getFormTitleAreaStyle();
>>>>>>
>>>>>>>>          if (UtilValidate.isNotEmpty(areaStyle))
>>>>>>
>>>>>>
>>>>>> {
>>>>>>
>>>>>>>>              buffer.append(" class=\"");
>>>>>>>> @@ -1205,7 +1205,7 @@
>>>>>>>>       * @see
>>>>>
>>>>>
>>>>> org.ofbiz.widget.form.FormStringRenderer#renderFormatHeaderRowFormC 
>>>>> ellClose(java.lang.StringBuffer,
>>>>>
>>>>>>>> java.util.Map, org.ofbiz.widget.form.ModelForm)
>>>>>>>>       */
>>>>>>>>      public void
>>>>>>
>>>>>>
>>>>>> renderFormatHeaderRowFormCellClose(StringBuffer
>>>>>>
>>>>>>>> buffer, Map context, ModelForm modelForm) {
>>>>>>>> -        buffer.append("</td>");
>>>>>>>> +        buffer.append("</th>");
>>>>>>>>          this.appendWhitespace(buffer);
>>>>>>>>      }
>>>>>>>>  @@ -1348,7 +1348,7 @@
>>>>>>>>       * @see
>>>>>
>>>>>
>>>>> org.ofbiz.widget.form.FormStringRenderer#renderFormatFieldRowTitleC 
>>>>> ellOpen(java.lang.StringBuffer,
>>>>>
>>>>>>>> java.util.Map,
>>>>>>
>>>>>>
>>>>>> org.ofbiz.widget.form.ModelFormField)
>>>>>>
>>>>>>>>       */
>>>>>>>>      public void
>>>>>>
>>>>>>
>>>>>> renderFormatFieldRowTitleCellOpen(StringBuffer
>>>>>>
>>>>>>>> buffer, Map context, ModelFormField
>>>>>>
>>>>>>
>>>>>> modelFormField) {
>>>>>>
>>>>>>>> -        buffer.append("<td width=\"20%\"
>>>>>>
>>>>>>
>>>>>> align=\"right\"");
>>>>>>
>>>>>>>> +        buffer.append("<th width=\"20%\"
>>>>>>
>>>>>>
>>>>>> align=\"right\"");
>>>>>>
>>>>>>>>          String areaStyle =
>>>>>>
>>>>>>
>>>>>> modelFormField.getTitleAreaStyle();
>>>>>>
>>>>>>>>          if (UtilValidate.isNotEmpty(areaStyle))
>>>>>>
>>>>>>
>>>>>> {
>>>>>>
>>>>>>>>              buffer.append(" class=\"");
>>>>>>>> @@ -1363,7 +1363,7 @@
>>>>>>>>       * @see
>>>>>
>>>>>
>>>>> org.ofbiz.widget.form.FormStringRenderer#renderFormatFieldRowTitleC 
>>>>> ellClose(java.lang.StringBuffer,
>>>>>
>>>>>>>> java.util.Map,
>>>>>>
>>>>>>
>>>>>> org.ofbiz.widget.form.ModelFormField)
>>>>>>
>>>>>>>>       */
>>>>>>>>      public void
>>>>>>
>>>>>>
>>>>>> renderFormatFieldRowTitleCellClose(StringBuffer
>>>>>>
>>>>>>>> buffer, Map context, ModelFormField
>>>>>>
>>>>>>
>>>>>> modelFormField) {
>>>>>>
>>>>>>>> -        buffer.append("</td>");
>>>>>>>> +        buffer.append("</th>");
>>>>>>>>          this.appendWhitespace(buffer);
>>>>>>>>      }
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>
>>>>
>>
>> Index: framework/widget/src/org/ofbiz/widget/html/ HtmlFormRenderer.java
>> ===================================================================
>> --- framework/widget/src/org/ofbiz/widget/html/ 
>> HtmlFormRenderer.java    (revision 494101)
>> +++ framework/widget/src/org/ofbiz/widget/html/ 
>> HtmlFormRenderer.java    (working copy)
>> @@ -1170,7 +1170,7 @@
>>       * @see  
>> org.ofbiz.widget.form.FormStringRenderer#renderFormatHeaderRowCellOpen 
>> (java.lang.StringBuffer, java.util.Map,  
>> org.ofbiz.widget.form.ModelForm, org.ofbiz.widget.form.ModelFormField)
>>       */
>>      public void renderFormatHeaderRowCellOpen(StringBuffer buffer,  
>> Map context, ModelForm modelForm, ModelFormField modelFormField) {
>> -        buffer.append("<td");
>> +        buffer.append("<th align=\"left\"");
>>          String areaStyle = modelFormField.getTitleAreaStyle();
>>          if (UtilValidate.isNotEmpty(areaStyle)) {
>>              buffer.append(" class=\"");
>> @@ -1185,12 +1185,12 @@
>>       * @see  
>> org.ofbiz.widget.form.FormStringRenderer#renderFormatHeaderRowCellClos 
>> e(java.lang.StringBuffer, java.util.Map,  
>> org.ofbiz.widget.form.ModelForm, org.ofbiz.widget.form.ModelFormField)
>>       */
>>      public void renderFormatHeaderRowCellClose(StringBuffer  buffer, 
>> Map context, ModelForm modelForm, ModelFormField  modelFormField) {
>> -        buffer.append("</td>");
>> +        buffer.append("</th>");
>>          this.appendWhitespace(buffer);
>>      }
>>
>>      public void renderFormatHeaderRowFormCellOpen(StringBuffer  
>> buffer, Map context, ModelForm modelForm) {
>> -        buffer.append("<td align=\"center\"");
>> +        buffer.append("<th align=\"center\"");
>>          String areaStyle = modelForm.getFormTitleAreaStyle();
>>          if (UtilValidate.isNotEmpty(areaStyle)) {
>>              buffer.append(" class=\"");
>> @@ -1205,7 +1205,7 @@
>>       * @see  
>> org.ofbiz.widget.form.FormStringRenderer#renderFormatHeaderRowFormCell 
>> Close(java.lang.StringBuffer, java.util.Map,  
>> org.ofbiz.widget.form.ModelForm)
>>       */
>>      public void renderFormatHeaderRowFormCellClose(StringBuffer  
>> buffer, Map context, ModelForm modelForm) {
>> -        buffer.append("</td>");
>> +        buffer.append("</th>");
>>          this.appendWhitespace(buffer);
>>      }
>>
>> @@ -1348,7 +1348,7 @@
>>       * @see  
>> org.ofbiz.widget.form.FormStringRenderer#renderFormatFieldRowTitleCell 
>> Open(java.lang.StringBuffer, java.util.Map,  
>> org.ofbiz.widget.form.ModelFormField)
>>       */
>>      public void renderFormatFieldRowTitleCellOpen(StringBuffer  
>> buffer, Map context, ModelFormField modelFormField) {
>> -        buffer.append("<td width=\"20%\" align=\"right\"");
>> +        buffer.append("<th width=\"20%\" align=\"right\"");
>>          String areaStyle = modelFormField.getTitleAreaStyle();
>>          if (UtilValidate.isNotEmpty(areaStyle)) {
>>              buffer.append(" class=\"");
>> @@ -1363,7 +1363,7 @@
>>       * @see  
>> org.ofbiz.widget.form.FormStringRenderer#renderFormatFieldRowTitleCell 
>> Close(java.lang.StringBuffer, java.util.Map,  
>> org.ofbiz.widget.form.ModelFormField)
>>       */
>>      public void renderFormatFieldRowTitleCellClose(StringBuffer  
>> buffer, Map context, ModelFormField modelFormField) {
>> -        buffer.append("</td>");
>> +        buffer.append("</th>");
>>          this.appendWhitespace(buffer);
>>      }
>>
> 
> 

Re: Please review the attached patch fro the HtmlFormRenderer class

Posted by Tim Ruppert <ti...@hotwaxmedia.com>.
Nothing attached my friend.
--
Tim Ruppert
HotWax Media
http://www.hotwaxmedia.com

o:801.649.6594
f:801.649.6595


On Jan 8, 2007, at 12:10 PM, Jacopo Cappellato wrote:

> Adrian,
>
> about combining the two files into one file, for me it would be fine.
>
> I'd like to get a bit more feedback before applying this patch, but  
> in the meantime, if you want to test it, here is the 'correct' one  
> (attached).
>
> Thanks for your help.
>
> Jacopo
>
>
> Adrian Crum wrote:
>> Jacopo,
>> I would like to help with this. I could spend some time going  
>> through the HtmlFormRenderer.java file and testing the changes.
>> Did you see the comments made earlier about combining the two css  
>> files into one file? If we could get that committed, then I could  
>> apply the necessary patches to the single file.
>> -Adrian
>> Jacopo Cappellato wrote:
>>> Adrian, Chris,
>>>
>>> I agree with you that the align attributes should be removed.
>>> However, since there were already many of them in that file, this  
>>> would require a bit more of work (that must be done but maybe at  
>>> a later task) on the css styles definition.
>>>
>>> Jacopo
>>>
>>>
>>> Chris Howe wrote:
>>>
>>>> Won't the lines that follow the first change:
>>>>
>>>>         if (UtilValidate.isNotEmpty(areaStyle)) {
>>>>             buffer.append(" class=\"");
>>>>             buffer.append(areaStyle);
>>>>             buffer.append("\"");
>>>>         }
>>>> handle any additional styling information, including
>>>> text alignment (ie in css: text-align: right;)? And
>>>> then locale specific css can be added to handle
>>>> Adrian's concern. Does the th align=\"right\" simply
>>>> provide a default alignment that the css will be able
>>>> to override or will the attributes for the <th> tag
>>>> take priority over css?  I forget the answer at the
>>>> moment.
>>>>
>>>> --- Adrian Crum <ad...@hlmksw.com> wrote:
>>>>
>>>>> Oops, ight-to-Left languages would want it
>>>>> RIGHT-aligned.
>>>>>
>>>>> Adrian Crum wrote:
>>>>>
>>>>>> It would be nice if the 'align' property was
>>>>>
>>>>> removed too. Right-to-Left
>>>>>
>>>>>> languages would want it left-aligned.
>>>>>>
>>>>>>
>>>>>> Jacopo Cappellato wrote:
>>>>>>
>>>>>>> Please review the attached patch fro the
>>>>>
>>>>> HtmlFormRenderer class:
>>>>>
>>>>>>> it simply changes the <td> elements to <th>
>>>>>
>>>>> elements when used in
>>>>>
>>>>>>> headers (for list based forms) and as field names
>>>>>
>>>>> for single forms.
>>>>>
>>>>>>> Can I commit it?
>>>>>>>
>>>>>>> Jacopo
>>>>>>>
>>>>>>>
>>>>>>>
>>>> ------------------------------------------------------------------- 
>>>> -----
>>>>
>>>>>>> Index:
>>>>
>>>> framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java
>>>> ===================================================================
>>>>
>>>>>>> ---
>>>>
>>>> framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java
>>>>
>>>>>
>>>>>>> (revision 494101)
>>>>>>> +++
>>>>
>>>> framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java
>>>>
>>>>>
>>>>>>> (working copy)
>>>>>>> @@ -1170,7 +1170,7 @@
>>>>>>>       * @see
>>>>
>>>> org.ofbiz.widget.form.FormStringRenderer#renderFormatHeaderRowCellO 
>>>> pen(java.lang.StringBuffer,
>>>>
>>>>>>> java.util.Map, org.ofbiz.widget.form.ModelForm,  
>>>>>>> org.ofbiz.widget.form.ModelFormField)
>>>>>>>       */
>>>>>>>      public void
>>>>>
>>>>> renderFormatHeaderRowCellOpen(StringBuffer buffer,
>>>>>
>>>>>>> Map context, ModelForm modelForm, ModelFormField
>>>>>
>>>>> modelFormField) {
>>>>>
>>>>>>> -        buffer.append("<td");
>>>>>>> +        buffer.append("<th align=\"right\"");
>>>>>>>          String areaStyle =
>>>>>
>>>>> modelFormField.getTitleAreaStyle();
>>>>>
>>>>>>>          if (UtilValidate.isNotEmpty(areaStyle))
>>>>>
>>>>> {
>>>>>
>>>>>>>              buffer.append(" class=\"");
>>>>>>> @@ -1185,12 +1185,12 @@
>>>>>>>       * @see
>>>>
>>>> org.ofbiz.widget.form.FormStringRenderer#renderFormatHeaderRowCellC 
>>>> lose(java.lang.StringBuffer,
>>>>
>>>>>>> java.util.Map, org.ofbiz.widget.form.ModelForm,  
>>>>>>> org.ofbiz.widget.form.ModelFormField)
>>>>>>>       */
>>>>>>>      public void
>>>>>
>>>>> renderFormatHeaderRowCellClose(StringBuffer buffer,
>>>>>
>>>>>>> Map context, ModelForm modelForm, ModelFormField
>>>>>
>>>>> modelFormField) {
>>>>>
>>>>>>> -        buffer.append("</td>");
>>>>>>> +        buffer.append("</th>");
>>>>>>>          this.appendWhitespace(buffer);
>>>>>>>      }
>>>>>>>       public void
>>>>>
>>>>> renderFormatHeaderRowFormCellOpen(StringBuffer
>>>>>
>>>>>>> buffer, Map context, ModelForm modelForm) {
>>>>>>> -        buffer.append("<td align=\"center\"");
>>>>>>> +        buffer.append("<th align=\"center\"");
>>>>>>>          String areaStyle =
>>>>>
>>>>> modelForm.getFormTitleAreaStyle();
>>>>>
>>>>>>>          if (UtilValidate.isNotEmpty(areaStyle))
>>>>>
>>>>> {
>>>>>
>>>>>>>              buffer.append(" class=\"");
>>>>>>> @@ -1205,7 +1205,7 @@
>>>>>>>       * @see
>>>>
>>>> org.ofbiz.widget.form.FormStringRenderer#renderFormatHeaderRowFormC 
>>>> ellClose(java.lang.StringBuffer,
>>>>
>>>>>>> java.util.Map, org.ofbiz.widget.form.ModelForm)
>>>>>>>       */
>>>>>>>      public void
>>>>>
>>>>> renderFormatHeaderRowFormCellClose(StringBuffer
>>>>>
>>>>>>> buffer, Map context, ModelForm modelForm) {
>>>>>>> -        buffer.append("</td>");
>>>>>>> +        buffer.append("</th>");
>>>>>>>          this.appendWhitespace(buffer);
>>>>>>>      }
>>>>>>>  @@ -1348,7 +1348,7 @@
>>>>>>>       * @see
>>>>
>>>> org.ofbiz.widget.form.FormStringRenderer#renderFormatFieldRowTitleC 
>>>> ellOpen(java.lang.StringBuffer,
>>>>
>>>>>>> java.util.Map,
>>>>>
>>>>> org.ofbiz.widget.form.ModelFormField)
>>>>>
>>>>>>>       */
>>>>>>>      public void
>>>>>
>>>>> renderFormatFieldRowTitleCellOpen(StringBuffer
>>>>>
>>>>>>> buffer, Map context, ModelFormField
>>>>>
>>>>> modelFormField) {
>>>>>
>>>>>>> -        buffer.append("<td width=\"20%\"
>>>>>
>>>>> align=\"right\"");
>>>>>
>>>>>>> +        buffer.append("<th width=\"20%\"
>>>>>
>>>>> align=\"right\"");
>>>>>
>>>>>>>          String areaStyle =
>>>>>
>>>>> modelFormField.getTitleAreaStyle();
>>>>>
>>>>>>>          if (UtilValidate.isNotEmpty(areaStyle))
>>>>>
>>>>> {
>>>>>
>>>>>>>              buffer.append(" class=\"");
>>>>>>> @@ -1363,7 +1363,7 @@
>>>>>>>       * @see
>>>>
>>>> org.ofbiz.widget.form.FormStringRenderer#renderFormatFieldRowTitleC 
>>>> ellClose(java.lang.StringBuffer,
>>>>
>>>>>>> java.util.Map,
>>>>>
>>>>> org.ofbiz.widget.form.ModelFormField)
>>>>>
>>>>>>>       */
>>>>>>>      public void
>>>>>
>>>>> renderFormatFieldRowTitleCellClose(StringBuffer
>>>>>
>>>>>>> buffer, Map context, ModelFormField
>>>>>
>>>>> modelFormField) {
>>>>>
>>>>>>> -        buffer.append("</td>");
>>>>>>> +        buffer.append("</th>");
>>>>>>>          this.appendWhitespace(buffer);
>>>>>>>      }
>>>>>>>
>>>>>>
>>>>>>
>>>
>>>
>
> Index: framework/widget/src/org/ofbiz/widget/html/ 
> HtmlFormRenderer.java
> ===================================================================
> --- framework/widget/src/org/ofbiz/widget/html/ 
> HtmlFormRenderer.java	(revision 494101)
> +++ framework/widget/src/org/ofbiz/widget/html/ 
> HtmlFormRenderer.java	(working copy)
> @@ -1170,7 +1170,7 @@
>       * @see  
> org.ofbiz.widget.form.FormStringRenderer#renderFormatHeaderRowCellOpen 
> (java.lang.StringBuffer, java.util.Map,  
> org.ofbiz.widget.form.ModelForm, org.ofbiz.widget.form.ModelFormField)
>       */
>      public void renderFormatHeaderRowCellOpen(StringBuffer buffer,  
> Map context, ModelForm modelForm, ModelFormField modelFormField) {
> -        buffer.append("<td");
> +        buffer.append("<th align=\"left\"");
>          String areaStyle = modelFormField.getTitleAreaStyle();
>          if (UtilValidate.isNotEmpty(areaStyle)) {
>              buffer.append(" class=\"");
> @@ -1185,12 +1185,12 @@
>       * @see  
> org.ofbiz.widget.form.FormStringRenderer#renderFormatHeaderRowCellClos 
> e(java.lang.StringBuffer, java.util.Map,  
> org.ofbiz.widget.form.ModelForm, org.ofbiz.widget.form.ModelFormField)
>       */
>      public void renderFormatHeaderRowCellClose(StringBuffer  
> buffer, Map context, ModelForm modelForm, ModelFormField  
> modelFormField) {
> -        buffer.append("</td>");
> +        buffer.append("</th>");
>          this.appendWhitespace(buffer);
>      }
>
>      public void renderFormatHeaderRowFormCellOpen(StringBuffer  
> buffer, Map context, ModelForm modelForm) {
> -        buffer.append("<td align=\"center\"");
> +        buffer.append("<th align=\"center\"");
>          String areaStyle = modelForm.getFormTitleAreaStyle();
>          if (UtilValidate.isNotEmpty(areaStyle)) {
>              buffer.append(" class=\"");
> @@ -1205,7 +1205,7 @@
>       * @see  
> org.ofbiz.widget.form.FormStringRenderer#renderFormatHeaderRowFormCell 
> Close(java.lang.StringBuffer, java.util.Map,  
> org.ofbiz.widget.form.ModelForm)
>       */
>      public void renderFormatHeaderRowFormCellClose(StringBuffer  
> buffer, Map context, ModelForm modelForm) {
> -        buffer.append("</td>");
> +        buffer.append("</th>");
>          this.appendWhitespace(buffer);
>      }
>
> @@ -1348,7 +1348,7 @@
>       * @see  
> org.ofbiz.widget.form.FormStringRenderer#renderFormatFieldRowTitleCell 
> Open(java.lang.StringBuffer, java.util.Map,  
> org.ofbiz.widget.form.ModelFormField)
>       */
>      public void renderFormatFieldRowTitleCellOpen(StringBuffer  
> buffer, Map context, ModelFormField modelFormField) {
> -        buffer.append("<td width=\"20%\" align=\"right\"");
> +        buffer.append("<th width=\"20%\" align=\"right\"");
>          String areaStyle = modelFormField.getTitleAreaStyle();
>          if (UtilValidate.isNotEmpty(areaStyle)) {
>              buffer.append(" class=\"");
> @@ -1363,7 +1363,7 @@
>       * @see  
> org.ofbiz.widget.form.FormStringRenderer#renderFormatFieldRowTitleCell 
> Close(java.lang.StringBuffer, java.util.Map,  
> org.ofbiz.widget.form.ModelFormField)
>       */
>      public void renderFormatFieldRowTitleCellClose(StringBuffer  
> buffer, Map context, ModelFormField modelFormField) {
> -        buffer.append("</td>");
> +        buffer.append("</th>");
>          this.appendWhitespace(buffer);
>      }
>


Re: Please review the attached patch fro the HtmlFormRenderer class

Posted by Adrian Crum <ad...@hlmksw.com>.
Jacopo,

I have applied your patch and I'm looking over it now. Something unrelated that 
we should fix right away is the "addAstericks" method. It should be renamed to 
"addAsterisks."


Jacopo Cappellato wrote:

> Adrian,
> 
> about combining the two files into one file, for me it would be fine.
> 
> I'd like to get a bit more feedback before applying this patch, but in 
> the meantime, if you want to test it, here is the 'correct' one (attached).
> 
> Thanks for your help.
> 
> Jacopo
> 
> 
> Adrian Crum wrote:
> 
>> Jacopo,
>>
>> I would like to help with this. I could spend some time going through 
>> the HtmlFormRenderer.java file and testing the changes.
>>
>> Did you see the comments made earlier about combining the two css 
>> files into one file? If we could get that committed, then I could 
>> apply the necessary patches to the single file.
>>
>> -Adrian
>>
>> Jacopo Cappellato wrote:
>>
>>> Adrian, Chris,
>>>
>>> I agree with you that the align attributes should be removed.
>>> However, since there were already many of them in that file, this 
>>> would require a bit more of work (that must be done but maybe at a 
>>> later task) on the css styles definition.
>>>
>>> Jacopo
>>>
>>>
>>> Chris Howe wrote:
>>>
>>>> Won't the lines that follow the first change:
>>>>
>>>>         if (UtilValidate.isNotEmpty(areaStyle)) {
>>>>             buffer.append(" class=\"");
>>>>             buffer.append(areaStyle);
>>>>             buffer.append("\"");
>>>>         }
>>>> handle any additional styling information, including
>>>> text alignment (ie in css: text-align: right;)? And
>>>> then locale specific css can be added to handle
>>>> Adrian's concern. Does the th align=\"right\" simply
>>>> provide a default alignment that the css will be able
>>>> to override or will the attributes for the <th> tag
>>>> take priority over css?  I forget the answer at the
>>>> moment.
>>>>
>>>> --- Adrian Crum <ad...@hlmksw.com> wrote:
>>>>
>>>>> Oops, ight-to-Left languages would want it
>>>>> RIGHT-aligned.
>>>>>
>>>>> Adrian Crum wrote:
>>>>>
>>>>>> It would be nice if the 'align' property was
>>>>>
>>>>>
>>>>> removed too. Right-to-Left
>>>>>
>>>>>> languages would want it left-aligned.
>>>>>>
>>>>>>
>>>>>> Jacopo Cappellato wrote:
>>>>>>
>>>>>>> Please review the attached patch fro the
>>>>>
>>>>>
>>>>> HtmlFormRenderer class:
>>>>>
>>>>>>> it simply changes the <td> elements to <th>
>>>>>
>>>>>
>>>>> elements when used in
>>>>>
>>>>>>> headers (for list based forms) and as field names
>>>>>
>>>>>
>>>>> for single forms.
>>>>>
>>>>>>> Can I commit it?
>>>>>>>
>>>>>>> Jacopo
>>>>>>>
>>>>>>>
>>>>>>>
>>>> ------------------------------------------------------------------------ 
>>>>
>>>>
>>>>>>> Index:
>>>>
>>>>
>>>> framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java
>>>> ===================================================================
>>>>
>>>>>>> ---
>>>>
>>>>
>>>> framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java
>>>>
>>>>>  
>>>>>
>>>>>>> (revision 494101)
>>>>>>> +++
>>>>
>>>>
>>>> framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java
>>>>
>>>>>  
>>>>>
>>>>>>> (working copy)
>>>>>>> @@ -1170,7 +1170,7 @@
>>>>>>>       * @see
>>>>
>>>>
>>>> org.ofbiz.widget.form.FormStringRenderer#renderFormatHeaderRowCellOpen(java.lang.StringBuffer, 
>>>>
>>>>
>>>>>>> java.util.Map, org.ofbiz.widget.form.ModelForm, 
>>>>>>> org.ofbiz.widget.form.ModelFormField)
>>>>>>>       */
>>>>>>>      public void
>>>>>
>>>>>
>>>>> renderFormatHeaderRowCellOpen(StringBuffer buffer,
>>>>>
>>>>>>> Map context, ModelForm modelForm, ModelFormField
>>>>>
>>>>>
>>>>> modelFormField) {
>>>>>
>>>>>>> -        buffer.append("<td");
>>>>>>> +        buffer.append("<th align=\"right\"");
>>>>>>>          String areaStyle =
>>>>>
>>>>>
>>>>> modelFormField.getTitleAreaStyle();
>>>>>
>>>>>>>          if (UtilValidate.isNotEmpty(areaStyle))
>>>>>
>>>>>
>>>>> {
>>>>>
>>>>>>>              buffer.append(" class=\"");
>>>>>>> @@ -1185,12 +1185,12 @@
>>>>>>>       * @see
>>>>
>>>>
>>>> org.ofbiz.widget.form.FormStringRenderer#renderFormatHeaderRowCellClose(java.lang.StringBuffer, 
>>>>
>>>>
>>>>>>> java.util.Map, org.ofbiz.widget.form.ModelForm, 
>>>>>>> org.ofbiz.widget.form.ModelFormField)
>>>>>>>       */
>>>>>>>      public void
>>>>>
>>>>>
>>>>> renderFormatHeaderRowCellClose(StringBuffer buffer,
>>>>>
>>>>>>> Map context, ModelForm modelForm, ModelFormField
>>>>>
>>>>>
>>>>> modelFormField) {
>>>>>
>>>>>>> -        buffer.append("</td>");
>>>>>>> +        buffer.append("</th>");
>>>>>>>          this.appendWhitespace(buffer);
>>>>>>>      }
>>>>>>>  
>>>>>>>      public void
>>>>>
>>>>>
>>>>> renderFormatHeaderRowFormCellOpen(StringBuffer
>>>>>
>>>>>>> buffer, Map context, ModelForm modelForm) {
>>>>>>> -        buffer.append("<td align=\"center\"");
>>>>>>> +        buffer.append("<th align=\"center\"");
>>>>>>>          String areaStyle =
>>>>>
>>>>>
>>>>> modelForm.getFormTitleAreaStyle();
>>>>>
>>>>>>>          if (UtilValidate.isNotEmpty(areaStyle))
>>>>>
>>>>>
>>>>> {
>>>>>
>>>>>>>              buffer.append(" class=\"");
>>>>>>> @@ -1205,7 +1205,7 @@
>>>>>>>       * @see
>>>>
>>>>
>>>> org.ofbiz.widget.form.FormStringRenderer#renderFormatHeaderRowFormCellClose(java.lang.StringBuffer, 
>>>>
>>>>
>>>>>>> java.util.Map, org.ofbiz.widget.form.ModelForm)
>>>>>>>       */
>>>>>>>      public void
>>>>>
>>>>>
>>>>> renderFormatHeaderRowFormCellClose(StringBuffer
>>>>>
>>>>>>> buffer, Map context, ModelForm modelForm) {
>>>>>>> -        buffer.append("</td>");
>>>>>>> +        buffer.append("</th>");
>>>>>>>          this.appendWhitespace(buffer);
>>>>>>>      }
>>>>>>>  
>>>>>>> @@ -1348,7 +1348,7 @@
>>>>>>>       * @see
>>>>
>>>>
>>>> org.ofbiz.widget.form.FormStringRenderer#renderFormatFieldRowTitleCellOpen(java.lang.StringBuffer, 
>>>>
>>>>
>>>>>>> java.util.Map,
>>>>>
>>>>>
>>>>> org.ofbiz.widget.form.ModelFormField)
>>>>>
>>>>>>>       */
>>>>>>>      public void
>>>>>
>>>>>
>>>>> renderFormatFieldRowTitleCellOpen(StringBuffer
>>>>>
>>>>>>> buffer, Map context, ModelFormField
>>>>>
>>>>>
>>>>> modelFormField) {
>>>>>
>>>>>>> -        buffer.append("<td width=\"20%\"
>>>>>
>>>>>
>>>>> align=\"right\"");
>>>>>
>>>>>>> +        buffer.append("<th width=\"20%\"
>>>>>
>>>>>
>>>>> align=\"right\"");
>>>>>
>>>>>>>          String areaStyle =
>>>>>
>>>>>
>>>>> modelFormField.getTitleAreaStyle();
>>>>>
>>>>>>>          if (UtilValidate.isNotEmpty(areaStyle))
>>>>>
>>>>>
>>>>> {
>>>>>
>>>>>>>              buffer.append(" class=\"");
>>>>>>> @@ -1363,7 +1363,7 @@
>>>>>>>       * @see
>>>>
>>>>
>>>> org.ofbiz.widget.form.FormStringRenderer#renderFormatFieldRowTitleCellClose(java.lang.StringBuffer, 
>>>>
>>>>
>>>>>>> java.util.Map,
>>>>>
>>>>>
>>>>> org.ofbiz.widget.form.ModelFormField)
>>>>>
>>>>>>>       */
>>>>>>>      public void
>>>>>
>>>>>
>>>>> renderFormatFieldRowTitleCellClose(StringBuffer
>>>>>
>>>>>>> buffer, Map context, ModelFormField
>>>>>
>>>>>
>>>>> modelFormField) {
>>>>>
>>>>>>> -        buffer.append("</td>");
>>>>>>> +        buffer.append("</th>");
>>>>>>>          this.appendWhitespace(buffer);
>>>>>>>      }
>>>>>>>  
>>>>>>
>>>>>>
>>>>>>
>>>
>>>
> 
> 
> ------------------------------------------------------------------------
> 
> Index: framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java
> ===================================================================
> --- framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java	(revision 494101)
> +++ framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java	(working copy)
> @@ -1170,7 +1170,7 @@
>       * @see org.ofbiz.widget.form.FormStringRenderer#renderFormatHeaderRowCellOpen(java.lang.StringBuffer, java.util.Map, org.ofbiz.widget.form.ModelForm, org.ofbiz.widget.form.ModelFormField)
>       */
>      public void renderFormatHeaderRowCellOpen(StringBuffer buffer, Map context, ModelForm modelForm, ModelFormField modelFormField) {
> -        buffer.append("<td");
> +        buffer.append("<th align=\"left\"");
>          String areaStyle = modelFormField.getTitleAreaStyle();
>          if (UtilValidate.isNotEmpty(areaStyle)) {
>              buffer.append(" class=\"");
> @@ -1185,12 +1185,12 @@
>       * @see org.ofbiz.widget.form.FormStringRenderer#renderFormatHeaderRowCellClose(java.lang.StringBuffer, java.util.Map, org.ofbiz.widget.form.ModelForm, org.ofbiz.widget.form.ModelFormField)
>       */
>      public void renderFormatHeaderRowCellClose(StringBuffer buffer, Map context, ModelForm modelForm, ModelFormField modelFormField) {
> -        buffer.append("</td>");
> +        buffer.append("</th>");
>          this.appendWhitespace(buffer);
>      }
>  
>      public void renderFormatHeaderRowFormCellOpen(StringBuffer buffer, Map context, ModelForm modelForm) {
> -        buffer.append("<td align=\"center\"");
> +        buffer.append("<th align=\"center\"");
>          String areaStyle = modelForm.getFormTitleAreaStyle();
>          if (UtilValidate.isNotEmpty(areaStyle)) {
>              buffer.append(" class=\"");
> @@ -1205,7 +1205,7 @@
>       * @see org.ofbiz.widget.form.FormStringRenderer#renderFormatHeaderRowFormCellClose(java.lang.StringBuffer, java.util.Map, org.ofbiz.widget.form.ModelForm)
>       */
>      public void renderFormatHeaderRowFormCellClose(StringBuffer buffer, Map context, ModelForm modelForm) {
> -        buffer.append("</td>");
> +        buffer.append("</th>");
>          this.appendWhitespace(buffer);
>      }
>  
> @@ -1348,7 +1348,7 @@
>       * @see org.ofbiz.widget.form.FormStringRenderer#renderFormatFieldRowTitleCellOpen(java.lang.StringBuffer, java.util.Map, org.ofbiz.widget.form.ModelFormField)
>       */
>      public void renderFormatFieldRowTitleCellOpen(StringBuffer buffer, Map context, ModelFormField modelFormField) {
> -        buffer.append("<td width=\"20%\" align=\"right\"");
> +        buffer.append("<th width=\"20%\" align=\"right\"");
>          String areaStyle = modelFormField.getTitleAreaStyle();
>          if (UtilValidate.isNotEmpty(areaStyle)) {
>              buffer.append(" class=\"");
> @@ -1363,7 +1363,7 @@
>       * @see org.ofbiz.widget.form.FormStringRenderer#renderFormatFieldRowTitleCellClose(java.lang.StringBuffer, java.util.Map, org.ofbiz.widget.form.ModelFormField)
>       */
>      public void renderFormatFieldRowTitleCellClose(StringBuffer buffer, Map context, ModelFormField modelFormField) {
> -        buffer.append("</td>");
> +        buffer.append("</th>");
>          this.appendWhitespace(buffer);
>      }
>  

Re: Please review the attached patch fro the HtmlFormRenderer class

Posted by Jacopo Cappellato <ti...@sastau.it>.
Adrian,

about combining the two files into one file, for me it would be fine.

I'd like to get a bit more feedback before applying this patch, but in 
the meantime, if you want to test it, here is the 'correct' one (attached).

Thanks for your help.

Jacopo


Adrian Crum wrote:
> Jacopo,
> 
> I would like to help with this. I could spend some time going through 
> the HtmlFormRenderer.java file and testing the changes.
> 
> Did you see the comments made earlier about combining the two css files 
> into one file? If we could get that committed, then I could apply the 
> necessary patches to the single file.
> 
> -Adrian
> 
> Jacopo Cappellato wrote:
> 
>> Adrian, Chris,
>>
>> I agree with you that the align attributes should be removed.
>> However, since there were already many of them in that file, this 
>> would require a bit more of work (that must be done but maybe at a 
>> later task) on the css styles definition.
>>
>> Jacopo
>>
>>
>> Chris Howe wrote:
>>
>>> Won't the lines that follow the first change:
>>>
>>>         if (UtilValidate.isNotEmpty(areaStyle)) {
>>>             buffer.append(" class=\"");
>>>             buffer.append(areaStyle);
>>>             buffer.append("\"");
>>>         }
>>> handle any additional styling information, including
>>> text alignment (ie in css: text-align: right;)? And
>>> then locale specific css can be added to handle
>>> Adrian's concern. Does the th align=\"right\" simply
>>> provide a default alignment that the css will be able
>>> to override or will the attributes for the <th> tag
>>> take priority over css?  I forget the answer at the
>>> moment.
>>>
>>> --- Adrian Crum <ad...@hlmksw.com> wrote:
>>>
>>>> Oops, ight-to-Left languages would want it
>>>> RIGHT-aligned.
>>>>
>>>> Adrian Crum wrote:
>>>>
>>>>> It would be nice if the 'align' property was
>>>>
>>>> removed too. Right-to-Left
>>>>
>>>>> languages would want it left-aligned.
>>>>>
>>>>>
>>>>> Jacopo Cappellato wrote:
>>>>>
>>>>>> Please review the attached patch fro the
>>>>
>>>> HtmlFormRenderer class:
>>>>
>>>>>> it simply changes the <td> elements to <th>
>>>>
>>>> elements when used in
>>>>
>>>>>> headers (for list based forms) and as field names
>>>>
>>>> for single forms.
>>>>
>>>>>> Can I commit it?
>>>>>>
>>>>>> Jacopo
>>>>>>
>>>>>>
>>>>>>
>>> ------------------------------------------------------------------------
>>>
>>>>>> Index:
>>>
>>> framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java
>>> ===================================================================
>>>
>>>>>> ---
>>>
>>> framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java
>>>
>>>>  
>>>>>> (revision 494101)
>>>>>> +++
>>>
>>> framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java
>>>
>>>>  
>>>>>> (working copy)
>>>>>> @@ -1170,7 +1170,7 @@
>>>>>>       * @see
>>>
>>> org.ofbiz.widget.form.FormStringRenderer#renderFormatHeaderRowCellOpen(java.lang.StringBuffer, 
>>>
>>>
>>>>>> java.util.Map, org.ofbiz.widget.form.ModelForm, 
>>>>>> org.ofbiz.widget.form.ModelFormField)
>>>>>>       */
>>>>>>      public void
>>>>
>>>> renderFormatHeaderRowCellOpen(StringBuffer buffer,
>>>>
>>>>>> Map context, ModelForm modelForm, ModelFormField
>>>>
>>>> modelFormField) {
>>>>
>>>>>> -        buffer.append("<td");
>>>>>> +        buffer.append("<th align=\"right\"");
>>>>>>          String areaStyle =
>>>>
>>>> modelFormField.getTitleAreaStyle();
>>>>
>>>>>>          if (UtilValidate.isNotEmpty(areaStyle))
>>>>
>>>> {
>>>>
>>>>>>              buffer.append(" class=\"");
>>>>>> @@ -1185,12 +1185,12 @@
>>>>>>       * @see
>>>
>>> org.ofbiz.widget.form.FormStringRenderer#renderFormatHeaderRowCellClose(java.lang.StringBuffer, 
>>>
>>>
>>>>>> java.util.Map, org.ofbiz.widget.form.ModelForm, 
>>>>>> org.ofbiz.widget.form.ModelFormField)
>>>>>>       */
>>>>>>      public void
>>>>
>>>> renderFormatHeaderRowCellClose(StringBuffer buffer,
>>>>
>>>>>> Map context, ModelForm modelForm, ModelFormField
>>>>
>>>> modelFormField) {
>>>>
>>>>>> -        buffer.append("</td>");
>>>>>> +        buffer.append("</th>");
>>>>>>          this.appendWhitespace(buffer);
>>>>>>      }
>>>>>>  
>>>>>>      public void
>>>>
>>>> renderFormatHeaderRowFormCellOpen(StringBuffer
>>>>
>>>>>> buffer, Map context, ModelForm modelForm) {
>>>>>> -        buffer.append("<td align=\"center\"");
>>>>>> +        buffer.append("<th align=\"center\"");
>>>>>>          String areaStyle =
>>>>
>>>> modelForm.getFormTitleAreaStyle();
>>>>
>>>>>>          if (UtilValidate.isNotEmpty(areaStyle))
>>>>
>>>> {
>>>>
>>>>>>              buffer.append(" class=\"");
>>>>>> @@ -1205,7 +1205,7 @@
>>>>>>       * @see
>>>
>>> org.ofbiz.widget.form.FormStringRenderer#renderFormatHeaderRowFormCellClose(java.lang.StringBuffer, 
>>>
>>>
>>>>>> java.util.Map, org.ofbiz.widget.form.ModelForm)
>>>>>>       */
>>>>>>      public void
>>>>
>>>> renderFormatHeaderRowFormCellClose(StringBuffer
>>>>
>>>>>> buffer, Map context, ModelForm modelForm) {
>>>>>> -        buffer.append("</td>");
>>>>>> +        buffer.append("</th>");
>>>>>>          this.appendWhitespace(buffer);
>>>>>>      }
>>>>>>  
>>>>>> @@ -1348,7 +1348,7 @@
>>>>>>       * @see
>>>
>>> org.ofbiz.widget.form.FormStringRenderer#renderFormatFieldRowTitleCellOpen(java.lang.StringBuffer, 
>>>
>>>
>>>>>> java.util.Map,
>>>>
>>>> org.ofbiz.widget.form.ModelFormField)
>>>>
>>>>>>       */
>>>>>>      public void
>>>>
>>>> renderFormatFieldRowTitleCellOpen(StringBuffer
>>>>
>>>>>> buffer, Map context, ModelFormField
>>>>
>>>> modelFormField) {
>>>>
>>>>>> -        buffer.append("<td width=\"20%\"
>>>>
>>>> align=\"right\"");
>>>>
>>>>>> +        buffer.append("<th width=\"20%\"
>>>>
>>>> align=\"right\"");
>>>>
>>>>>>          String areaStyle =
>>>>
>>>> modelFormField.getTitleAreaStyle();
>>>>
>>>>>>          if (UtilValidate.isNotEmpty(areaStyle))
>>>>
>>>> {
>>>>
>>>>>>              buffer.append(" class=\"");
>>>>>> @@ -1363,7 +1363,7 @@
>>>>>>       * @see
>>>
>>> org.ofbiz.widget.form.FormStringRenderer#renderFormatFieldRowTitleCellClose(java.lang.StringBuffer, 
>>>
>>>
>>>>>> java.util.Map,
>>>>
>>>> org.ofbiz.widget.form.ModelFormField)
>>>>
>>>>>>       */
>>>>>>      public void
>>>>
>>>> renderFormatFieldRowTitleCellClose(StringBuffer
>>>>
>>>>>> buffer, Map context, ModelFormField
>>>>
>>>> modelFormField) {
>>>>
>>>>>> -        buffer.append("</td>");
>>>>>> +        buffer.append("</th>");
>>>>>>          this.appendWhitespace(buffer);
>>>>>>      }
>>>>>>  
>>>>>
>>>>>
>>
>>


Re: Please review the attached patch fro the HtmlFormRenderer class

Posted by Adrian Crum <ad...@hlmksw.com>.
Jacopo,

I would like to help with this. I could spend some time going through the 
HtmlFormRenderer.java file and testing the changes.

Did you see the comments made earlier about combining the two css files into one 
file? If we could get that committed, then I could apply the necessary patches 
to the single file.

-Adrian

Jacopo Cappellato wrote:

> Adrian, Chris,
> 
> I agree with you that the align attributes should be removed.
> However, since there were already many of them in that file, this would 
> require a bit more of work (that must be done but maybe at a later task) 
> on the css styles definition.
> 
> Jacopo
> 
> 
> Chris Howe wrote:
> 
>> Won't the lines that follow the first change:
>>
>>         if (UtilValidate.isNotEmpty(areaStyle)) {
>>             buffer.append(" class=\"");
>>             buffer.append(areaStyle);
>>             buffer.append("\"");
>>         }
>> handle any additional styling information, including
>> text alignment (ie in css: text-align: right;)? And
>> then locale specific css can be added to handle
>> Adrian's concern. Does the th align=\"right\" simply
>> provide a default alignment that the css will be able
>> to override or will the attributes for the <th> tag
>> take priority over css?  I forget the answer at the
>> moment.
>>
>> --- Adrian Crum <ad...@hlmksw.com> wrote:
>>
>>> Oops, ight-to-Left languages would want it
>>> RIGHT-aligned.
>>>
>>> Adrian Crum wrote:
>>>
>>>> It would be nice if the 'align' property was
>>>
>>> removed too. Right-to-Left
>>>
>>>> languages would want it left-aligned.
>>>>
>>>>
>>>> Jacopo Cappellato wrote:
>>>>
>>>>> Please review the attached patch fro the
>>>
>>> HtmlFormRenderer class:
>>>
>>>>> it simply changes the <td> elements to <th>
>>>
>>> elements when used in
>>>
>>>>> headers (for list based forms) and as field names
>>>
>>> for single forms.
>>>
>>>>> Can I commit it?
>>>>>
>>>>> Jacopo
>>>>>
>>>>>
>>>>>
>> ------------------------------------------------------------------------
>>
>>>>> Index:
>>
>> framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java
>> ===================================================================
>>
>>>>> ---
>>
>> framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java
>>
>>>   
>>>
>>>>> (revision 494101)
>>>>> +++
>>
>> framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java
>>
>>>   
>>>
>>>>> (working copy)
>>>>> @@ -1170,7 +1170,7 @@
>>>>>       * @see
>>
>> org.ofbiz.widget.form.FormStringRenderer#renderFormatHeaderRowCellOpen(java.lang.StringBuffer, 
>>
>>
>>>>> java.util.Map, org.ofbiz.widget.form.ModelForm, 
>>>>> org.ofbiz.widget.form.ModelFormField)
>>>>>       */
>>>>>      public void
>>>
>>> renderFormatHeaderRowCellOpen(StringBuffer buffer,
>>>
>>>>> Map context, ModelForm modelForm, ModelFormField
>>>
>>> modelFormField) {
>>>
>>>>> -        buffer.append("<td");
>>>>> +        buffer.append("<th align=\"right\"");
>>>>>          String areaStyle =
>>>
>>> modelFormField.getTitleAreaStyle();
>>>
>>>>>          if (UtilValidate.isNotEmpty(areaStyle))
>>>
>>> {
>>>
>>>>>              buffer.append(" class=\"");
>>>>> @@ -1185,12 +1185,12 @@
>>>>>       * @see
>>
>> org.ofbiz.widget.form.FormStringRenderer#renderFormatHeaderRowCellClose(java.lang.StringBuffer, 
>>
>>
>>>>> java.util.Map, org.ofbiz.widget.form.ModelForm, 
>>>>> org.ofbiz.widget.form.ModelFormField)
>>>>>       */
>>>>>      public void
>>>
>>> renderFormatHeaderRowCellClose(StringBuffer buffer,
>>>
>>>>> Map context, ModelForm modelForm, ModelFormField
>>>
>>> modelFormField) {
>>>
>>>>> -        buffer.append("</td>");
>>>>> +        buffer.append("</th>");
>>>>>          this.appendWhitespace(buffer);
>>>>>      }
>>>>>  
>>>>>      public void
>>>
>>> renderFormatHeaderRowFormCellOpen(StringBuffer
>>>
>>>>> buffer, Map context, ModelForm modelForm) {
>>>>> -        buffer.append("<td align=\"center\"");
>>>>> +        buffer.append("<th align=\"center\"");
>>>>>          String areaStyle =
>>>
>>> modelForm.getFormTitleAreaStyle();
>>>
>>>>>          if (UtilValidate.isNotEmpty(areaStyle))
>>>
>>> {
>>>
>>>>>              buffer.append(" class=\"");
>>>>> @@ -1205,7 +1205,7 @@
>>>>>       * @see
>>
>> org.ofbiz.widget.form.FormStringRenderer#renderFormatHeaderRowFormCellClose(java.lang.StringBuffer, 
>>
>>
>>>>> java.util.Map, org.ofbiz.widget.form.ModelForm)
>>>>>       */
>>>>>      public void
>>>
>>> renderFormatHeaderRowFormCellClose(StringBuffer
>>>
>>>>> buffer, Map context, ModelForm modelForm) {
>>>>> -        buffer.append("</td>");
>>>>> +        buffer.append("</th>");
>>>>>          this.appendWhitespace(buffer);
>>>>>      }
>>>>>  
>>>>> @@ -1348,7 +1348,7 @@
>>>>>       * @see
>>
>> org.ofbiz.widget.form.FormStringRenderer#renderFormatFieldRowTitleCellOpen(java.lang.StringBuffer, 
>>
>>
>>>>> java.util.Map,
>>>
>>> org.ofbiz.widget.form.ModelFormField)
>>>
>>>>>       */
>>>>>      public void
>>>
>>> renderFormatFieldRowTitleCellOpen(StringBuffer
>>>
>>>>> buffer, Map context, ModelFormField
>>>
>>> modelFormField) {
>>>
>>>>> -        buffer.append("<td width=\"20%\"
>>>
>>> align=\"right\"");
>>>
>>>>> +        buffer.append("<th width=\"20%\"
>>>
>>> align=\"right\"");
>>>
>>>>>          String areaStyle =
>>>
>>> modelFormField.getTitleAreaStyle();
>>>
>>>>>          if (UtilValidate.isNotEmpty(areaStyle))
>>>
>>> {
>>>
>>>>>              buffer.append(" class=\"");
>>>>> @@ -1363,7 +1363,7 @@
>>>>>       * @see
>>
>> org.ofbiz.widget.form.FormStringRenderer#renderFormatFieldRowTitleCellClose(java.lang.StringBuffer, 
>>
>>
>>>>> java.util.Map,
>>>
>>> org.ofbiz.widget.form.ModelFormField)
>>>
>>>>>       */
>>>>>      public void
>>>
>>> renderFormatFieldRowTitleCellClose(StringBuffer
>>>
>>>>> buffer, Map context, ModelFormField
>>>
>>> modelFormField) {
>>>
>>>>> -        buffer.append("</td>");
>>>>> +        buffer.append("</th>");
>>>>>          this.appendWhitespace(buffer);
>>>>>      }
>>>>>  
>>>>
>>>>
> 
> 

Re: Please review the attached patch fro the HtmlFormRenderer class

Posted by Jacopo Cappellato <ti...@sastau.it>.
First of all, just to avoid confusion, the alignment in my patch was 
wrong and the correct one would be:

buffer.append("<th align=\"left\"");

Without it the column headers (that are now by default left aligned 
because they are rendered with <td>) would be centered in all the 
generated lists.

Jacopo


Chris Howe wrote:
> My only concern then is why the first change in the
> patch _adds the align attribute (it's obvious the rest
> of them were already there).  I think the "step in the
> right direction" is a fine approach and doesn't need
> to "fix" everything but it shouldn't throw another
> wrench into it.  I'm not sure we have enough people to
> apply the patch (as opposed to simply reviewing it) to
> their development to be sure it's not throwing form
> widget uses out of alignment in use cases that use the
> areastyle to define their alignment.
> 
> 


Re: Please review the attached patch fro the HtmlFormRenderer class

Posted by Chris Howe <cj...@yahoo.com>.
My only concern then is why the first change in the
patch _adds the align attribute (it's obvious the rest
of them were already there).  I think the "step in the
right direction" is a fine approach and doesn't need
to "fix" everything but it shouldn't throw another
wrench into it.  I'm not sure we have enough people to
apply the patch (as opposed to simply reviewing it) to
their development to be sure it's not throwing form
widget uses out of alignment in use cases that use the
areastyle to define their alignment.


--- Jacopo Cappellato <ti...@sastau.it> wrote:

> Adrian, Chris,
> 
> I agree with you that the align attributes should be
> removed.
> However, since there were already many of them in
> that file, this would 
> require a bit more of work (that must be done but
> maybe at a later task) 
> on the css styles definition.
> 
> Jacopo
> 
> 
> Chris Howe wrote:
> > Won't the lines that follow the first change:
> > 
> >         if (UtilValidate.isNotEmpty(areaStyle)) {
> >             buffer.append(" class=\"");
> >             buffer.append(areaStyle);
> >             buffer.append("\"");
> >         }
> > handle any additional styling information,
> including
> > text alignment (ie in css: text-align: right;)?
> And
> > then locale specific css can be added to handle
> > Adrian's concern. Does the th align=\"right\"
> simply
> > provide a default alignment that the css will be
> able
> > to override or will the attributes for the <th>
> tag
> > take priority over css?  I forget the answer at
> the
> > moment.
> > 
> > --- Adrian Crum <ad...@hlmksw.com> wrote:
> > 
> >> Oops, ight-to-Left languages would want it
> >> RIGHT-aligned.
> >>
> >> Adrian Crum wrote:
> >>
> >>> It would be nice if the 'align' property was
> >> removed too. Right-to-Left 
> >>> languages would want it left-aligned.
> >>>
> >>>
> >>> Jacopo Cappellato wrote:
> >>>
> >>>> Please review the attached patch fro the
> >> HtmlFormRenderer class:
> >>>> it simply changes the <td> elements to <th>
> >> elements when used in 
> >>>> headers (for list based forms) and as field
> names
> >> for single forms.
> >>>> Can I commit it?
> >>>>
> >>>> Jacopo
> >>>>
> >>>>
> >>>>
> >
>
------------------------------------------------------------------------
> >>>> Index:
> >
>
framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java
> >
>
===================================================================
> >>>> --- 
> >>>>
> >
>
framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java
> >>    
> >>>> (revision 494101)
> >>>> +++ 
> >>>>
> >
>
framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java
> >>    
> >>>> (working copy)
> >>>> @@ -1170,7 +1170,7 @@
> >>>>       * @see 
> >>>>
> >
>
org.ofbiz.widget.form.FormStringRenderer#renderFormatHeaderRowCellOpen(java.lang.StringBuffer,
> >>>> java.util.Map, org.ofbiz.widget.form.ModelForm,
> 
> >>>> org.ofbiz.widget.form.ModelFormField)
> >>>>       */
> >>>>      public void
> >> renderFormatHeaderRowCellOpen(StringBuffer
> buffer, 
> >>>> Map context, ModelForm modelForm,
> ModelFormField
> >> modelFormField) {
> >>>> -        buffer.append("<td");
> >>>> +        buffer.append("<th align=\"right\"");
> >>>>          String areaStyle =
> >> modelFormField.getTitleAreaStyle();
> >>>>          if
> (UtilValidate.isNotEmpty(areaStyle))
> >> {
> >>>>              buffer.append(" class=\"");
> >>>> @@ -1185,12 +1185,12 @@
> >>>>       * @see 
> >>>>
> >
>
org.ofbiz.widget.form.FormStringRenderer#renderFormatHeaderRowCellClose(java.lang.StringBuffer,
> >>>> java.util.Map, org.ofbiz.widget.form.ModelForm,
> 
> >>>> org.ofbiz.widget.form.ModelFormField)
> >>>>       */
> >>>>      public void
> >> renderFormatHeaderRowCellClose(StringBuffer
> buffer, 
> >>>> Map context, ModelForm modelForm,
> ModelFormField
> >> modelFormField) {
> >>>> -        buffer.append("</td>");
> >>>> +        buffer.append("</th>");
> >>>>          this.appendWhitespace(buffer);
> >>>>      }
> >>>>  
> >>>>      public void
> >> renderFormatHeaderRowFormCellOpen(StringBuffer 
> >>>> buffer, Map context, ModelForm modelForm) {
> >>>> -        buffer.append("<td align=\"center\"");
> >>>> +        buffer.append("<th align=\"center\"");
> >>>>          String areaStyle =
> >> modelForm.getFormTitleAreaStyle();
> >>>>          if
> (UtilValidate.isNotEmpty(areaStyle))
> >> {
> >>>>              buffer.append(" class=\"");
> >>>> @@ -1205,7 +1205,7 @@
> >>>>       * @see 
> >>>>
> >
>
org.ofbiz.widget.form.FormStringRenderer#renderFormatHeaderRowFormCellClose(java.lang.StringBuffer,
> >>>> java.util.Map, org.ofbiz.widget.form.ModelForm)
> >>>>       */
> >>>>      public void
> >> renderFormatHeaderRowFormCellClose(StringBuffer 
> >>>> buffer, Map context, ModelForm modelForm) {
> >>>> -        buffer.append("</td>");
> >>>> +        buffer.append("</th>");
> >>>>          this.appendWhitespace(buffer);
> >>>>      }
> >>>>  
> >>>> @@ -1348,7 +1348,7 @@
> >>>>       * @see 
> >>>>
> >
>
org.ofbiz.widget.form.FormStringRenderer#renderFormatFieldRowTitleCellOpen(java.lang.StringBuffer,
> >>>> java.util.Map,
> >> org.ofbiz.widget.form.ModelFormField)
> >>>>       */
> >>>>      public void
> >> renderFormatFieldRowTitleCellOpen(StringBuffer 
> >>>> buffer, Map context, ModelFormField
> >> modelFormField) {
> >>>> -        buffer.append("<td width=\"20%\"
> >> align=\"right\"");
> >>>> +        buffer.append("<th width=\"20%\"
> >> align=\"right\"");
> >>>>          String areaStyle =
> >> modelFormField.getTitleAreaStyle();
> >>>>          if
> (UtilValidate.isNotEmpty(areaStyle))
> >> {
> >>>>              buffer.append(" class=\"");
> >>>> @@ -1363,7 +1363,7 @@
> >>>>       * @see 
> >>>>
> >
>
org.ofbiz.widget.form.FormStringRenderer#renderFormatFieldRowTitleCellClose(java.lang.StringBuffer,
> >>>> java.util.Map,
> >> org.ofbiz.widget.form.ModelFormField)
> >>>>       */
> >>>>      public void
> >> renderFormatFieldRowTitleCellClose(StringBuffer 
> >>>> buffer, Map context, ModelFormField
> >> modelFormField) {
> >>>> -        buffer.append("</td>");
> >>>> +        buffer.append("</th>");
> >>>>          this.appendWhitespace(buffer);
> >>>>      }
> >>>>  
> >>>
> 
> 


Re: Please review the attached patch fro the HtmlFormRenderer class

Posted by Jacopo Cappellato <ti...@sastau.it>.
Adrian, Chris,

I agree with you that the align attributes should be removed.
However, since there were already many of them in that file, this would 
require a bit more of work (that must be done but maybe at a later task) 
on the css styles definition.

Jacopo


Chris Howe wrote:
> Won't the lines that follow the first change:
> 
>         if (UtilValidate.isNotEmpty(areaStyle)) {
>             buffer.append(" class=\"");
>             buffer.append(areaStyle);
>             buffer.append("\"");
>         }
> handle any additional styling information, including
> text alignment (ie in css: text-align: right;)? And
> then locale specific css can be added to handle
> Adrian's concern. Does the th align=\"right\" simply
> provide a default alignment that the css will be able
> to override or will the attributes for the <th> tag
> take priority over css?  I forget the answer at the
> moment.
> 
> --- Adrian Crum <ad...@hlmksw.com> wrote:
> 
>> Oops, ight-to-Left languages would want it
>> RIGHT-aligned.
>>
>> Adrian Crum wrote:
>>
>>> It would be nice if the 'align' property was
>> removed too. Right-to-Left 
>>> languages would want it left-aligned.
>>>
>>>
>>> Jacopo Cappellato wrote:
>>>
>>>> Please review the attached patch fro the
>> HtmlFormRenderer class:
>>>> it simply changes the <td> elements to <th>
>> elements when used in 
>>>> headers (for list based forms) and as field names
>> for single forms.
>>>> Can I commit it?
>>>>
>>>> Jacopo
>>>>
>>>>
>>>>
> ------------------------------------------------------------------------
>>>> Index:
> framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java
> ===================================================================
>>>> --- 
>>>>
> framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java
>>    
>>>> (revision 494101)
>>>> +++ 
>>>>
> framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java
>>    
>>>> (working copy)
>>>> @@ -1170,7 +1170,7 @@
>>>>       * @see 
>>>>
> org.ofbiz.widget.form.FormStringRenderer#renderFormatHeaderRowCellOpen(java.lang.StringBuffer,
>>>> java.util.Map, org.ofbiz.widget.form.ModelForm, 
>>>> org.ofbiz.widget.form.ModelFormField)
>>>>       */
>>>>      public void
>> renderFormatHeaderRowCellOpen(StringBuffer buffer, 
>>>> Map context, ModelForm modelForm, ModelFormField
>> modelFormField) {
>>>> -        buffer.append("<td");
>>>> +        buffer.append("<th align=\"right\"");
>>>>          String areaStyle =
>> modelFormField.getTitleAreaStyle();
>>>>          if (UtilValidate.isNotEmpty(areaStyle))
>> {
>>>>              buffer.append(" class=\"");
>>>> @@ -1185,12 +1185,12 @@
>>>>       * @see 
>>>>
> org.ofbiz.widget.form.FormStringRenderer#renderFormatHeaderRowCellClose(java.lang.StringBuffer,
>>>> java.util.Map, org.ofbiz.widget.form.ModelForm, 
>>>> org.ofbiz.widget.form.ModelFormField)
>>>>       */
>>>>      public void
>> renderFormatHeaderRowCellClose(StringBuffer buffer, 
>>>> Map context, ModelForm modelForm, ModelFormField
>> modelFormField) {
>>>> -        buffer.append("</td>");
>>>> +        buffer.append("</th>");
>>>>          this.appendWhitespace(buffer);
>>>>      }
>>>>  
>>>>      public void
>> renderFormatHeaderRowFormCellOpen(StringBuffer 
>>>> buffer, Map context, ModelForm modelForm) {
>>>> -        buffer.append("<td align=\"center\"");
>>>> +        buffer.append("<th align=\"center\"");
>>>>          String areaStyle =
>> modelForm.getFormTitleAreaStyle();
>>>>          if (UtilValidate.isNotEmpty(areaStyle))
>> {
>>>>              buffer.append(" class=\"");
>>>> @@ -1205,7 +1205,7 @@
>>>>       * @see 
>>>>
> org.ofbiz.widget.form.FormStringRenderer#renderFormatHeaderRowFormCellClose(java.lang.StringBuffer,
>>>> java.util.Map, org.ofbiz.widget.form.ModelForm)
>>>>       */
>>>>      public void
>> renderFormatHeaderRowFormCellClose(StringBuffer 
>>>> buffer, Map context, ModelForm modelForm) {
>>>> -        buffer.append("</td>");
>>>> +        buffer.append("</th>");
>>>>          this.appendWhitespace(buffer);
>>>>      }
>>>>  
>>>> @@ -1348,7 +1348,7 @@
>>>>       * @see 
>>>>
> org.ofbiz.widget.form.FormStringRenderer#renderFormatFieldRowTitleCellOpen(java.lang.StringBuffer,
>>>> java.util.Map,
>> org.ofbiz.widget.form.ModelFormField)
>>>>       */
>>>>      public void
>> renderFormatFieldRowTitleCellOpen(StringBuffer 
>>>> buffer, Map context, ModelFormField
>> modelFormField) {
>>>> -        buffer.append("<td width=\"20%\"
>> align=\"right\"");
>>>> +        buffer.append("<th width=\"20%\"
>> align=\"right\"");
>>>>          String areaStyle =
>> modelFormField.getTitleAreaStyle();
>>>>          if (UtilValidate.isNotEmpty(areaStyle))
>> {
>>>>              buffer.append(" class=\"");
>>>> @@ -1363,7 +1363,7 @@
>>>>       * @see 
>>>>
> org.ofbiz.widget.form.FormStringRenderer#renderFormatFieldRowTitleCellClose(java.lang.StringBuffer,
>>>> java.util.Map,
>> org.ofbiz.widget.form.ModelFormField)
>>>>       */
>>>>      public void
>> renderFormatFieldRowTitleCellClose(StringBuffer 
>>>> buffer, Map context, ModelFormField
>> modelFormField) {
>>>> -        buffer.append("</td>");
>>>> +        buffer.append("</th>");
>>>>          this.appendWhitespace(buffer);
>>>>      }
>>>>  
>>>


Re: Please review the attached patch fro the HtmlFormRenderer class

Posted by Chris Howe <cj...@yahoo.com>.
Won't the lines that follow the first change:

        if (UtilValidate.isNotEmpty(areaStyle)) {
            buffer.append(" class=\"");
            buffer.append(areaStyle);
            buffer.append("\"");
        }
handle any additional styling information, including
text alignment (ie in css: text-align: right;)? And
then locale specific css can be added to handle
Adrian's concern. Does the th align=\"right\" simply
provide a default alignment that the css will be able
to override or will the attributes for the <th> tag
take priority over css?  I forget the answer at the
moment.

--- Adrian Crum <ad...@hlmksw.com> wrote:

> Oops, ight-to-Left languages would want it
> RIGHT-aligned.
> 
> Adrian Crum wrote:
> 
> > It would be nice if the 'align' property was
> removed too. Right-to-Left 
> > languages would want it left-aligned.
> > 
> > 
> > Jacopo Cappellato wrote:
> > 
> >> Please review the attached patch fro the
> HtmlFormRenderer class:
> >>
> >> it simply changes the <td> elements to <th>
> elements when used in 
> >> headers (for list based forms) and as field names
> for single forms.
> >>
> >> Can I commit it?
> >>
> >> Jacopo
> >>
> >>
> >>
>
------------------------------------------------------------------------
> >>
> >> Index:
>
framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java
> >>
>
===================================================================
> >> --- 
> >>
>
framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java
>    
> >> (revision 494101)
> >> +++ 
> >>
>
framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java
>    
> >> (working copy)
> >> @@ -1170,7 +1170,7 @@
> >>       * @see 
> >>
>
org.ofbiz.widget.form.FormStringRenderer#renderFormatHeaderRowCellOpen(java.lang.StringBuffer,
> 
> >> java.util.Map, org.ofbiz.widget.form.ModelForm, 
> >> org.ofbiz.widget.form.ModelFormField)
> >>       */
> >>      public void
> renderFormatHeaderRowCellOpen(StringBuffer buffer, 
> >> Map context, ModelForm modelForm, ModelFormField
> modelFormField) {
> >> -        buffer.append("<td");
> >> +        buffer.append("<th align=\"right\"");
> >>          String areaStyle =
> modelFormField.getTitleAreaStyle();
> >>          if (UtilValidate.isNotEmpty(areaStyle))
> {
> >>              buffer.append(" class=\"");
> >> @@ -1185,12 +1185,12 @@
> >>       * @see 
> >>
>
org.ofbiz.widget.form.FormStringRenderer#renderFormatHeaderRowCellClose(java.lang.StringBuffer,
> 
> >> java.util.Map, org.ofbiz.widget.form.ModelForm, 
> >> org.ofbiz.widget.form.ModelFormField)
> >>       */
> >>      public void
> renderFormatHeaderRowCellClose(StringBuffer buffer, 
> >> Map context, ModelForm modelForm, ModelFormField
> modelFormField) {
> >> -        buffer.append("</td>");
> >> +        buffer.append("</th>");
> >>          this.appendWhitespace(buffer);
> >>      }
> >>  
> >>      public void
> renderFormatHeaderRowFormCellOpen(StringBuffer 
> >> buffer, Map context, ModelForm modelForm) {
> >> -        buffer.append("<td align=\"center\"");
> >> +        buffer.append("<th align=\"center\"");
> >>          String areaStyle =
> modelForm.getFormTitleAreaStyle();
> >>          if (UtilValidate.isNotEmpty(areaStyle))
> {
> >>              buffer.append(" class=\"");
> >> @@ -1205,7 +1205,7 @@
> >>       * @see 
> >>
>
org.ofbiz.widget.form.FormStringRenderer#renderFormatHeaderRowFormCellClose(java.lang.StringBuffer,
> 
> >> java.util.Map, org.ofbiz.widget.form.ModelForm)
> >>       */
> >>      public void
> renderFormatHeaderRowFormCellClose(StringBuffer 
> >> buffer, Map context, ModelForm modelForm) {
> >> -        buffer.append("</td>");
> >> +        buffer.append("</th>");
> >>          this.appendWhitespace(buffer);
> >>      }
> >>  
> >> @@ -1348,7 +1348,7 @@
> >>       * @see 
> >>
>
org.ofbiz.widget.form.FormStringRenderer#renderFormatFieldRowTitleCellOpen(java.lang.StringBuffer,
> 
> >> java.util.Map,
> org.ofbiz.widget.form.ModelFormField)
> >>       */
> >>      public void
> renderFormatFieldRowTitleCellOpen(StringBuffer 
> >> buffer, Map context, ModelFormField
> modelFormField) {
> >> -        buffer.append("<td width=\"20%\"
> align=\"right\"");
> >> +        buffer.append("<th width=\"20%\"
> align=\"right\"");
> >>          String areaStyle =
> modelFormField.getTitleAreaStyle();
> >>          if (UtilValidate.isNotEmpty(areaStyle))
> {
> >>              buffer.append(" class=\"");
> >> @@ -1363,7 +1363,7 @@
> >>       * @see 
> >>
>
org.ofbiz.widget.form.FormStringRenderer#renderFormatFieldRowTitleCellClose(java.lang.StringBuffer,
> 
> >> java.util.Map,
> org.ofbiz.widget.form.ModelFormField)
> >>       */
> >>      public void
> renderFormatFieldRowTitleCellClose(StringBuffer 
> >> buffer, Map context, ModelFormField
> modelFormField) {
> >> -        buffer.append("</td>");
> >> +        buffer.append("</th>");
> >>          this.appendWhitespace(buffer);
> >>      }
> >>  
> > 
> > 
> 


Re: Please review the attached patch fro the HtmlFormRenderer class

Posted by Adrian Crum <ad...@hlmksw.com>.
Oops, ight-to-Left languages would want it RIGHT-aligned.

Adrian Crum wrote:

> It would be nice if the 'align' property was removed too. Right-to-Left 
> languages would want it left-aligned.
> 
> 
> Jacopo Cappellato wrote:
> 
>> Please review the attached patch fro the HtmlFormRenderer class:
>>
>> it simply changes the <td> elements to <th> elements when used in 
>> headers (for list based forms) and as field names for single forms.
>>
>> Can I commit it?
>>
>> Jacopo
>>
>>
>> ------------------------------------------------------------------------
>>
>> Index: framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java
>> ===================================================================
>> --- 
>> framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java    
>> (revision 494101)
>> +++ 
>> framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java    
>> (working copy)
>> @@ -1170,7 +1170,7 @@
>>       * @see 
>> org.ofbiz.widget.form.FormStringRenderer#renderFormatHeaderRowCellOpen(java.lang.StringBuffer, 
>> java.util.Map, org.ofbiz.widget.form.ModelForm, 
>> org.ofbiz.widget.form.ModelFormField)
>>       */
>>      public void renderFormatHeaderRowCellOpen(StringBuffer buffer, 
>> Map context, ModelForm modelForm, ModelFormField modelFormField) {
>> -        buffer.append("<td");
>> +        buffer.append("<th align=\"right\"");
>>          String areaStyle = modelFormField.getTitleAreaStyle();
>>          if (UtilValidate.isNotEmpty(areaStyle)) {
>>              buffer.append(" class=\"");
>> @@ -1185,12 +1185,12 @@
>>       * @see 
>> org.ofbiz.widget.form.FormStringRenderer#renderFormatHeaderRowCellClose(java.lang.StringBuffer, 
>> java.util.Map, org.ofbiz.widget.form.ModelForm, 
>> org.ofbiz.widget.form.ModelFormField)
>>       */
>>      public void renderFormatHeaderRowCellClose(StringBuffer buffer, 
>> Map context, ModelForm modelForm, ModelFormField modelFormField) {
>> -        buffer.append("</td>");
>> +        buffer.append("</th>");
>>          this.appendWhitespace(buffer);
>>      }
>>  
>>      public void renderFormatHeaderRowFormCellOpen(StringBuffer 
>> buffer, Map context, ModelForm modelForm) {
>> -        buffer.append("<td align=\"center\"");
>> +        buffer.append("<th align=\"center\"");
>>          String areaStyle = modelForm.getFormTitleAreaStyle();
>>          if (UtilValidate.isNotEmpty(areaStyle)) {
>>              buffer.append(" class=\"");
>> @@ -1205,7 +1205,7 @@
>>       * @see 
>> org.ofbiz.widget.form.FormStringRenderer#renderFormatHeaderRowFormCellClose(java.lang.StringBuffer, 
>> java.util.Map, org.ofbiz.widget.form.ModelForm)
>>       */
>>      public void renderFormatHeaderRowFormCellClose(StringBuffer 
>> buffer, Map context, ModelForm modelForm) {
>> -        buffer.append("</td>");
>> +        buffer.append("</th>");
>>          this.appendWhitespace(buffer);
>>      }
>>  
>> @@ -1348,7 +1348,7 @@
>>       * @see 
>> org.ofbiz.widget.form.FormStringRenderer#renderFormatFieldRowTitleCellOpen(java.lang.StringBuffer, 
>> java.util.Map, org.ofbiz.widget.form.ModelFormField)
>>       */
>>      public void renderFormatFieldRowTitleCellOpen(StringBuffer 
>> buffer, Map context, ModelFormField modelFormField) {
>> -        buffer.append("<td width=\"20%\" align=\"right\"");
>> +        buffer.append("<th width=\"20%\" align=\"right\"");
>>          String areaStyle = modelFormField.getTitleAreaStyle();
>>          if (UtilValidate.isNotEmpty(areaStyle)) {
>>              buffer.append(" class=\"");
>> @@ -1363,7 +1363,7 @@
>>       * @see 
>> org.ofbiz.widget.form.FormStringRenderer#renderFormatFieldRowTitleCellClose(java.lang.StringBuffer, 
>> java.util.Map, org.ofbiz.widget.form.ModelFormField)
>>       */
>>      public void renderFormatFieldRowTitleCellClose(StringBuffer 
>> buffer, Map context, ModelFormField modelFormField) {
>> -        buffer.append("</td>");
>> +        buffer.append("</th>");
>>          this.appendWhitespace(buffer);
>>      }
>>  
> 
> 

Re: Please review the attached patch fro the HtmlFormRenderer class

Posted by Adrian Crum <ad...@hlmksw.com>.
It would be nice if the 'align' property was removed too. Right-to-Left 
languages would want it left-aligned.


Jacopo Cappellato wrote:

> Please review the attached patch fro the HtmlFormRenderer class:
> 
> it simply changes the <td> elements to <th> elements when used in 
> headers (for list based forms) and as field names for single forms.
> 
> Can I commit it?
> 
> Jacopo
> 
> 
> ------------------------------------------------------------------------
> 
> Index: framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java
> ===================================================================
> --- framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java	(revision 494101)
> +++ framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java	(working copy)
> @@ -1170,7 +1170,7 @@
>       * @see org.ofbiz.widget.form.FormStringRenderer#renderFormatHeaderRowCellOpen(java.lang.StringBuffer, java.util.Map, org.ofbiz.widget.form.ModelForm, org.ofbiz.widget.form.ModelFormField)
>       */
>      public void renderFormatHeaderRowCellOpen(StringBuffer buffer, Map context, ModelForm modelForm, ModelFormField modelFormField) {
> -        buffer.append("<td");
> +        buffer.append("<th align=\"right\"");
>          String areaStyle = modelFormField.getTitleAreaStyle();
>          if (UtilValidate.isNotEmpty(areaStyle)) {
>              buffer.append(" class=\"");
> @@ -1185,12 +1185,12 @@
>       * @see org.ofbiz.widget.form.FormStringRenderer#renderFormatHeaderRowCellClose(java.lang.StringBuffer, java.util.Map, org.ofbiz.widget.form.ModelForm, org.ofbiz.widget.form.ModelFormField)
>       */
>      public void renderFormatHeaderRowCellClose(StringBuffer buffer, Map context, ModelForm modelForm, ModelFormField modelFormField) {
> -        buffer.append("</td>");
> +        buffer.append("</th>");
>          this.appendWhitespace(buffer);
>      }
>  
>      public void renderFormatHeaderRowFormCellOpen(StringBuffer buffer, Map context, ModelForm modelForm) {
> -        buffer.append("<td align=\"center\"");
> +        buffer.append("<th align=\"center\"");
>          String areaStyle = modelForm.getFormTitleAreaStyle();
>          if (UtilValidate.isNotEmpty(areaStyle)) {
>              buffer.append(" class=\"");
> @@ -1205,7 +1205,7 @@
>       * @see org.ofbiz.widget.form.FormStringRenderer#renderFormatHeaderRowFormCellClose(java.lang.StringBuffer, java.util.Map, org.ofbiz.widget.form.ModelForm)
>       */
>      public void renderFormatHeaderRowFormCellClose(StringBuffer buffer, Map context, ModelForm modelForm) {
> -        buffer.append("</td>");
> +        buffer.append("</th>");
>          this.appendWhitespace(buffer);
>      }
>  
> @@ -1348,7 +1348,7 @@
>       * @see org.ofbiz.widget.form.FormStringRenderer#renderFormatFieldRowTitleCellOpen(java.lang.StringBuffer, java.util.Map, org.ofbiz.widget.form.ModelFormField)
>       */
>      public void renderFormatFieldRowTitleCellOpen(StringBuffer buffer, Map context, ModelFormField modelFormField) {
> -        buffer.append("<td width=\"20%\" align=\"right\"");
> +        buffer.append("<th width=\"20%\" align=\"right\"");
>          String areaStyle = modelFormField.getTitleAreaStyle();
>          if (UtilValidate.isNotEmpty(areaStyle)) {
>              buffer.append(" class=\"");
> @@ -1363,7 +1363,7 @@
>       * @see org.ofbiz.widget.form.FormStringRenderer#renderFormatFieldRowTitleCellClose(java.lang.StringBuffer, java.util.Map, org.ofbiz.widget.form.ModelFormField)
>       */
>      public void renderFormatFieldRowTitleCellClose(StringBuffer buffer, Map context, ModelFormField modelFormField) {
> -        buffer.append("</td>");
> +        buffer.append("</th>");
>          this.appendWhitespace(buffer);
>      }
>