|
Author: jleroux
Date: Sat Jan 8 16:30:15 2011 New Revision: 1056731 URL: http://svn.apache.org/viewvc?rev=1056731&view=rev Log: Since anyway we rely on a form name in renderLookupField, I changed the way Sascha fixed OFBIZ-4068 (see r1056701) Two reasons to this: # we are not sure the descriptionFieldName is alwayd of the form formName_descriptionFieldName # anyway we need a form name for call_fieldlookup3 and call_fieldlookup2 just above in htmlFormMacroLibrary.ftl. While at it, I also removed all question marks in ${uiLabelMap.ProductIncludeSubCategories}? occurrences, it's already in the labels Modified: ofbiz/trunk/applications/product/webapp/catalog/category/EditCategoryProducts.ftl ofbiz/trunk/applications/product/webapp/catalog/find/advancedsearch.ftl ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl ofbiz/trunk/specialpurpose/ebay/webapp/ebay/find/EbayAdvancedSearch.ftl ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/find/GoogleBaseAdvancedSearch.ftl Modified: ofbiz/trunk/applications/product/webapp/catalog/category/EditCategoryProducts.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/category/EditCategoryProducts.ftl?rev=1056731&r1=1056730&r2=1056731&view=diff ============================================================================== --- ofbiz/trunk/applications/product/webapp/catalog/category/EditCategoryProducts.ftl (original) +++ ofbiz/trunk/applications/product/webapp/catalog/category/EditCategoryProducts.ftl Sat Jan 8 16:30:15 2011 @@ -186,7 +186,7 @@ under the License. <span class="label">${uiLabelMap.ProductOptionalFilterWithDate}</span> <@htmlTemplate.renderDateTimeField name="validDate" event="" action="" className="" alert="" title="Format: yyyy-MM-dd HH:mm:ss.SSS" value="" size="25" maxlength="30" id="validDate1" dateType="date" shortDateInput=false timeDropdownParamName="" defaultDateTimeString="" localizedIconTitle="" timeDropdown="" timeHourName="" classString="" hour1="" hour2="" timeMinutesName="" minutes="" isTwelveHour="" ampmName="" amSelected="" pmSelected="" compositeType="" formName=""/> <br /> - <span class="label">${uiLabelMap.ProductIncludeSubCategories}?</span> + <span class="label">${uiLabelMap.ProductIncludeSubCategories}</span> <select name="recurse"> <option value="N">${uiLabelMap.CommonN}</option> <option value="Y">${uiLabelMap.CommonY}</option> Modified: ofbiz/trunk/applications/product/webapp/catalog/find/advancedsearch.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/find/advancedsearch.ftl?rev=1056731&r1=1056730&r2=1056731&view=diff ============================================================================== --- ofbiz/trunk/applications/product/webapp/catalog/find/advancedsearch.ftl (original) +++ ofbiz/trunk/applications/product/webapp/catalog/find/advancedsearch.ftl Sat Jan 8 16:30:15 2011 @@ -36,7 +36,7 @@ under the License. </td> <td valign="middle"> <div> - <b>"${(searchCategory.description)?if_exists}" [${(searchCategory.productCategoryId)?if_exists}]</b> ${uiLabelMap.ProductIncludeSubCategories}? + <b>"${(searchCategory.description)?if_exists}" [${(searchCategory.productCategoryId)?if_exists}]</b> ${uiLabelMap.ProductIncludeSubCategories} ${uiLabelMap.CommonYes}<input type="radio" name="SEARCH_SUB_CATEGORIES" value="Y" checked="checked" /> ${uiLabelMap.CommonNo}<input type="radio" name="SEARCH_SUB_CATEGORIES" value="N"/> </div> @@ -69,7 +69,7 @@ under the License. <td valign="middle"> <div> <@htmlTemplate.lookupField value="${requestParameters.SEARCH_CATEGORY_ID?if_exists}" formName="advtokeywordsearchform" name="SEARCH_CATEGORY_ID" id="SEARCH_CATEGORY_ID" fieldFormName="LookupProductCategory"/> - ${uiLabelMap.ProductIncludeSubCategories}? + ${uiLabelMap.ProductIncludeSubCategories} ${uiLabelMap.CommonYes}<input type="radio" name="SEARCH_SUB_CATEGORIES" value="Y" checked="checked"/> ${uiLabelMap.CommonNo}<input type="radio" name="SEARCH_SUB_CATEGORIES" value="N"/> ${uiLabelMap.CommonInclude}<input type="radio" name="SEARCH_CATEGORY_EXC" value="" checked="checked"/> Modified: ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl?rev=1056731&r1=1056730&r2=1056731&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl (original) +++ ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl Sat Jan 8 16:30:15 2011 @@ -474,6 +474,13 @@ ${item.description}</span> </#macro> <#macro renderLookupField className alert name value size maxlength id event action disabled autocomplete descriptionFieldName formName fieldFormName targetParameterIter imgSrc ajaxUrl ajaxEnabled presentation width height position fadeBackground clearText showDescription initiallyCollapsed> +<script type="text/javascript"> +jQuery(document).ready(function(){ + if (!jQuery('form[name="${formName}"]').length) { + alert("Developer: for lookups to work you must provide a form name!") + } +}); +</script> <span class="field-lookup"> <#if size?has_content && size=="0"><input type="hidden" <#if name?has_content> name="${name}"/></#if><#else><input type="text" <@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><#rt/><#if disabled?has_content && disabled> disabled="disabled"</#if><#rt/><#if event?has_content && action?has_content> ${event}="${action}"</#if><#rt/><#if autocomplete?has_content> autocomplete="off"</#if>/><#rt/></#if> <#if presentation?has_content && descriptionFieldName?has_content && presentation == "window"> @@ -509,7 +516,7 @@ ${item.description}</span> </#if> <script type="text/javascript"> jQuery(document).ready(function(){ - new ConstructLookup("${fieldFormName}", "${id}", document.getElementById("${id}"), <#if descriptionFieldName?has_content>document.getElementById("${formName}_${descriptionFieldName}")<#else>null</#if>, "${formName?html}", "${width}", "${height}", "${position}", "${fadeBackground}", <#if ajaxEnabled?has_content && ajaxEnabled>"${ajaxUrl}", "${showDescription}"<#else>"", ""</#if>, '${presentation!}'); + new ConstructLookup("${fieldFormName}", "${id}", document.${formName?html}.${name?html}, <#if descriptionFieldName?has_content>document.${formName?html}.${descriptionFieldName}<#else>null</#if>, "${formName?html}", "${width}", "${height}", "${position}", "${fadeBackground}", <#if ajaxEnabled?has_content && ajaxEnabled>"${ajaxUrl}", "${showDescription}"<#else>"", ""</#if>, '${presentation!}'); }); </script> </#if> Modified: ofbiz/trunk/specialpurpose/ebay/webapp/ebay/find/EbayAdvancedSearch.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebay/webapp/ebay/find/EbayAdvancedSearch.ftl?rev=1056731&r1=1056730&r2=1056731&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ebay/webapp/ebay/find/EbayAdvancedSearch.ftl (original) +++ ofbiz/trunk/specialpurpose/ebay/webapp/ebay/find/EbayAdvancedSearch.ftl Sat Jan 8 16:30:15 2011 @@ -72,7 +72,7 @@ under the License. </td> <td valign="middle"> <div> - <b>"${(searchCategory.description)?if_exists}" [${(searchCategory.productCategoryId)?if_exists}]</b> ${uiLabelMap.ProductIncludeSubCategories}? + <b>"${(searchCategory.description)?if_exists}" [${(searchCategory.productCategoryId)?if_exists}]</b> ${uiLabelMap.ProductIncludeSubCategories} ${uiLabelMap.CommonYes}<input type="radio" name="SEARCH_SUB_CATEGORIES" value="Y" checked="checked"/> ${uiLabelMap.CommonNo}<input type="radio" name="SEARCH_SUB_CATEGORIES" value="N"/> </div> @@ -139,7 +139,7 @@ under the License. <#else> <@htmlTemplate.lookupField value="${requestParameters.SEARCH_CATEGORY_ID?if_exists}" formName="advToKeywordSearchform" name="SEARCH_CATEGORY_ID" id="searchCategoryId" fieldFormName="LookupProductCategory"/> </#if> - ${uiLabelMap.ProductIncludeSubCategories}? + ${uiLabelMap.ProductIncludeSubCategories} ${uiLabelMap.CommonYes}<input type="radio" name="SEARCH_SUB_CATEGORIES" value="Y" checked="checked" /> ${uiLabelMap.CommonNo}<input type="radio" name="SEARCH_SUB_CATEGORIES" value="N" /> ${uiLabelMap.CommonInclude}<input type="radio" name="SEARCH_CATEGORY_EXC" value="" checked="checked" /> Modified: ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/find/GoogleBaseAdvancedSearch.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/find/GoogleBaseAdvancedSearch.ftl?rev=1056731&r1=1056730&r2=1056731&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/find/GoogleBaseAdvancedSearch.ftl (original) +++ ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/find/GoogleBaseAdvancedSearch.ftl Sat Jan 8 16:30:15 2011 @@ -58,7 +58,7 @@ under the License. <h3>${uiLabelMap.ProductAdvancedSearchInCategory}</h3> </div> <div class="screenlet-body"> - <form id="advToKeywordSearchform" method="post" action="<@ofbizUrl>keywordsearch</@ofbizUrl>" style="margin: 0;"> + <form name="advToKeywordSearchform" id="advToKeywordSearchform" method="post" action="<@ofbizUrl>keywordsearch</@ofbizUrl>" style="margin: 0;"> <fieldset> <input type="hidden" name="VIEW_SIZE" value="25"/> <input type="hidden" name="PAGING" value="Y"/> @@ -72,7 +72,7 @@ under the License. </td> <td valign="middle"> <div> - <b>"${(searchCategory.description)?if_exists}" [${(searchCategory.productCategoryId)?if_exists}]</b> ${uiLabelMap.ProductIncludeSubCategories}? + <b>"${(searchCategory.description)?if_exists}" [${(searchCategory.productCategoryId)?if_exists}]</b> ${uiLabelMap.ProductIncludeSubCategories} ${uiLabelMap.CommonYes}<input type="radio" name="SEARCH_SUB_CATEGORIES" value="Y" checked="checked"/> ${uiLabelMap.CommonNo}<input type="radio" name="SEARCH_SUB_CATEGORIES" value="N"/> </div> @@ -139,7 +139,7 @@ under the License. <#else> <@htmlTemplate.lookupField value="${requestParameters.SEARCH_CATEGORY_ID?if_exists}" formName="advToKeywordSearchform" name="SEARCH_CATEGORY_ID" id="searchCategoryId" fieldFormName="LookupProductCategory"/> </#if> - ${uiLabelMap.ProductIncludeSubCategories}? + ${uiLabelMap.ProductIncludeSubCategories} ${uiLabelMap.CommonYes}<input type="radio" name="SEARCH_SUB_CATEGORIES" value="Y" checked="checked" /> ${uiLabelMap.CommonNo}<input type="radio" name="SEARCH_SUB_CATEGORIES" value="N" /> ${uiLabelMap.CommonInclude}<input type="radio" name="SEARCH_CATEGORY_EXC" value="" checked="checked" /> |
| Free forum by Nabble | Edit this page |
