Re: svn commit: r831676 - in /ofbiz/trunk/framework: common/config/CommonUiLabels.xml widget/src/org/ofbiz/widget/form/MacroFormRenderer.java widget/src/org/ofbiz/widget/form/ModelForm.java widget/templates/htmlFormMacroLibrary.ftl

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r831676 - in /ofbiz/trunk/framework: common/config/CommonUiLabels.xml widget/src/org/ofbiz/widget/form/MacroFormRenderer.java widget/src/org/ofbiz/widget/form/ModelForm.java widget/templates/htmlFormMacroLibrary.ftl

Matthieu Bollot-4
Hi,
Could someone explain me the patch at the bottom ? more precisely the
"<#if listSize gt 20>". It seems that with a view-size less than 20 (eg:
5), and only 19 results (ie between view-size and 20), there will be no
prev/next stuff.

So, should the condition in htmlFormMacroLibrary be deleted, set to
view-size, or should every view-size be set to something greater than
20, or did I miss something ?

Thanks,
Matthieu.

Le dimanche 01 novembre 2009 à 13:51 +0000, [hidden email] a écrit :

> Modified:
> ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl?rev=831676&r1=831675&r2=831676&view=diff
> ==============================================================================
> --- ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl (original)
> +++ ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl Sun Nov  1 13:51:42 2009
> @@ -422,7 +422,8 @@
>  );"><#rt>
>  <img src="${imgSrc}"width="15" height="14" border="0" alt="Lookup"/></a><#rt>
>  </#macro>
> -<#macro renderNextPrev paginateStyle paginateFirstStyle viewIndex highIndex listSize viewSize ajaxEnabled javaScriptEnabled ajaxFirstUrl firstUrl paginateFirstLabel paginatePreviousStyle ajaxPreviousUrl previousUrl paginatePreviousLabel pageLabel ajaxSelectUrl selectUrl commonDisplaying paginateNextStyle ajaxNextUrl nextUrl paginateNextLabel paginateLastStyle ajaxLastUrl lastUrl paginateLastLabel>
> +<#macro 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>
> +<#if listSize gt 20>
>  <div class="${paginateStyle}">&nbsp; <ul>
>  <li class="${paginateFirstStyle}<#if viewIndex gt 0>"><a href="<#if ajaxEnabled>javascript:ajaxUpdateAreas('${ajaxFirstUrl}')<#else>${firstUrl}</#if>">${paginateFirstLabel}</a><#else>-disabled">${paginateFirstLabel}</#if></li>
>  <li class="${paginatePreviousStyle}<#if viewIndex gt 0>"><a href="<#if ajaxEnabled>javascript:ajaxUpdateAreas('${ajaxPreviousUrl}')<#else>${previousUrl}</#if>">${paginatePreviousLabel}</a><#else>-disabled">${paginatePreviousLabel}</#if></li>
> @@ -432,11 +433,18 @@
>  <#list 1..x as i>
>  <#if i == (viewIndex+1)><option selected="selected" value="<#else><option value="</#if>${i-1}">${i}</option>
>  </#list>
> -</select></li><li>${commonDisplaying}</li>
> -</#if>
> +</select></li></#if>
> +<li>${commonDisplaying}</li>
>  <li class="${paginateNextStyle}<#if highIndex lt listSize>"><a href="<#if ajaxEnabled>javascript:ajaxUpdateAreas('${ajaxNextUrl}')<#else>${nextUrl}</#if>">${paginateNextLabel}</a><#else>-disabled">${paginateNextLabel}</#if></li>
>  <li class="${paginateLastStyle}<#if highIndex lt listSize>"><a href="<#if ajaxEnabled>javascript:ajaxUpdateAreas('${ajaxLastUrl}')<#else>${lastUrl}</#if>">${paginateLastLabel}</a><#else>-disabled">${paginateLastLabel}</#if></li>
> +<#if javaScriptEnabled><li class="nav-pagesize"><select name="pageSize" size="1" onchange="<#if ajaxEnabled>javascript:ajaxUpdateAreas('${ajaxSelectSizeUrl}')<#else>location.href='${selectSizeUrl}';</#if>"><#rt/>
> +<#assign availPageSizes = [20, 30, 50, 100, 200]>
> +<#list availPageSizes as ps>
> +  <option <#if viewSize == ps>selected="selected" </#if> value="${ps}">${ps}</option>
> +</#list>
> +</select> ${paginateViewSizeLabel}</li></#if>
>  </ul></div><br/>
> +</#if>
>  </#macro>
>  <#macro renderFileField className alert name value size maxlength autocomplete><input type="file" <@renderClass className alert /><#if name?has_content> name="${name}"</#if><#if value?has_content> value="${value}"</#if><#if size?has_content> size="${size}"</#if><#if maxlength?has_content> maxlength="${maxlength}"</#if><#if autocomplete?has_content> autocomplete="off"</#if>/><#rt/></#macro>
>  <#macro renderPasswordField className alert name value size maxlength id autocomplete><input type="password" <@renderClass className alert /><#if name?has_content> name="${name}"</#if><#if value?has_content> value="${value}"</#if><#if size?has_content> size="${size}"</#if><#if maxlength?has_content> maxlength="${maxlength}"</#if><#if id?has_content> id="${id}"</#if><#if autocomplete?has_content> autocomplete="off"</#if>/></#macro>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r831676 - in /ofbiz/trunk/framework: common/config/CommonUiLabels.xml widget/src/org/ofbiz/widget/form/MacroFormRenderer.java widget/src/org/ofbiz/widget/form/ModelForm.java widget/templates/htmlFormMacroLibrary.ftl

