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/24 08:26:34 UTC
svn commit: r1000724 - in /ofbiz/branches/jquery/framework:
common/webcommon/includes/setMultipleSelectJs.ftl
example/widget/example/FormWidgetExampleScreens.xml
Author: jleroux
Date: Fri Sep 24 06:26:34 2010
New Revision: 1000724
URL: http://svn.apache.org/viewvc?rev=1000724&view=rev
Log:
Fixes small issues in Example
* Multiple SelectJs with asmsekect can be used alone (without a related field)
* I previously fixed the name of setMutipleSelectJs.flt to setMultipleSelectJs
Modified:
ofbiz/branches/jquery/framework/common/webcommon/includes/setMultipleSelectJs.ftl
ofbiz/branches/jquery/framework/example/widget/example/FormWidgetExampleScreens.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=1000724&r1=1000723&r2=1000724&view=diff
==============================================================================
--- ofbiz/branches/jquery/framework/common/webcommon/includes/setMultipleSelectJs.ftl (original)
+++ ofbiz/branches/jquery/framework/common/webcommon/includes/setMultipleSelectJs.ftl Fri Sep 24 06:26:34 2010
@@ -17,32 +17,34 @@ specific language governing permissions
under the License.
-->
<script type="text/javascript">
- jQuery(document).ready(function() {
+jQuery(document).ready(function() {
- // use asmSelect
- jQuery("#${multipleSelect}").asmSelect({
- addItemTarget: 'top',
- sortable: ${sortable},
- removeLabel: '${uiLabelMap.CommonRemove}'
- });
+ // use asmSelect
+ jQuery("#${multipleSelect}").asmSelect({
+ addItemTarget: 'top',
+ sortable: ${sortable},
+ removeLabel: '${uiLabelMap.CommonRemove}'
+ });
- // track possible relatedField changes
- if (jQuery('#${multipleSelectForm}')) {
- // 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
- jQuery("#${relatedField}").bind('change focus', function() {
- typeValue = jQuery('#${typeField}').val();
- selectMultipleRelatedValues('${requestName}', '${paramKey}', '${relatedField}', '${multipleSelect}', '${type}', typeValue, '${responseName}');
- });
- }
- });
+<#if relatedField?exists> <#-- can be used without related field -->
+ // track possible relatedField changes
+ if (jQuery('#${multipleSelectForm}')) {
+ // 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
+ jQuery("#${relatedField}").bind('change focus', function() {
+ typeValue = jQuery('#${typeField}').val();
+ selectMultipleRelatedValues('${requestName}', '${paramKey}', '${relatedField}', '${multipleSelect}', '${type}', typeValue, '${responseName}');
+ });
+ }
+</#if>
+});
</script>
<style type="text/css">
#${multipleSelectForm} {
width: ${formSize}px;
position: relative;
- }
+}
.asmListItem {
width: ${asmListItemPercentOfForm}%;
Modified: ofbiz/branches/jquery/framework/example/widget/example/FormWidgetExampleScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jquery/framework/example/widget/example/FormWidgetExampleScreens.xml?rev=1000724&r1=1000723&r2=1000724&view=diff
==============================================================================
--- ofbiz/branches/jquery/framework/example/widget/example/FormWidgetExampleScreens.xml (original)
+++ ofbiz/branches/jquery/framework/example/widget/example/FormWidgetExampleScreens.xml Fri Sep 24 06:26:34 2010
@@ -65,17 +65,17 @@ under the License.
<set field="descName" value="geoName"/>
<set field="selectedDependentOption" from-field="postalAddress.stateProvinceGeoId" default-value="_none_"/><!-- postalAddress.stateProvinceGeoId does not make much sense here, only to get the idea -->
- <!-- fields for setMutipleSelectJs.ftl -->
- <set field="multipleSelect" value="countryGeoIdMultiple"/>
+ <!-- fields for setMultipleSelectJs.ftl -->
<set field="multipleSelectForm" value="DropDownMultipleFieldExampleForm"/>
- <set field="formSize" value="500"/>
- <set field="asmListItemPercentOfForm" value="100"/>
+ <set field="multipleSelect" value="DropDownMultipleFieldExampleForm_countryGeoIdMultiple"/>
+ <set field="formSize" value="600"/>
+ <set field="asmListItemPercentOfForm" value="95"/>
<set field="sortable" value="false"/>
</actions>
<widgets>
<!--platform-specific><html><html-template location="component://common/webcommon/includes/setCountryStatesEventJs.ftl"/></html></platform-specific-->
<platform-specific><html><html-template location="component://common/webcommon/includes/setDependentDropdownValuesJs.ftl"/></html></platform-specific>
- <platform-specific><html><html-template location="component://common/webcommon/includes/setMutipleSelectJs.ftl"/></html></platform-specific>
+ <platform-specific><html><html-template location="component://common/webcommon/includes/setMultipleSelectJs.ftl"/></html></platform-specific>
<include-form name="DropDownFieldsExampleForm" location="component://example/widget/example/FormWidgetExampleForms.xml"/>
<include-form name="DropDownMultipleFieldExampleForm" location="component://example/widget/example/FormWidgetExampleForms.xml"/>
</widgets>