Author: jacopoc
Date: Sat Jun 23 22:36:49 2007
New Revision: 550169

URL: http://svn.apache.org/viewvc?view=rev&rev=550169
Log:
This is a poc for the new code and features inplemented in rev. 550168.
I've modified the list form in the Catalog--> Product --> Locations screen to 
show the new features now available in form widgets:
1) each item in the list is split into two different rows (position 1 and 2): 
position 1 is for the facility name, position 2 is for all the remaining 
fields, including input/hidden/buttons that will go in the form
2) since the fields are derived from a service using the auto-fields-service, 
I've used the new attribute 'default-position' to set for them the position2
3) we want to show the field at position 1 (facility name) only when facility 
is different from the previous record: I've used a row-action to set the 
boolean variable (the action uses the new 'previousItem' map that is now 
available in the context and contains the data of the previous item in the 
list) and a use-when attribute


Modified:
    ofbiz/trunk/applications/product/webapp/catalog/product/ProductForms.xml

Modified: 
ofbiz/trunk/applications/product/webapp/catalog/product/ProductForms.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/product/ProductForms.xml?view=diff&rev=550169&r1=550168&r2=550169
==============================================================================
--- ofbiz/trunk/applications/product/webapp/catalog/product/ProductForms.xml 
(original)
+++ ofbiz/trunk/applications/product/webapp/catalog/product/ProductForms.xml 
Sat Jun 23 22:36:49 2007
@@ -273,7 +273,7 @@
         </field>
 
         <field name="submitButton" title="${uiLabelMap.CommonUpdate}"><submit 
button-type="button"/></field>
-        <field name="deleteLink" title="" widget-style="buttontext">
+        <field name="deleteLink" title=" " widget-style="buttontext">
             <hyperlink 
target="deleteProductPrice?productId=${productId}&amp;productPriceTypeId=${productPriceTypeId}&amp;productPricePurposeId=${productPricePurposeId}&amp;currencyUomId=${currencyUomId}&amp;productStoreGroupId=${productStoreGroupId}&amp;fromDate=${fromDate}"
                 description="${uiLabelMap.CommonDelete}" also-hidden="false"/>
         </field>
@@ -1334,17 +1334,19 @@
             <entity-one entity-name="Enumeration" value-name="locationType">
                 <field-map field-name="enumId" 
env-name="facilityLocation.locationTypeEnumId"/>
             </entity-one>
+            <set field="showPosition1" value="${bsh:String 
prev=(String)previousItem.get(&quot;facilityId&quot;);return new 
Boolean(!(prev!=null&amp;&amp;prev.equals(facilityId)));}" type="Boolean"/>
         </row-actions>
-        <auto-fields-service service-name="updateProductFacilityLocation"/>
-        <field name="productId"><hidden/></field>
-        <field name="facilityId">
-            <display-entity entity-name="Facility" 
description="${facilityName} [${facilityId}]" also-hidden="true"/>
+        <auto-fields-service service-name="updateProductFacilityLocation" 
default-position="2"/>
+        <field name="productId" position="2"><hidden/></field>
+        <field name="facilityName" entry-name="facilityId" position="1" 
use-when="showPosition1">
+            <display-entity entity-name="Facility" key-field-name="facilityId" 
description="${facilityName} [${facilityId}]" also-hidden="false"/>
         </field>
-        <field name="locationSeqId">
+        <field name="facilityId" position="2"><hidden/></field>
+        <field name="locationSeqId" position="2">
             <display description="${facilityLocation.areaId} 
${facilityLocation.aisleId} ${facilityLocation.sectionId} 
${facilityLocation.levelId} ${facilityLocation.positionId} [${locationSeqId}] 
(${locationType.description})"/>
         </field>
-        <field name="submitButton" title="${uiLabelMap.CommonUpdate}" 
widget-style="smallSubmit"><submit button-type="button"/></field>
-        <field name="deleteLink" title="" widget-style="buttontext">
+        <field name="submitButton" position="2" 
title="${uiLabelMap.CommonUpdate}"><submit button-type="button"/></field>
+        <field name="deleteLink" position="2" title=" " 
widget-style="buttontext">
             <hyperlink 
target="deleteProductFacilityLocation?productId=${productId}&amp;facilityId=${facilityId}&amp;locationSeqId=${locationSeqId}"
                 description="${uiLabelMap.CommonDelete}" also-hidden="false"/>
         </field>


Reply via email to