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/09/25 22:53:00 UTC

svn commit: r1001314 - in /ofbiz/branches/jquery/framework: common/webcommon/includes/setMultipleSelectJs.ftl webtools/widget/GeoManagementForms.xml

Author: jleroux
Date: Sat Sep 25 20:53:00 2010
New Revision: 1001314

URL: http://svn.apache.org/viewvc?rev=1001314&view=rev
Log:
Simplify initial focus handling. Like I have previously done with dependent drop-downs. We need only initial focus, after would be counter productive cycles consuming.

Modified:
    ofbiz/branches/jquery/framework/common/webcommon/includes/setMultipleSelectJs.ftl
    ofbiz/branches/jquery/framework/webtools/widget/GeoManagementForms.xml

Modified: ofbiz/branches/jquery/framework/common/webcommon/includes/setMultipleSelectJs.ftl
URL: http://svn.apache.org/viewvc/ofbiz/branches/jquery/framework/common/webcommon/includes/setMultipleSelectJs.ftl?rev=1001314&r1=1001313&r2=1001314&view=diff
==============================================================================
--- ofbiz/branches/jquery/framework/common/webcommon/includes/setMultipleSelectJs.ftl (original)
+++ ofbiz/branches/jquery/framework/common/webcommon/includes/setMultipleSelectJs.ftl Sat Sep 25 20:53:00 2010
@@ -36,10 +36,10 @@ jQuery(document).ready(function() {
       
   <#if asm_relatedField?exists> <#-- can be used without related field -->
     // track possible relatedField changes
-    // on initial focus or if the field value changes, select related multi values. 
-    // FIXME : not sure why focus does not work here, must be added as event/action in the multipleSelectForm.relatedField
+    // on initial focus (focus-field-name must be asm_relatedField) or if the field value changes, select related multi values. 
+    typeValue = jQuery('#${asm_typeField}').val();
+    selectMultipleRelatedValues('${asm_requestName}', '${asm_paramKey}', '${asm_relatedField}', '${asm_multipleSelect}', '${asm_type}', typeValue, '${asm_responseName}');
     jQuery("#${asm_relatedField}").bind('change focus', function() {
-      typeValue = jQuery('#${asm_typeField}').val();
       selectMultipleRelatedValues('${asm_requestName}', '${asm_paramKey}', '${asm_relatedField}', '${asm_multipleSelect}', '${asm_type}', typeValue, '${asm_responseName}');
     });
   </#if>

Modified: ofbiz/branches/jquery/framework/webtools/widget/GeoManagementForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jquery/framework/webtools/widget/GeoManagementForms.xml?rev=1001314&r1=1001313&r2=1001314&view=diff
==============================================================================
--- ofbiz/branches/jquery/framework/webtools/widget/GeoManagementForms.xml (original)
+++ ofbiz/branches/jquery/framework/webtools/widget/GeoManagementForms.xml Sat Sep 25 20:53:00 2010
@@ -72,7 +72,7 @@
         <field name="geoIds" title="${uiLabelMap.CommonGeos}">
             <drop-down allow-multiple="true">
                 <entity-options entity-name="Geo" key-field-name="geoId" description="${geoName} (${geoId})">
-                    <!--entity-constraint name="geoTypeId" operator="equals" value="GROUP"/--><!-- useful to quickly test -->
+<!--                    <entity-constraint name="geoTypeId" operator="in" value="STATE,PROVINCE,REGIONS"/><!-\- useful to quickly test -\->-->
                     <entity-order-by field-name="geoId"/>
                 </entity-options>
             </drop-down>
@@ -87,9 +87,7 @@
                 </entity-options>
             </drop-down>
         </field>
-        <field name="geoId" title="${uiLabelMap.CommonGeo}"
-            event="onFocus" 
-            action="typeValue = jQuery('#${asm_typeField}').val(); selectMultipleRelatedValues('${asm_requestName}', '${asm_paramKey}', '${asm_relatedField}', '${asm_multipleSelect}', '${asm_type}', typeValue, '${asm_responseName}');">                            
+        <field name="geoId" title="${uiLabelMap.CommonGeo}">
             <drop-down current="selected">
                 <entity-options entity-name="Geo" key-field-name="geoId" description="${geoName} (${geoId})">
                     <entity-order-by field-name="geoId"/>