From 2e1ad5b13513402fa88c44dba83627aaa5d5688d Mon Sep 17 00:00:00 2001 From: Adrian Crum Date: Sat, 29 Jan 2011 02:35:22 +0000 Subject: [PATCH] Fixed Freemarker-generated list navigation introduced in rev 930660. That code never worked. Also fixed some Webtools FindGeneric screen issues. git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1064944 13f79535-47bb-0310-9956-ffa450edef68 --- .../common/webcommon/includes/htmlTemplate.ftl | 13 +++++-------- .../WEB-INF/actions/entity/FindGeneric.groovy | 3 +++ .../webtools/webapp/webtools/entity/FindGeneric.ftl | 7 +++---- .../webtools/webapp/webtools/entity/ListGeneric.ftl | 2 +- framework/webtools/widget/EntityScreens.xml | 10 ++++++---- 5 files changed, 18 insertions(+), 17 deletions(-) diff --git a/framework/common/webcommon/includes/htmlTemplate.ftl b/framework/common/webcommon/includes/htmlTemplate.ftl index b6f752385d..671e89d89d 100644 --- a/framework/common/webcommon/includes/htmlTemplate.ftl +++ b/framework/common/webcommon/includes/htmlTemplate.ftl @@ -61,21 +61,18 @@ under the License. <#if (!previousUrl?has_content)> <#local previousUrl=commonUrl+"VIEW_SIZE=${viewSize}&VIEW_INDEX=${viewIndexPrevious}"/> - <#if (!firstUrl?has_content)> + <#if (!nextUrl?has_content)> <#local nextUrl=commonUrl+"VIEW_SIZE=${viewSize}&VIEW_INDEX=${viewIndexNext}"/> - <#if (!firstUrl?has_content)> + <#if (!lastUrl?has_content)> <#local lastUrl=commonUrl+"VIEW_SIZE=${viewSize}&VIEW_INDEX=${viewIndexLast}"/> - <#if (!firstUrl?has_content)> + <#if (!selectUrl?has_content)> <#local selectUrl=commonUrl+"VIEW_SIZE=${viewSize}&VIEW_INDEX="/> - <#if (!firstUrl?has_content)> + <#if (!selectSizeUrl?has_content)> <#local selectSizeUrl=commonUrl+"VIEW_SIZE='+this.value+'&VIEW_INDEX=0"/> - <#if (!commonDisplaying?has_content)> - <#local commonDisplaying="${lowIndex} - ${highIndex} ${uiLabelMap.CommonOf} ${listSize}"/> - - <@renderNextPrev paginateStyle paginateFirstStyle viewIndex highIndex listSize viewSize ajaxEnabled javaScriptEnabled ajaxFirstUrl firstUrl paginateFirstLabel paginatePreviousStyle ajaxPreviousUrl previousUrl paginatePreviousLabel pageLabel ajaxSelectUrl selectUrl ajaxSelectSizeUrl selectSizeUrl commonDisplaying paginateNextStyle ajaxNextUrl nextUrl paginateNextLabel paginateLastStyle ajaxLastUrl lastUrl paginateLastLabel paginateViewSizeLabel /> + <@renderNextPrev paginateStyle paginateFirstStyle viewIndex highIndex listSize viewSize ajaxEnabled javaScriptEnabled ajaxFirstUrl firstUrl uiLabelMap.CommonFirst paginatePreviousStyle ajaxPreviousUrl previousUrl uiLabelMap.CommonPrevious uiLabelMap.CommonPage ajaxSelectUrl selectUrl ajaxSelectSizeUrl selectSizeUrl commonDisplaying paginateNextStyle ajaxNextUrl nextUrl uiLabelMap.CommonNext paginateLastStyle ajaxLastUrl lastUrl uiLabelMap.CommonLast uiLabelMap.CommonItemsPerPage/> \ No newline at end of file diff --git a/framework/webtools/webapp/webtools/WEB-INF/actions/entity/FindGeneric.groovy b/framework/webtools/webapp/webtools/WEB-INF/actions/entity/FindGeneric.groovy index 129b46ae09..e4853bf4a8 100644 --- a/framework/webtools/webapp/webtools/WEB-INF/actions/entity/FindGeneric.groovy +++ b/framework/webtools/webapp/webtools/WEB-INF/actions/entity/FindGeneric.groovy @@ -246,3 +246,6 @@ if (resultPartialList != null) { } } context.records = records; +context.lowCount = lowIndex; +context.highCount = lowIndex + records.size() - 1; +context.total = arraySize; diff --git a/framework/webtools/webapp/webtools/entity/FindGeneric.ftl b/framework/webtools/webapp/webtools/entity/FindGeneric.ftl index 790f61e509..71d0fe460b 100644 --- a/framework/webtools/webapp/webtools/entity/FindGeneric.ftl +++ b/framework/webtools/webapp/webtools/entity/FindGeneric.ftl @@ -18,22 +18,21 @@ under the License. -->
- + +
- <#assign alt_row = false> <#list fieldList as field> - class="alternate-row"> + - <#assign alt_row = !alt_row> diff --git a/framework/webtools/webapp/webtools/entity/ListGeneric.ftl b/framework/webtools/webapp/webtools/entity/ListGeneric.ftl index b3f10393da..802398ff60 100644 --- a/framework/webtools/webapp/webtools/entity/ListGeneric.ftl +++ b/framework/webtools/webapp/webtools/entity/ListGeneric.ftl @@ -18,7 +18,7 @@ under the License. --> <#if (arraySize > 0)> <#assign commonUrl="FindGeneric?${curFindString}&searchOptions_collapsed=${(parameters.searchOptions_collapsed)?default(\"false\")}&"/> - <@htmlTemplate.nextPrev commonUrl=commonUrl listSize=arraySize viewSize=viewSize viewIndex=viewIndex highIndex=highIndex /> + <@htmlTemplate.nextPrev commonUrl=commonUrl listSize=arraySize viewSize=viewSize viewIndex=viewIndex highIndex=highIndex commonDisplaying=commonDisplaying/>
${uiLabelMap.WebtoolsFieldName} ${uiLabelMap.WebtoolsPk} ${uiLabelMap.WebtoolsFieldType}  
${field.name} <#if field.isPk == 'Y'>* ${field.javaType}, ${field.sqlType}

${uiLabelMap.WebtoolsToFindAll} ${entityName}, ${uiLabelMap.WebtoolsLeaveAllEntriesBlank}

diff --git a/framework/webtools/widget/EntityScreens.xml b/framework/webtools/widget/EntityScreens.xml index e668602ff7..caa63ee809 100644 --- a/framework/webtools/widget/EntityScreens.xml +++ b/framework/webtools/widget/EntityScreens.xml @@ -159,20 +159,22 @@ under the License.