Author: jleroux
Date: Wed Aug 7 12:24:10 2013
New Revision: 1511279
URL: http://svn.apache.org/r1511279
Log:
A patch from Leon for "slight patch to "other-field-size" of drop-down form
element"" https://issues.apache.org/jira/browse/OFBIZ-5285
"other-field-size" of drop-down form element is a very nice feature, but it's
crippled in current version.
attached a patch to make it works and added an example section for that into
FormWidgetExample.
jleroux: Interesting, I did not know this feature existed, it was committed
long ago by David (before ASF era)
Modified:
ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl
ofbiz/trunk/specialpurpose/example/config/ExampleUiLabels.xml
ofbiz/trunk/specialpurpose/example/widget/example/FormWidgetExampleForms.xml
ofbiz/trunk/specialpurpose/example/widget/example/FormWidgetExampleScreens.xml
Modified: ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl?rev=1511279&r1=1511278&r2=1511279&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl (original)
+++ ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl Wed Aug 7
12:24:10 2013
@@ -249,7 +249,7 @@ under the License.
disa = '';
document.write("<input type='text' name='${otherFieldName}'
value='${otherValue?js_string}' size='${otherFieldSize}'"+disa+"
onfocus='check_choice(document.${formName}.${fieldName})' />");
if(disa && document.styleSheets)
- document.${formName}.${fieldName}.style.visibility = 'hidden';
+ document.${formName}.${otherFieldName}.style.visibility = 'hidden';
//--></script>
</#if>
Modified: ofbiz/trunk/specialpurpose/example/config/ExampleUiLabels.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/example/config/ExampleUiLabels.xml?rev=1511279&r1=1511278&r2=1511279&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/example/config/ExampleUiLabels.xml (original)
+++ ofbiz/trunk/specialpurpose/example/config/ExampleUiLabels.xml Wed Aug 7
12:24:10 2013
@@ -56,6 +56,14 @@
<value
xml:lang="ja">å½ç¨®é¡ã«åºã¥ããµã³ãã«ãä½ç½®IDãä½ç½®åç§°ã®ã¨ã³ãã£ãã£é
ç®ã使ç¨ãã¦å®äºãã¾ã</value>
<value xml:lang="zh">åºäºå½å®¶ç±»åçæ
·ä¾ï¼ä½¿ç¨Geo.GeoidåGeo.GeoNameçEntity.fieldsæ¥å¡«å
</value>
</property>
+ <property key="ExampleSpecifyOtherDropdown">
+ <value xml:lang="en">Specify-other Dropdown</value>
+ <value xml:lang="zh">æå®å
¶å®è¾å
¥ç䏿æ¡</value>
+ </property>
+ <property key="ExampleSpecifyOtherTooltip">
+ <value xml:lang="en">Select "specify other" option, an input box will
be shown next to dropdown. See tootip of other-field-size attribute of
drop-down form element</value>
+ <value xml:lang="zh">妿鿩"specify
other"ï¼ä¸ææ¡æè¾¹ä¼åºç°ææ¬æ¡ãåèformçdrop-downå
ç´
çother-field-size屿§è¯´æ</value>
+ </property>
<property key="ExampleBaseNodeVersion">
<value xml:lang="de">Verion des Content Knoten</value>
<value xml:lang="en">Version of the base content node</value>
Modified:
ofbiz/trunk/specialpurpose/example/widget/example/FormWidgetExampleForms.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/example/widget/example/FormWidgetExampleForms.xml?rev=1511279&r1=1511278&r2=1511279&view=diff
==============================================================================
---
ofbiz/trunk/specialpurpose/example/widget/example/FormWidgetExampleForms.xml
(original)
+++
ofbiz/trunk/specialpurpose/example/widget/example/FormWidgetExampleForms.xml
Wed Aug 7 12:24:10 2013
@@ -252,6 +252,19 @@ under the License.
</drop-down>
</field>
<!-- ****************************** -->
+ <!-- *** Specify-other dropdown *** -->
+ <!-- ****************************** -->
+ <field name="emptyField1" title=" "><display/></field>
+ <field name="otherValue"
title="${uiLabelMap.ExampleSpecifyOtherDropdown}"
+ tooltip="${uiLabelMap.ExampleSpecifyOtherTooltip}"
tooltip-style="button-text" >
+ <drop-down other-field-size="15">
+ <option key="A" description="Option A" />
+ <option key="B" description="Option B" />
+ <option key="C" description="Option C" />
+ <option key="_OTHER_" description="specify other" />
+ </drop-down>
+ </field>
+ <!-- ****************************** -->
<!-- *** Dependent dropdowns *** -->
<!-- ****************************** -->
<field name="emptyField2" title=" "><display/></field>
Modified:
ofbiz/trunk/specialpurpose/example/widget/example/FormWidgetExampleScreens.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/example/widget/example/FormWidgetExampleScreens.xml?rev=1511279&r1=1511278&r2=1511279&view=diff
==============================================================================
---
ofbiz/trunk/specialpurpose/example/widget/example/FormWidgetExampleScreens.xml
(original)
+++
ofbiz/trunk/specialpurpose/example/widget/example/FormWidgetExampleScreens.xml
Wed Aug 7 12:24:10 2013
@@ -25,6 +25,7 @@ under the License.
<section>
<actions>
<set field="headerItem" value="FormWidgetExamples"/>
+ <set field="layoutSettings.javaScripts[]"
value="/images/combobox.js" global="true" />
</actions>
<widgets>
<decorator-screen name="main-decorator"
location="${parameters.mainDecoratorLocation}">