On Fri, 2008-08-22 at 14:24 +0200, Jacques Le Roux wrote:
> I wrote this
>
> Index: framework/common/config/CommonUiLabels.xml
> ===================================================================
> --- framework/common/config/CommonUiLabels.xml (revision 687584)
> +++ framework/common/config/CommonUiLabels.xml (working copy)
> @@ -1705,6 +1705,10 @@
> <value xml:lang="zh_CN">�用</value>
> <value xml:lang="zh">æ— æ•ˆ</value>
> </property>
> + <property key="CommonDisplaying">
> + <value xml:lang="en">Displaying ${lowCount} - ${highCount} of
> ${total}</value>
> + <value xml:lang="fr">Affichage de ${lowCount} Ã ${highCount} sur
> ${total}</value>
> + </property>
> <property key="CommonDistance">
> <value xml:lang="ar">مساÙ?Ø©</value>
> <value xml:lang="de">Distanz</value>
> Index: framework/widget/src/org/ofbiz/widget/screen/IterateSectionWidget.java
> ===================================================================
> --- framework/widget/src/org/ofbiz/widget/screen/IterateSectionWidget.java
> (revision 687675)
> +++ framework/widget/src/org/ofbiz/widget/screen/IterateSectionWidget.java
> (working copy)
> @@ -340,8 +340,11 @@
>
> }
> if (listSize > 0) {
> - String ofLabel = UtilProperties.getMessage("CommonUiLabels",
> "CommonOf", (Locale) context.get("locale"));
> - writer.append(" <span class=\"tabletext\">" + (lowIndex + 1) + "
> - " + (lowIndex + actualPageSize) + " "+ ofLabel + " "
> + listSize + "</span> \n");
> + @SuppressWarnings("unused") int lowCount = lowIndex + 1;
> + @SuppressWarnings("unused") int highCount = lowIndex +
> actualPageSize;
> + @SuppressWarnings("unused") int total = listSize;
> + String commonDisplaying =
> UtilProperties.getMessage("CommonUiLabels", "CommonDisplaying", (Locale)
> context.get("locale"));
> + writer.append(" <span class=\"tabletext\">" + commonDisplaying +
> "</span> \n");
> }
> if (highIndex < listSize) {
> writer.append(" <a href=\"");
>
> But I'm still unsure how to test it. Bilgin spoke about party manager -> fin
> accounts but then you are in accouting and I guess I
> miss some data he has.
>
> Jacques
Jacques,
it is not very easy to see iterate section with page numbers.
you have to create few fin accounts for a party and then a screenlet with
iterate section for fin accounts will appear in party -> profile screen.
But even then you can not see the page numbers. To see them you have to add the
following attributes to iterate-section element: paginate="true" , view-size,
paginate-target
(I will create a jira issue to change DEFAULT_PAGE_SIZE from 100 to 10, as it
is in form pagination).
Finally you have to modify your code as shown bellow.
Thanks for working on this.
Index: framework/widget/src/org/ofbiz/widget/screen/IterateSectionWidget.java
===================================================================
--- framework/widget/src/org/ofbiz/widget/screen/IterateSectionWidget.java
(revision 688079)
+++ framework/widget/src/org/ofbiz/widget/screen/IterateSectionWidget.java
(working copy)
@@ -33,6 +33,7 @@
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
+import org.ofbiz.base.util.UtilMisc;
import org.ofbiz.base.util.UtilProperties;
import org.ofbiz.base.util.UtilValidate;
import org.ofbiz.base.util.UtilXml;
@@ -340,8 +341,9 @@
}
if (listSize > 0) {
- String ofLabel = UtilProperties.getMessage("CommonUiLabels",
"CommonOf", (Locale) context.get("locale"));
- writer.append(" <span class=\"tabletext\">" + (lowIndex + 1) + " -
" + (lowIndex + actualPageSize) + " "+ ofLabel + " " + listSize + "</span> \n");
+ Map messageMap = UtilMisc.toMap("lowCount",
Integer.valueOf(lowIndex + 1), "highCount", Integer.valueOf(lowIndex +
actualPageSize), "total", Integer.valueOf(listSize));
+ String commonDisplaying =
UtilProperties.getMessage("CommonUiLabels", "CommonDisplaying", messageMap,
(Locale) context.get("locale"));
+ writer.append(" <span class=\"tabletext\">" + commonDisplaying +
"</span> \n");
}
if (highIndex < listSize) {
writer.append(" <a href=\"");