Author: jleroux
Date: Thu Jan 20 14:12:08 2011
New Revision: 1061307
URL: http://svn.apache.org/viewvc?rev=1061307&view=rev
Log:
A patch from Arun Patidar "Some misc issues in ebayStore component."
(https://issues.apache.org/jira/browse/OFBIZ-4118) - OFBIZ-4118
Steps to test issue:
1. Go to ebayStore -> main
2 Select any demo user account and click on submit
3 Click on Export Product Listing tab in menu
4 Search any product from find screen
5 Select product from list and click on Export To Ebay button
6 Select any ebay category from drop down
7 Change event of this select box is not working properly due to blocking of JS.
JLR: I 1st got caught by the surprising behaviour of the eBay Category drop
down (you have to select sub-categs one after the others in the same drop
drow), but yes it works (ie you can publish an OFBiz product in the eBay store)
Modified:
ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/controller.xml
ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/store/ebayApiKeywordSearch.ftl
ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/store/productsearchExport.ftl
Modified:
ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/controller.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/controller.xml?rev=1061307&r1=1061306&r2=1061307&view=diff
==============================================================================
---
ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/controller.xml
(original)
+++
ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/controller.xml
Thu Jan 20 14:12:08 2011
@@ -272,7 +272,7 @@
<request-map uri="retrieveEbayCategoryByParent">
<security https="true" auth="true"/>
<event type="java" path="org.ofbiz.ebaystore.EbayStoreOptions"
invoke="retrieveEbayCategoryByParent"/>
- <response name="success" type="view" value="main"/>
+ <response name="success" type="request" value="json"/>
</request-map>
<request-map uri="retrieveEbayStoreCategoryByParent">
<security https="true" auth="true"/>
Modified:
ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/store/ebayApiKeywordSearch.ftl
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/store/ebayApiKeywordSearch.ftl?rev=1061307&r1=1061306&r2=1061307&view=diff
==============================================================================
---
ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/store/ebayApiKeywordSearch.ftl
(original)
+++
ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/store/ebayApiKeywordSearch.ftl
Thu Jan 20 14:12:08 2011
@@ -47,7 +47,7 @@ under the License.
<h3>${uiLabelMap.ProductAdvancedSearchInCategory}</h3>
</div>
<div class="screenlet-body">
- <form id="productSearchform" method="post"
action="<@ofbizUrl>productsearch</@ofbizUrl>" style="margin: 0;">
+ <form id="productSearchform" method="post"
action="<@ofbizUrl>productsearch</@ofbizUrl>" style="margin: 0;"
name="productSearchform">
<input type="hidden" name="productStoreId"
value="${parameters.productStoreId?if_exists}" />
<fieldset>
<input type="hidden" name="VIEW_SIZE" value="25"/>
@@ -92,7 +92,7 @@ under the License.
</#list>
</select>
<#else>
-
<@htmlTemplate.lookupField="${requestParameters.SEARCH_CATEGORY_ID?if_exists}"
formName="productSearchform" name="SEARCH_CATEGORY_ID" id="searchCategoryId"
fieldFormName="LookupProductCategory"/>
+ <@htmlTemplate.lookupField
value="${requestParameters.SEARCH_CATEGORY_ID?if_exists}"
formName="productSearchform" name="SEARCH_CATEGORY_ID" id="searchCategoryId"
fieldFormName="LookupProductCategory"/>
</#if>
</div>
</td>
Modified:
ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/store/productsearchExport.ftl
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/store/productsearchExport.ftl?rev=1061307&r1=1061306&r2=1061307&view=diff
==============================================================================
---
ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/store/productsearchExport.ftl
(original)
+++
ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/store/productsearchExport.ftl
Thu Jan 20 14:12:08 2011
@@ -81,18 +81,20 @@ under the License.
},
success: function(data) {
document.getElementById('loading').innerHTML = '';
- if(data != null){
- removeOptions(document.getElementById(id));
- var resp = eval("("+data+")");
- var leng = resp.size();
- for (i=0;i<leng;i++) {
- if (i == 0) {
- document.getElementById(id).options[0] = new
Option("${uiLabelMap.CommonPleaseSelect}","");
+ if (data) {
+ removeOptions(id);
+ var resp = eval(data);
+ var leng = resp.length;
+ if (leng) {
+ for (i=0;i<leng;i++) {
+ if (i == 0) {
+ document.getElementById(id).options[0] = new
Option("${uiLabelMap.CommonPleaseSelect}","");
+ }
+ var optVal = resp[i].CategoryCode;
+ var optName = resp[i].CategoryName;
+ var isLeaf = resp[i].IsLeafCategory;
+ document.getElementById(id).options[i+1] = new
Option(optName,optVal+":"+isLeaf);
}
- var optVal = resp[i].CategoryCode;
- var optName = resp[i].CategoryName;
- var isLeaf = resp[i].IsLeafCategory;
- document.getElementById(id).options[i+1] = new
Option(optName,optVal+":"+isLeaf);
}
}
}
@@ -111,10 +113,10 @@ under the License.
removeOptions('theme');
previewPic(":http://pics.ebay.com/aw/pics/vit/None2_sample_100x120.gif");
if(data!=null){
- var resp = eval("("+data+")");
- var leng = resp.size();
+ var resp = eval(data);
+ var leng = resp.length;
var j = 0;
- for (i=0;i<leng+1;i++) {
+ for (i=0;i<leng;i++) {
if (i == 0) {
document.getElementById('theme').options[0] = new
Option("${uiLabelMap.CommonPleaseSelect}","_NA_");
} else {
@@ -130,10 +132,7 @@ under the License.
function removeOptions(id){
var elSel = jQuery("#" + id);
- var i;
- for (i = elSel.length - 1; i>=0; i--) {
- elSel.remove(i);
- }
+ elSel.find('option').remove();
}
function enabledItemTemplate(val){
var field = "enabledTheme";