Files
ofbiz-framework/framework/common/webcommon/includes/setDependentDropdownValuesJs.ftl
T
Jacques Le Roux 7a9a644f08 New Price Rules screen.
I tried to make it look better by having only one Value column but I found that a field inserted by Prototype was not taken into account when submitted. As it's not possible to rename a DOM element I finally gave up and used use-when + hide/show instead. I will see if we can do better with jQuery...
I kept the old Screen + Groovy + FTL files, not for nostalgics, but in case someone has to quickly deal with fields with a lot of values (to avoid drop-down saturation). Then the Id will still be used. Note that it's also possible to do so with the new screen: you need only to put the field type in setPriceRulesCondEventJs.ftl and at top of getAssociatedPriceRulesConds service implementation in order to handle it as an Id with an input field (like it's done OOTB for Quantity and List Price)

I'd like to use the same mechanism for Promo Rules. I will do that later, hopefully before merging jQuery...

BTW, I like the now clear separation with Ajax onComplete event.



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1005861 13f79535-47bb-0310-9956-ffa450edef68
2010-10-08 15:33:03 +00:00

28 lines
1.4 KiB
Plaintext

<#--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<script type="text/javascript">
document.observe('dom:loaded', function() {
if ($('${dependentForm}')) {
Event.observe($('${dependentForm}_${mainId}'), 'change', function() {
getDependentDropdownValues('${requestName}', '${paramKey}', '${dependentForm}_${mainId}', '${dependentForm}_${dependentId}', '${responseName}', '${dependentId}', '${descName}');
});
getDependentDropdownValues('${requestName}', '${paramKey}', '${dependentForm}_${mainId}', '${dependentForm}_${dependentId}', '${responseName}', '${dependentId}', '${descName}', '${selectedDependentOption}');
}
})
</script>