You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Adam Heath <do...@brainfood.com> on 2008/08/16 04:58:09 UTC

IterateSectionWidget.renderNextPrev

This method does not allow for [Previous] and [Next] to be translated.

Re: IterateSectionWidget.renderNextPrev

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

Completed: At revision: 687675  (from your last one with larger email width)

Jacques

From: "Bilgin Ibryam" <bi...@iguanait.com>
> On Sat, 2008-08-16 at 21:31 +0200, Jacques Le Roux wrote: 
>> I made this patch but I did not find a way to test it (tried many, then ran out of time)
>> 
> Jacques, I test it in party manager -> fin accounts. It work.
> You may add also this:
> 
> Index:
> framework/widget/src/org/ofbiz/widget/screen/IterateSectionWidget.java
> ===================================================================
> ---
> framework/widget/src/org/ofbiz/widget/screen/IterateSectionWidget.java
> (revision 687614)
> +++
> framework/widget/src/org/ofbiz/widget/screen/IterateSectionWidget.java
> (working copy)
> @@ -340,7 +340,8 @@
> 
>         }
>         if (listSize > 0) {
> -            writer.append("          <span class=\"tabletext\">" +
> (lowIndex + 1) + " - " + (lowIndex + actualPageSize) + " of " + listSize
> + "</span> \n");
> +            String ofLabel =
> UtilProperties.getMessage("CommonUiLabels", "CommonOf", (Locale)
> context.get("locale"));
> +            writer.append(" <span class=\"tabletext\">" + (lowIndex +
> 1) + " - " + (lowIndex + actualPageSize) + " "+ ofLabel + " " + listSize
> + "</span> \n");
>         }
>         if (highIndex < listSize) {
>             writer.append(" <a href=\"");
> 
> 
> 
> Bilgin
>

Re: IterateSectionWidget.renderNextPrev

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

I tried to re-create your patch (truncated in multi-lines in email) but failed. Could you please create a Jira issue or send it with 
a larger email width ? I personnlaly use the larger I can : 132 char.

Thanks

Jacques

From: "Bilgin Ibryam" <bi...@iguanait.com>
> On Sat, 2008-08-16 at 21:31 +0200, Jacques Le Roux wrote:
>> I made this patch but I did not find a way to test it (tried many, then ran out of time)
>>
> Jacques, I test it in party manager -> fin accounts. It work.
> You may add also this:
>
> Index:
> framework/widget/src/org/ofbiz/widget/screen/IterateSectionWidget.java
> ===================================================================
> ---
> framework/widget/src/org/ofbiz/widget/screen/IterateSectionWidget.java
> (revision 687614)
> +++
> framework/widget/src/org/ofbiz/widget/screen/IterateSectionWidget.java
> (working copy)
> @@ -340,7 +340,8 @@
>
>         }
>         if (listSize > 0) {
> -            writer.append("          <span class=\"tabletext\">" +
> (lowIndex + 1) + " - " + (lowIndex + actualPageSize) + " of " + listSize
> + "</span> \n");
> +            String ofLabel =
> UtilProperties.getMessage("CommonUiLabels", "CommonOf", (Locale)
> context.get("locale"));
> +            writer.append(" <span class=\"tabletext\">" + (lowIndex +
> 1) + " - " + (lowIndex + actualPageSize) + " "+ ofLabel + " " + listSize
> + "</span> \n");
>         }
>         if (highIndex < listSize) {
>             writer.append(" <a href=\"");
>
>
>
> Bilgin
> 


Re: IterateSectionWidget.renderNextPrev

Posted by Bilgin Ibryam <bi...@iguanait.com>.
On Sat, 2008-08-16 at 21:31 +0200, Jacques Le Roux wrote: 
> I made this patch but I did not find a way to test it (tried many, then ran out of time)
> 
Jacques, I test it in party manager -> fin accounts. It work.
You may add also this:

Index:
framework/widget/src/org/ofbiz/widget/screen/IterateSectionWidget.java
===================================================================
---
framework/widget/src/org/ofbiz/widget/screen/IterateSectionWidget.java
(revision 687614)
+++
framework/widget/src/org/ofbiz/widget/screen/IterateSectionWidget.java
(working copy)
@@ -340,7 +340,8 @@

         }
         if (listSize > 0) {
-            writer.append("          <span class=\"tabletext\">" +
(lowIndex + 1) + " - " + (lowIndex + actualPageSize) + " of " + listSize
+ "</span> \n");
+            String ofLabel =
UtilProperties.getMessage("CommonUiLabels", "CommonOf", (Locale)
context.get("locale"));
+            writer.append(" <span class=\"tabletext\">" + (lowIndex +
1) + " - " + (lowIndex + actualPageSize) + " "+ ofLabel + " " + listSize
+ "</span> \n");
         }
         if (highIndex < listSize) {
             writer.append(" <a href=\"");



Bilgin


Re: IterateSectionWidget.renderNextPrev

Posted by Jacques Le Roux <ja...@les7arts.com>.
I made this patch but I did not find a way to test it (tried many, then ran out of time)

Index: framework/widget/src/org/ofbiz/widget/screen/IterateSectionWidget.java
===================================================================
--- framework/widget/src/org/ofbiz/widget/screen/IterateSectionWidget.java (revision 686461)
+++ framework/widget/src/org/ofbiz/widget/screen/IterateSectionWidget.java (working copy)
@@ -23,6 +23,7 @@
 import java.util.Arrays;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Locale;
 import java.util.Map;
 import java.util.Set;
 
@@ -32,6 +33,7 @@
 
 import org.ofbiz.base.util.Debug;
 import org.ofbiz.base.util.GeneralException;
+import org.ofbiz.base.util.UtilProperties;
 import org.ofbiz.base.util.UtilValidate;
 import org.ofbiz.base.util.UtilXml;
 import org.ofbiz.base.util.collections.FlexibleMapAccessor;
@@ -332,8 +334,9 @@
             linkText += "VIEW_SIZE=" + viewSize + "&amp;VIEW_INDEX=" + (viewIndex - 1) + "\"";
 
             // make the link
-            writer.append(rh.makeLink(request, response, linkText, false, false, false));
-            writer.append(" class=\"buttontext\">[Previous]</a>\n");
+            writer.append(rh.makeLink(request, response, linkText, false, false, false));           
+            String previous = UtilProperties.getMessage("CommonUiLabels", "CommonPrevious", (Locale) context.get("locale"));
+            writer.append(" class=\"buttontext\">[" + previous +"]</a>\n");
 
         }
         if (listSize > 0) {
@@ -348,7 +351,8 @@
 
             // make the link
             writer.append(rh.makeLink(request, response, linkText, false, false, false));
-            writer.append(" class=\"buttontext\">[Next]</a>\n");
+            String next = UtilProperties.getMessage("CommonUiLabels", "CommonNext", (Locale) context.get("locale"));
+            writer.append(" class=\"buttontext\">[" + next +"]</a>\n");
 
         }
         writer.append("      </b>\n");

FWIW

Jacques

From: "Adam Heath" <do...@brainfood.com>
> This method does not allow for [Previous] and [Next] to be translated.
>