Divesh Dutta
Hello Matthieu/ Bilgin ,

I think we should not delete the condition. But we can omit hard-coded
check here and use "viewSize" instead. I have created jira issue for
this and also updated the patch for the same. Here is the link:

https://issues.apache.org/jira/browse/OFBIZ-3194

PS: Please commit this patch or give alternate solution for this as soon
as you get time.

Thanks
--
Divesh Dutta.




Matthieu Bollot wrote:

> Hi,
> Could someone explain me the patch at the bottom ? more precisely the
> "<#if listSize gt 20>". It seems that with a view-size less than 20 (eg:
> 5), and only 19 results (ie between view-size and 20), there will be no
> prev/next stuff.
>
> So, should the condition in htmlFormMacroLibrary be deleted, set to
> view-size, or should every view-size be set to something greater than
> 20, or did I miss something ?
>
> Thanks,
> Matthieu.
>
> Le dimanche 01 novembre 2009 à 13:51 +0000, [hidden email] a écrit :
>  
>> Modified:
>> ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl
>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl?rev=831676&r1=831675&r2=831676&view=diff
>> ==============================================================================
>> --- ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl (original)
>> +++ ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl Sun Nov  1 13:51:42 2009
>> @@ -422,7 +422,8 @@
>>  );"><#rt>
>>  <img src="${imgSrc}"width="15" height="14" border="0" alt="Lookup"/></a><#rt>
>>  </#macro>
>> -<#macro renderNextPrev paginateStyle paginateFirstStyle viewIndex highIndex listSize viewSize ajaxEnabled javaScriptEnabled ajaxFirstUrl firstUrl paginateFirstLabel paginatePreviousStyle ajaxPreviousUrl previousUrl paginatePreviousLabel pageLabel ajaxSelectUrl selectUrl commonDisplaying paginateNextStyle ajaxNextUrl nextUrl paginateNextLabel paginateLastStyle ajaxLastUrl lastUrl paginateLastLabel>
>> +<#macro 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>
>> +<#if listSize gt 20>
>>  <div class="${paginateStyle}">&nbsp; <ul>
>>  <li class="${paginateFirstStyle}<#if viewIndex gt 0>"><a href="<#if ajaxEnabled>javascript:ajaxUpdateAreas('${ajaxFirstUrl}')<#else>${firstUrl}</#if>">${paginateFirstLabel}</a><#else>-disabled">${paginateFirstLabel}</#if></li>
>>  <li class="${paginatePreviousStyle}<#if viewIndex gt 0>"><a href="<#if ajaxEnabled>javascript:ajaxUpdateAreas('${ajaxPreviousUrl}')<#else>${previousUrl}</#if>">${paginatePreviousLabel}</a><#else>-disabled">${paginatePreviousLabel}</#if></li>
>> @@ -432,11 +433,18 @@
>>  <#list 1..x as i>
>>  <#if i == (viewIndex+1)><option selected="selected" value="<#else><option value="</#if>${i-1}">${i}</option>
>>  </#list>
>> -</select></li><li>${commonDisplaying}</li>
>> -</#if>
>> +</select></li></#if>
>> +<li>${commonDisplaying}</li>
>>  <li class="${paginateNextStyle}<#if highIndex lt listSize>"><a href="<#if ajaxEnabled>javascript:ajaxUpdateAreas('${ajaxNextUrl}')<#else>${nextUrl}</#if>">${paginateNextLabel}</a><#else>-disabled">${paginateNextLabel}</#if></li>
>>  <li class="${paginateLastStyle}<#if highIndex lt listSize>"><a href="<#if ajaxEnabled>javascript:ajaxUpdateAreas('${ajaxLastUrl}')<#else>${lastUrl}</#if>">${paginateLastLabel}</a><#else>-disabled">${paginateLastLabel}</#if></li>
>> +<#if javaScriptEnabled><li class="nav-pagesize"><select name="pageSize" size="1" onchange="<#if ajaxEnabled>javascript:ajaxUpdateAreas('${ajaxSelectSizeUrl}')<#else>location.href='${selectSizeUrl}';</#if>"><#rt/>
>> +<#assign availPageSizes = [20, 30, 50, 100, 200]>
>> +<#list availPageSizes as ps>
>> +  <option <#if viewSize == ps>selected="selected" </#if> value="${ps}">${ps}</option>
>> +</#list>
>> +</select> ${paginateViewSizeLabel}</li></#if>
>>  </ul></div><br/>
>> +</#if>
>>  </#macro>
>>  <#macro renderFileField className alert name value size maxlength autocomplete><input type="file" <@renderClass className alert /><#if name?has_content> name="${name}"</#if><#if value?has_content> value="${value}"</#if><#if size?has_content> size="${size}"</#if><#if maxlength?has_content> maxlength="${maxlength}"</#if><#if autocomplete?has_content> autocomplete="off"</#if>/><#rt/></#macro>
>>  <#macro renderPasswordField className alert name value size maxlength id autocomplete><input type="password" <@renderClass className alert /><#if name?has_content> name="${name}"</#if><#if value?has_content> value="${value}"</#if><#if size?has_content> size="${size}"</#if><#if maxlength?has_content> maxlength="${maxlength}"</#if><#if id?has_content> id="${id}"</#if><#if autocomplete?has_content> autocomplete="off"</#if>/></#macro>
>>
>>
>>    
>
>
>  

Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r831676 - in /ofbiz/trunk/framework: common/config/CommonUiLabels.xml widget/src/org/ofbiz/widget/form/MacroFormRenderer.java widget/src/org/ofbiz/widget/form/ModelForm.java widget/templates/htmlFormMacroLibrary.ftl

