You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2010/10/01 10:42:15 UTC

svn commit: r1003434 - /ofbiz/trunk/applications/product/webapp/catalog/product/EditProductQuickAdmin.ftl

Author: jleroux
Date: Fri Oct  1 08:42:15 2010
New Revision: 1003434

URL: http://svn.apache.org/viewvc?rev=1003434&view=rev
Log:
Fixes "Categories removing in Product Quick Admin" (https://issues.apache.org/jira/browse/OFBIZ-3950) - OFBIZ-3950

Modified:
    ofbiz/trunk/applications/product/webapp/catalog/product/EditProductQuickAdmin.ftl

Modified: ofbiz/trunk/applications/product/webapp/catalog/product/EditProductQuickAdmin.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/product/EditProductQuickAdmin.ftl?rev=1003434&r1=1003433&r2=1003434&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/webapp/catalog/product/EditProductQuickAdmin.ftl (original)
+++ ofbiz/trunk/applications/product/webapp/catalog/product/EditProductQuickAdmin.ftl Fri Oct  1 08:42:15 2010
@@ -397,8 +397,15 @@ function doPublish() {
                     <#list productCategoryMembers as prodCatMemb>
                         <#assign prodCat = prodCatMemb.getRelatedOne("ProductCategory")/>
                         <tr valign="middle"<#if rowClass == "1"> class="alternate-row"</#if>>
-                            <td colspan="2"><a href='<@o...@ofbizUrl>' class="buttontext">x</a>
-                            ${prodCat.description?if_exists} ${prodCat.productCategoryId}</td>
+                            <td colspan="2">
+                              <form name="quickAdminRemoveProductFromCategory_${prodCat.productCategoryId}" action="<@o...@ofbizUrl>" method="post">
+                                <input type="hidden" name="productId" value="${prodCatMemb.productId?if_exists}" />
+                                <input type="hidden" name="productCategoryId" value="${prodCatMemb.productCategoryId}" />
+                                <input type="hidden" name="fromDate" value="${prodCatMemb.getString("fromDate")}" />
+                                <a href="javascript:document.quickAdminRemoveProductFromCategory_${prodCat.productCategoryId}.submit();" class="buttontext">x</a>
+                                ${prodCat.description?if_exists} ${prodCat.productCategoryId}
+                              </form>
+                            </td>
                         </tr>
                         <#-- toggle the row color -->
                         <#if rowClass == "2">



Re: svn commit: r1003434 - /ofbiz/trunk/applications/product/webapp/catalog/product/EditProductQuickAdmin.ftl

Posted by Adam Heath <do...@brainfood.com>.
On 10/01/2010 11:18 AM, Jacques Le Roux wrote:
> From: "Adam Heath" <do...@brainfood.com>
>> On 10/01/2010 05:44 AM, Jacques Le Roux wrote:
>>> Scott Gray wrote:
>>>> On 1/10/2010, at 10:39 PM, Jacques Le Roux wrote:
>>>>
>>>>> Jacques Le Roux wrote:
>>>>>> Scott Gray wrote:
>>>>>>> Hi Jacques,
>>>>>>>
>>>>>>> I doubt this will work always with that form name since it is
>>>>>>> possible for a product to belong to the same category multiple
>>>>>>> times. It would be better to use:
>>>>>>> <form
>>>>>>> name="quickAdminRemoveProductFromCategory_${prodCatMemb_index}"
>>>>>>>
>>>>>>> Also you've put a form inside another form which is invalid xhtml.
>>>>>>> The hidden form should be placed below the existing form
>>>>>>> and the list iterated over again.
>>>>>>
>>>>>> Indeed, I will do that again...
>>>>>
>>>>> Done at r1003450, I kept it simple. In jQuery I will anyway refactor
>>>>> it to use asmselect (in both multiple selects in this page)
>>>>>
>>>>> I hate all these freemarker templates :/
>>>>>
>>>>> Jacques
>>>>
>>>> Thanks Jacques, sorry to be a pain but I saw the issues and figured
>>>> you'd want to know since you were fixing a bug in the first
>>>> place.
>>>>
>>>> Regards
>>>> Scott
>>>
>>> Don't misunderstant me Scott, I thank you for that! It's just that it's
>>> a pain to still have FTL templates in the ERP side (and I'm quite sure
>>> some could be replaced in eCommerce too)
>>> I did not thought that a product could use the same category multiple
>>> times. This is indeed possible but does not make much sense to me. What
>>> would be the purpose (apart expired ones, which anyway are expurgated
>>> from this list)?
>>> BTW I found a bug in the Categories screen, when you expire a category,
>>> and the same exists, its sequenceNum is affected to the expired one
>>> https://issues.apache.org/jira/browse/OFBIZ-3973
>>
>> I've got a movie Product that is in Sci-Fi Category, Outer Space
>> Category, Aliens Category, etc.
>
> Yes, but that's different categories, isn'it?

Hmm, right, I missed the 'same category multiple times' that Scott said.

Re: svn commit: r1003434 - /ofbiz/trunk/applications/product/webapp/catalog/product/EditProductQuickAdmin.ftl

Posted by Jacques Le Roux <ja...@les7arts.com>.
From: "Adam Heath" <do...@brainfood.com>
> On 10/01/2010 05:44 AM, Jacques Le Roux wrote:
>> Scott Gray wrote:
>>> On 1/10/2010, at 10:39 PM, Jacques Le Roux wrote:
>>>
>>>> Jacques Le Roux wrote:
>>>>> Scott Gray wrote:
>>>>>> Hi Jacques,
>>>>>>
>>>>>> I doubt this will work always with that form name since it is
>>>>>> possible for a product to belong to the same category multiple
>>>>>> times. It would be better to use:
>>>>>> <form name="quickAdminRemoveProductFromCategory_${prodCatMemb_index}"
>>>>>>
>>>>>> Also you've put a form inside another form which is invalid xhtml.
>>>>>> The hidden form should be placed below the existing form
>>>>>> and the list iterated over again.
>>>>>
>>>>> Indeed, I will do that again...
>>>>
>>>> Done at r1003450, I kept it simple. In jQuery I will anyway refactor
>>>> it to use asmselect (in both multiple selects in this page)
>>>>
>>>> I hate all these freemarker templates :/
>>>>
>>>> Jacques
>>>
>>> Thanks Jacques, sorry to be a pain but I saw the issues and figured
>>> you'd want to know since you were fixing a bug in the first
>>> place.
>>>
>>> Regards
>>> Scott
>>
>> Don't misunderstant me Scott, I thank you for that! It's just that it's
>> a pain to still have FTL templates in the ERP side (and I'm quite sure
>> some could be replaced in eCommerce too)
>> I did not thought that a product could use the same category multiple
>> times. This is indeed possible but does not make much sense to me. What
>> would be the purpose (apart expired ones, which anyway are expurgated
>> from this list)?
>> BTW I found a bug in the Categories screen, when you expire a category,
>> and the same exists, its sequenceNum is affected to the expired one
>> https://issues.apache.org/jira/browse/OFBIZ-3973
> 
> I've got a movie Product that is in Sci-Fi Category, Outer Space 
> Category, Aliens Category, etc.

Yes, but that's different categories, isn'it?

Jacques


Re: svn commit: r1003434 - /ofbiz/trunk/applications/product/webapp/catalog/product/EditProductQuickAdmin.ftl

Posted by Adam Heath <do...@brainfood.com>.
On 10/01/2010 05:44 AM, Jacques Le Roux wrote:
> Scott Gray wrote:
>> On 1/10/2010, at 10:39 PM, Jacques Le Roux wrote:
>>
>>> Jacques Le Roux wrote:
>>>> Scott Gray wrote:
>>>>> Hi Jacques,
>>>>>
>>>>> I doubt this will work always with that form name since it is
>>>>> possible for a product to belong to the same category multiple
>>>>> times. It would be better to use:
>>>>> <form name="quickAdminRemoveProductFromCategory_${prodCatMemb_index}"
>>>>>
>>>>> Also you've put a form inside another form which is invalid xhtml.
>>>>> The hidden form should be placed below the existing form
>>>>> and the list iterated over again.
>>>>
>>>> Indeed, I will do that again...
>>>
>>> Done at r1003450, I kept it simple. In jQuery I will anyway refactor
>>> it to use asmselect (in both multiple selects in this page)
>>>
>>> I hate all these freemarker templates :/
>>>
>>> Jacques
>>
>> Thanks Jacques, sorry to be a pain but I saw the issues and figured
>> you'd want to know since you were fixing a bug in the first
>> place.
>>
>> Regards
>> Scott
>
> Don't misunderstant me Scott, I thank you for that! It's just that it's
> a pain to still have FTL templates in the ERP side (and I'm quite sure
> some could be replaced in eCommerce too)
> I did not thought that a product could use the same category multiple
> times. This is indeed possible but does not make much sense to me. What
> would be the purpose (apart expired ones, which anyway are expurgated
> from this list)?
> BTW I found a bug in the Categories screen, when you expire a category,
> and the same exists, its sequenceNum is affected to the expired one
> https://issues.apache.org/jira/browse/OFBIZ-3973

I've got a movie Product that is in Sci-Fi Category, Outer Space 
Category, Aliens Category, etc.

Re: svn commit: r1003434 - /ofbiz/trunk/applications/product/webapp/catalog/product/EditProductQuickAdmin.ftl

Posted by Jacques Le Roux <ja...@les7arts.com>.
Scott Gray wrote:
> On 1/10/2010, at 10:39 PM, Jacques Le Roux wrote:
>
>> Jacques Le Roux wrote:
>>> Scott Gray wrote:
>>>> Hi Jacques,
>>>>
>>>> I doubt this will work always with that form name since it is possible for a product to belong to the same category multiple
>>>> times.  It would be better to use:
>>>> <form name="quickAdminRemoveProductFromCategory_${prodCatMemb_index}"
>>>>
>>>> Also you've put a form inside another form which is invalid xhtml.  The hidden form should be placed below the existing form
>>>> and the list iterated over again.
>>>
>>> Indeed, I will do that again...
>>
>> Done at r1003450, I kept it simple. In jQuery I will anyway refactor it to use asmselect (in both multiple selects in this page)
>>
>> I hate all these freemarker templates :/
>>
>> Jacques
>
> Thanks Jacques, sorry to be a pain but I saw the issues and figured you'd want to know since you were fixing a bug in the first
> place.
>
> Regards
> Scott

Don't misunderstant me Scott, I thank you for that! It's just that it's a pain to still have FTL templates in the ERP side (and I'm 
quite sure some could be replaced in eCommerce too)
I did not thought that a product could use the same category multiple times. This is indeed possible but does not make much sense to 
me. What would be the purpose (apart expired ones, which anyway are expurgated from this list)?
BTW I found a bug in the Categories screen, when you expire a category, and the same exists, its sequenceNum is affected to the 
expired one https://issues.apache.org/jira/browse/OFBIZ-3973

Jacques

>>
>>> Jacques
>>>
>>>> Regards
>>>> Scott
>>>>
>>>> HotWax Media
>>>> http://www.hotwaxmedia.com
>>>>
>>>> On 1/10/2010, at 9:42 PM, jleroux@apache.org wrote:
>>>>
>>>>> Author: jleroux
>>>>> Date: Fri Oct  1 08:42:15 2010
>>>>> New Revision: 1003434
>>>>>
>>>>> URL: http://svn.apache.org/viewvc?rev=1003434&view=rev
>>>>> Log:
>>>>> Fixes "Categories removing in Product Quick Admin" (https://issues.apache.org/jira/browse/OFBIZ-3950) - OFBIZ-3950
>>>>>
>>>>> Modified:
>>>>>   ofbiz/trunk/applications/product/webapp/catalog/product/EditProductQuickAdmin.ftl
>>>>>
>>>>> Modified: ofbiz/trunk/applications/product/webapp/catalog/product/EditProductQuickAdmin.ftl
>>>>> URL:
>>>>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/product/EditProductQuickAdmin.ftl?rev=1003434&r1=1003433&r2=1003434&view=diff
>>>>> ============================================================================== ---
>>>>> ofbiz/trunk/applications/product/webapp/catalog/product/EditProductQuickAdmin.ftl (original) +++
>>>>> ofbiz/trunk/applications/product/webapp/catalog/product/EditProductQuickAdmin.ftl Fri Oct  1 08:42:15 2010 @@ -397,8 +397,15
>>>>>                    @@ function doPublish() { <#list productCategoryMembers as prodCatMemb>
>>>>>                        <#assign prodCat = prodCatMemb.getRelatedOne("ProductCategory")/>
>>>>>                        <tr valign="middle"<#if rowClass == "1"> class="alternate-row"</#if>>
>>>>> -                            <td colspan="2"><a
>>>>> href='<@o...@ofbizUrl>'
>>>>> class="buttontext">x</a>
>>>>> -                            ${prodCat.description?if_exists} ${prodCat.productCategoryId}</td>
>>>>> +                            <td colspan="2">
>>>>> +                              <form name="quickAdminRemoveProductFromCategory_${prodCat.productCategoryId}"
>>>>> action="<@o...@ofbizUrl>" method="post"> +                                <input
>>>>> type="hidden" name="productId" value="${prodCatMemb.productId?if_exists}" /> +                                <input
>>>>> type="hidden" name="productCategoryId" value="${prodCatMemb.productCategoryId}" /> +                                <input
>>>>> type="hidden" name="fromDate" value="${prodCatMemb.getString("fromDate")}" /> +                                <a
>>>>> href="javascript:document.quickAdminRemoveProductFromCategory_${prodCat.productCategoryId}.submit();"
>>>>> class="buttontext">x</a> + ${prodCat.description?if_exists} ${prodCat.productCategoryId} +
>>>>> </form> +                            </td>
>>>>>                        </tr>
>>>>>                        <#-- toggle the row color -->
>>>>>                        <#if rowClass == "2"> 



Re: svn commit: r1003434 - /ofbiz/trunk/applications/product/webapp/catalog/product/EditProductQuickAdmin.ftl

Posted by Scott Gray <sc...@hotwaxmedia.com>.
On 1/10/2010, at 10:39 PM, Jacques Le Roux wrote:

> Jacques Le Roux wrote:
>> Scott Gray wrote:
>>> Hi Jacques,
>>> 
>>> I doubt this will work always with that form name since it is possible for a product to belong to the same category multiple
>>> times.  It would be better to use:
>>> <form name="quickAdminRemoveProductFromCategory_${prodCatMemb_index}"
>>> 
>>> Also you've put a form inside another form which is invalid xhtml.  The hidden form should be placed below the existing form and
>>> the list iterated over again.
>> 
>> Indeed, I will do that again...
> 
> Done at r1003450, I kept it simple. In jQuery I will anyway refactor it to use asmselect (in both multiple selects in this page)
> 
> I hate all these freemarker templates :/
> 
> Jacques

Thanks Jacques, sorry to be a pain but I saw the issues and figured you'd want to know since you were fixing a bug in the first place.

Regards
Scott

> 
>> Jacques
>> 
>>> Regards
>>> Scott
>>> 
>>> HotWax Media
>>> http://www.hotwaxmedia.com
>>> 
>>> On 1/10/2010, at 9:42 PM, jleroux@apache.org wrote:
>>> 
>>>> Author: jleroux
>>>> Date: Fri Oct  1 08:42:15 2010
>>>> New Revision: 1003434
>>>> 
>>>> URL: http://svn.apache.org/viewvc?rev=1003434&view=rev
>>>> Log:
>>>> Fixes "Categories removing in Product Quick Admin" (https://issues.apache.org/jira/browse/OFBIZ-3950) - OFBIZ-3950
>>>> 
>>>> Modified:
>>>>   ofbiz/trunk/applications/product/webapp/catalog/product/EditProductQuickAdmin.ftl
>>>> 
>>>> Modified: ofbiz/trunk/applications/product/webapp/catalog/product/EditProductQuickAdmin.ftl
>>>> URL:
>>>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/product/EditProductQuickAdmin.ftl?rev=1003434&r1=1003433&r2=1003434&view=diff
>>>> ============================================================================== ---
>>>> ofbiz/trunk/applications/product/webapp/catalog/product/EditProductQuickAdmin.ftl (original) +++
>>>> ofbiz/trunk/applications/product/webapp/catalog/product/EditProductQuickAdmin.ftl Fri Oct  1 08:42:15 2010 @@ -397,8 +397,15 @@
>>>>                    function doPublish() { <#list productCategoryMembers as prodCatMemb>
>>>>                        <#assign prodCat = prodCatMemb.getRelatedOne("ProductCategory")/>
>>>>                        <tr valign="middle"<#if rowClass == "1"> class="alternate-row"</#if>>
>>>> -                            <td colspan="2"><a
>>>> href='<@o...@ofbizUrl>'
>>>> class="buttontext">x</a>
>>>> -                            ${prodCat.description?if_exists} ${prodCat.productCategoryId}</td>
>>>> +                            <td colspan="2">
>>>> +                              <form name="quickAdminRemoveProductFromCategory_${prodCat.productCategoryId}"
>>>> action="<@o...@ofbizUrl>" method="post"> +                                <input
>>>> type="hidden" name="productId" value="${prodCatMemb.productId?if_exists}" /> +                                <input
>>>> type="hidden" name="productCategoryId" value="${prodCatMemb.productCategoryId}" /> +                                <input
>>>> type="hidden" name="fromDate" value="${prodCatMemb.getString("fromDate")}" /> +                                <a
>>>> href="javascript:document.quickAdminRemoveProductFromCategory_${prodCat.productCategoryId}.submit();" class="buttontext">x</a> +
>>>> ${prodCat.description?if_exists} ${prodCat.productCategoryId} +                              </form>
>>>> +                            </td>
>>>>                        </tr>
>>>>                        <#-- toggle the row color -->
>>>>                        <#if rowClass == "2">
> 
> 


Re: svn commit: r1003434 - /ofbiz/trunk/applications/product/webapp/catalog/product/EditProductQuickAdmin.ftl

Posted by Jacques Le Roux <ja...@les7arts.com>.
Jacques Le Roux wrote:
> Scott Gray wrote:
>> Hi Jacques,
>>
>> I doubt this will work always with that form name since it is possible for a product to belong to the same category multiple
>> times.  It would be better to use:
>> <form name="quickAdminRemoveProductFromCategory_${prodCatMemb_index}"
>>
>> Also you've put a form inside another form which is invalid xhtml.  The hidden form should be placed below the existing form and
>> the list iterated over again.
>
> Indeed, I will do that again...

Done at r1003450, I kept it simple. In jQuery I will anyway refactor it to use asmselect (in both multiple selects in this page)

I hate all these freemarker templates :/

Jacques

> Jacques
>
>> Regards
>> Scott
>>
>> HotWax Media
>> http://www.hotwaxmedia.com
>>
>> On 1/10/2010, at 9:42 PM, jleroux@apache.org wrote:
>>
>>> Author: jleroux
>>> Date: Fri Oct  1 08:42:15 2010
>>> New Revision: 1003434
>>>
>>> URL: http://svn.apache.org/viewvc?rev=1003434&view=rev
>>> Log:
>>> Fixes "Categories removing in Product Quick Admin" (https://issues.apache.org/jira/browse/OFBIZ-3950) - OFBIZ-3950
>>>
>>> Modified:
>>>    ofbiz/trunk/applications/product/webapp/catalog/product/EditProductQuickAdmin.ftl
>>>
>>> Modified: ofbiz/trunk/applications/product/webapp/catalog/product/EditProductQuickAdmin.ftl
>>> URL:
>>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/product/EditProductQuickAdmin.ftl?rev=1003434&r1=1003433&r2=1003434&view=diff
>>> ============================================================================== ---
>>> ofbiz/trunk/applications/product/webapp/catalog/product/EditProductQuickAdmin.ftl (original) +++
>>> ofbiz/trunk/applications/product/webapp/catalog/product/EditProductQuickAdmin.ftl Fri Oct  1 08:42:15 2010 @@ -397,8 +397,15 @@
>>>                     function doPublish() { <#list productCategoryMembers as prodCatMemb>
>>>                         <#assign prodCat = prodCatMemb.getRelatedOne("ProductCategory")/>
>>>                         <tr valign="middle"<#if rowClass == "1"> class="alternate-row"</#if>>
>>> -                            <td colspan="2"><a
>>> href='<@o...@ofbizUrl>'
>>> class="buttontext">x</a>
>>> -                            ${prodCat.description?if_exists} ${prodCat.productCategoryId}</td>
>>> +                            <td colspan="2">
>>> +                              <form name="quickAdminRemoveProductFromCategory_${prodCat.productCategoryId}"
>>> action="<@o...@ofbizUrl>" method="post"> +                                <input
>>> type="hidden" name="productId" value="${prodCatMemb.productId?if_exists}" /> +                                <input
>>> type="hidden" name="productCategoryId" value="${prodCatMemb.productCategoryId}" /> +                                <input
>>> type="hidden" name="fromDate" value="${prodCatMemb.getString("fromDate")}" /> +                                <a
>>> href="javascript:document.quickAdminRemoveProductFromCategory_${prodCat.productCategoryId}.submit();" class="buttontext">x</a> +
>>> ${prodCat.description?if_exists} ${prodCat.productCategoryId} +                              </form>
>>> +                            </td>
>>>                         </tr>
>>>                         <#-- toggle the row color -->
>>>                         <#if rowClass == "2">



Re: svn commit: r1003434 - /ofbiz/trunk/applications/product/webapp/catalog/product/EditProductQuickAdmin.ftl

Posted by Jacques Le Roux <ja...@les7arts.com>.
Scott Gray wrote:
> Hi Jacques,
>
> I doubt this will work always with that form name since it is possible for a product to belong to the same category multiple
> times.  It would be better to use:
> <form name="quickAdminRemoveProductFromCategory_${prodCatMemb_index}"
>
> Also you've put a form inside another form which is invalid xhtml.  The hidden form should be placed below the existing form and
> the list iterated over again.

Indeed, I will do that again...

Jacques

> Regards
> Scott
>
> HotWax Media
> http://www.hotwaxmedia.com
>
> On 1/10/2010, at 9:42 PM, jleroux@apache.org wrote:
>
>> Author: jleroux
>> Date: Fri Oct  1 08:42:15 2010
>> New Revision: 1003434
>>
>> URL: http://svn.apache.org/viewvc?rev=1003434&view=rev
>> Log:
>> Fixes "Categories removing in Product Quick Admin" (https://issues.apache.org/jira/browse/OFBIZ-3950) - OFBIZ-3950
>>
>> Modified:
>>    ofbiz/trunk/applications/product/webapp/catalog/product/EditProductQuickAdmin.ftl
>>
>> Modified: ofbiz/trunk/applications/product/webapp/catalog/product/EditProductQuickAdmin.ftl
>> URL:
>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/product/EditProductQuickAdmin.ftl?rev=1003434&r1=1003433&r2=1003434&view=diff
>> ============================================================================== ---
>> ofbiz/trunk/applications/product/webapp/catalog/product/EditProductQuickAdmin.ftl (original) +++
>> ofbiz/trunk/applications/product/webapp/catalog/product/EditProductQuickAdmin.ftl Fri Oct  1 08:42:15 2010 @@ -397,8 +397,15 @@
>>                     function doPublish() { <#list productCategoryMembers as prodCatMemb>
>>                         <#assign prodCat = prodCatMemb.getRelatedOne("ProductCategory")/>
>>                         <tr valign="middle"<#if rowClass == "1"> class="alternate-row"</#if>>
>> -                            <td colspan="2"><a
>> href='<@o...@ofbizUrl>'
>> class="buttontext">x</a>
>> -                            ${prodCat.description?if_exists} ${prodCat.productCategoryId}</td>
>> +                            <td colspan="2">
>> +                              <form name="quickAdminRemoveProductFromCategory_${prodCat.productCategoryId}"
>> action="<@o...@ofbizUrl>" method="post"> +                                <input
>> type="hidden" name="productId" value="${prodCatMemb.productId?if_exists}" /> +                                <input
>> type="hidden" name="productCategoryId" value="${prodCatMemb.productCategoryId}" /> +                                <input
>> type="hidden" name="fromDate" value="${prodCatMemb.getString("fromDate")}" /> +                                <a
>> href="javascript:document.quickAdminRemoveProductFromCategory_${prodCat.productCategoryId}.submit();" class="buttontext">x</a> +
>> ${prodCat.description?if_exists} ${prodCat.productCategoryId} +                              </form>
>> +                            </td>
>>                         </tr>
>>                         <#-- toggle the row color -->
>>                         <#if rowClass == "2"> 



Re: svn commit: r1003434 - /ofbiz/trunk/applications/product/webapp/catalog/product/EditProductQuickAdmin.ftl

Posted by Scott Gray <sc...@hotwaxmedia.com>.
Hi Jacques,

I doubt this will work always with that form name since it is possible for a product to belong to the same category multiple times.  It would be better to use:
<form name="quickAdminRemoveProductFromCategory_${prodCatMemb_index}"

Also you've put a form inside another form which is invalid xhtml.  The hidden form should be placed below the existing form and the list iterated over again.

Regards
Scott

HotWax Media
http://www.hotwaxmedia.com

On 1/10/2010, at 9:42 PM, jleroux@apache.org wrote:

> Author: jleroux
> Date: Fri Oct  1 08:42:15 2010
> New Revision: 1003434
> 
> URL: http://svn.apache.org/viewvc?rev=1003434&view=rev
> Log:
> Fixes "Categories removing in Product Quick Admin" (https://issues.apache.org/jira/browse/OFBIZ-3950) - OFBIZ-3950
> 
> Modified:
>    ofbiz/trunk/applications/product/webapp/catalog/product/EditProductQuickAdmin.ftl
> 
> Modified: ofbiz/trunk/applications/product/webapp/catalog/product/EditProductQuickAdmin.ftl
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/product/EditProductQuickAdmin.ftl?rev=1003434&r1=1003433&r2=1003434&view=diff
> ==============================================================================
> --- ofbiz/trunk/applications/product/webapp/catalog/product/EditProductQuickAdmin.ftl (original)
> +++ ofbiz/trunk/applications/product/webapp/catalog/product/EditProductQuickAdmin.ftl Fri Oct  1 08:42:15 2010
> @@ -397,8 +397,15 @@ function doPublish() {
>                     <#list productCategoryMembers as prodCatMemb>
>                         <#assign prodCat = prodCatMemb.getRelatedOne("ProductCategory")/>
>                         <tr valign="middle"<#if rowClass == "1"> class="alternate-row"</#if>>
> -                            <td colspan="2"><a href='<@o...@ofbizUrl>' class="buttontext">x</a>
> -                            ${prodCat.description?if_exists} ${prodCat.productCategoryId}</td>
> +                            <td colspan="2">
> +                              <form name="quickAdminRemoveProductFromCategory_${prodCat.productCategoryId}" action="<@o...@ofbizUrl>" method="post">
> +                                <input type="hidden" name="productId" value="${prodCatMemb.productId?if_exists}" />
> +                                <input type="hidden" name="productCategoryId" value="${prodCatMemb.productCategoryId}" />
> +                                <input type="hidden" name="fromDate" value="${prodCatMemb.getString("fromDate")}" />
> +                                <a href="javascript:document.quickAdminRemoveProductFromCategory_${prodCat.productCategoryId}.submit();" class="buttontext">x</a>
> +                                ${prodCat.description?if_exists} ${prodCat.productCategoryId}
> +                              </form>
> +                            </td>
>                         </tr>
>                         <#-- toggle the row color -->
>                         <#if rowClass == "2">
> 
>