Miscellaneous improvement in Form Widgets examples. Notably introduces an, as much as possible generalized (so far), dependent drop-downs example. I have introduced 2 couples of dependent drop-downs.
The 1st one, country/states, is a common one and does not need (ie it's better to not) to be generalized. It can be used as is. It needs some pieces which are all included, see comments and follow... The 2d, category/products, have been taken as example but is not a good candidate. What if you get much categ or/and products? Anyway it's a good OOTB example and I had it at hand, so I used it. I have tried to generalize (abstract the couple of dropdowns) and it's almost there. The only issue I crossed, is when you want to use a couple of dependent drop-downs in the same form. As it's not a common case, the setDependentDropdownValuesJs.ftl template-script can be used in most cases... git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@986370 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -215,19 +215,43 @@ under the License.
|
||||
<!-- *** field7 *** -->
|
||||
<!-- ***************** -->
|
||||
<field name="field7"
|
||||
title="${uiLabelMap.ExampleDropDownField7Title}"
|
||||
tooltip="${uiLabelMap.ExampleToDo}">
|
||||
title="${uiLabelMap.ExampleDropDownField7Title}"
|
||||
tooltip="${uiLabelMap.ExampleToDo}">
|
||||
<drop-down>
|
||||
<entity-options entity-name="ExampleType"
|
||||
key-field-name="exampleTypeId"
|
||||
description="${description}">
|
||||
key-field-name="exampleTypeId"
|
||||
description="${description}">
|
||||
<entity-constraint name="exampleTypeId"
|
||||
value="INSPIRED"
|
||||
operator="greater"/>
|
||||
value="INSPIRED"
|
||||
operator="greater"/>
|
||||
<entity-order-by field-name="description"/>
|
||||
</entity-options>
|
||||
</drop-down>
|
||||
</field>
|
||||
<!-- ****************************** -->
|
||||
<!-- *** Dependent dropdowns *** -->
|
||||
<!-- ****************************** -->
|
||||
<field name="emptyField" title="${uiLabelMap.CommonEmptyHeader}"><display/></field>
|
||||
<field name="dependendDropDownFields" title="${uiLabelMap.ExampleDependentDropDowns}">
|
||||
<display description="${uiLabelMap.ExampleDependentDropDownTooltip}"/>
|
||||
</field>
|
||||
<field name="stateProvinceGeoId" title="${uiLabelMap.CommonState}" widget-style="required"><drop-down allow-empty="false"/></field>
|
||||
<field name="countryGeoId" title="${uiLabelMap.CommonCountry}" tooltip="${uiLabelMap.CommonRequired}" widget-style="required">
|
||||
<drop-down no-current-selected-key="USA">
|
||||
<entity-options entity-name="Geo" key-field-name="geoId" description="${geoName}">
|
||||
<entity-constraint name="geoTypeId" value="COUNTRY"/>
|
||||
<entity-order-by field-name="geoName"/>
|
||||
</entity-options>
|
||||
</drop-down>
|
||||
</field>
|
||||
|
||||
<field name="separator" title="${uiLabelMap.CommonEmptyHeader}"><display/></field>
|
||||
<field name="productCategoryId" tooltip="${uiLabelMap.CommonRequired}" widget-style="required">
|
||||
<drop-down>
|
||||
<entity-options entity-name="ProductCategory" key-field-name="productCategoryId" description="${categoryName } ${description}"/>
|
||||
</drop-down>
|
||||
</field>
|
||||
<field name="productId" widget-style="required"><drop-down allow-empty="false"></drop-down></field>
|
||||
</form>
|
||||
|
||||
<!-- Simple form to print a FOP PDF file with the fonts available in OFBiz Project -->
|
||||
|
||||
Reference in New Issue
Block a user