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}">


Reply via email to