Jacopo Cappellato-4
Thank you Divesh,

your code is in rev. 835925

Jacopo

On Nov 13, 2009, at 5:58 PM, Divesh Dutta wrote:

> Hello Matthieu/ Bilgin ,
>
> I think we should not delete the condition. But we can omit hard-coded check here and use "viewSize" instead. I have created jira issue for this and also updated the patch for the same. Here is the link:
>
> https://issues.apache.org/jira/browse/OFBIZ-3194
>
> PS: Please commit this patch or give alternate solution for this as soon as you get time.
>
> Thanks
> --
> Divesh Dutta.
>
>
>
>
> Matthieu Bollot wrote:
>> Hi,
>> Could someone explain me the patch at the bottom ? more precisely the
>> "<#if listSize gt 20>". It seems that with a view-size less than 20 (eg:
>> 5), and only 19 results (ie between view-size and 20), there will be no
>> prev/next stuff.
>>
>> So, should the condition in htmlFormMacroLibrary be deleted, set to
>> view-size, or should every view-size be set to something greater than
>> 20, or did I miss something ?
>>
>> Thanks,
>> Matthieu.
>>
>> Le dimanche 01 novembre 2009 à 13:51 +0000, [hidden email] a écrit :
>>  
>>> Modified:
>>> ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl
>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl?rev=831676&r1=831675&r2=831676&view=diff
>>> ==============================================================================
>>> --- ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl (original)
>>> +++ ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl Sun Nov  1 13:51:42 2009
>>> @@ -422,7 +422,8 @@
>>> );"><#rt>
>>> <img src="${imgSrc}"width="15" height="14" border="0" alt="Lookup"/></a><#rt>
>>> </#macro>
>>> -<#macro renderNextPrev paginateStyle paginateFirstStyle viewIndex highIndex listSize viewSize ajaxEnabled javaScriptEnabled ajaxFirstUrl firstUrl paginateFirstLabel paginatePreviousStyle ajaxPreviousUrl previousUrl paginatePreviousLabel pageLabel ajaxSelectUrl selectUrl commonDisplaying paginateNextStyle ajaxNextUrl nextUrl paginateNextLabel paginateLastStyle ajaxLastUrl lastUrl paginateLastLabel>
>>> +<#macro 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>
>>> +<#if listSize gt 20>
>>> <div class="${paginateStyle}">&nbsp; <ul>
>>> <li class="${paginateFirstStyle}<#if viewIndex gt 0>"><a href="<#if ajaxEnabled>javascript:ajaxUpdateAreas('${ajaxFirstUrl}')<#else>${firstUrl}</#if>">${paginateFirstLabel}</a><#else>-disabled">${paginateFirstLabel}</#if></li>
>>> <li class="${paginatePreviousStyle}<#if viewIndex gt 0>"><a href="<#if ajaxEnabled>javascript:ajaxUpdateAreas('${ajaxPreviousUrl}')<#else>${previousUrl}</#if>">${paginatePreviousLabel}</a><#else>-disabled">${paginatePreviousLabel}</#if></li>
>>> @@ -432,11 +433,18 @@
>>> <#list 1..x as i>
>>> <#if i == (viewIndex+1)><option selected="selected" value="<#else><option value="</#if>${i-1}">${i}</option>
>>> </#list>
>>> -</select></li><li>${commonDisplaying}</li>
>>> -</#if>
>>> +</select></li></#if>
>>> +<li>${commonDisplaying}</li>
>>> <li class="${paginateNextStyle}<#if highIndex lt listSize>"><a href="<#if ajaxEnabled>javascript:ajaxUpdateAreas('${ajaxNextUrl}')<#else>${nextUrl}</#if>">${paginateNextLabel}</a><#else>-disabled">${paginateNextLabel}</#if></li>
>>> <li class="${paginateLastStyle}<#if highIndex lt listSize>"><a href="<#if ajaxEnabled>javascript:ajaxUpdateAreas('${ajaxLastUrl}')<#else>${lastUrl}</#if>">${paginateLastLabel}</a><#else>-disabled">${paginateLastLabel}</#if></li>
>>> +<#if javaScriptEnabled><li class="nav-pagesize"><select name="pageSize" size="1" onchange="<#if ajaxEnabled>javascript:ajaxUpdateAreas('${ajaxSelectSizeUrl}')<#else>location.href='${selectSizeUrl}';</#if>"><#rt/>
>>> +<#assign availPageSizes = [20, 30, 50, 100, 200]>
>>> +<#list availPageSizes as ps>
>>> +  <option <#if viewSize == ps>selected="selected" </#if> value="${ps}">${ps}</option>
>>> +</#list>
>>> +</select> ${paginateViewSizeLabel}</li></#if>
>>> </ul></div><br/>
>>> +</#if>
>>> </#macro>
>>> <#macro renderFileField className alert name value size maxlength autocomplete><input type="file" <@renderClass className alert /><#if name?has_content> name="${name}"</#if><#if value?has_content> value="${value}"</#if><#if size?has_content> size="${size}"</#if><#if maxlength?has_content> maxlength="${maxlength}"</#if><#if autocomplete?has_content> autocomplete="off"</#if>/><#rt/></#macro>
>>> <#macro renderPasswordField className alert name value size maxlength id autocomplete><input type="password" <@renderClass className alert /><#if name?has_content> name="${name}"</#if><#if value?has_content> value="${value}"</#if><#if size?has_content> size="${size}"</#if><#if maxlength?has_content> maxlength="${maxlength}"</#if><#if id?has_content> id="${id}"</#if><#if autocomplete?has_content> autocomplete="off"</#if>/></#macro>
>>>
>>>
>>>    
>>
>>
>>  
>