Author: jacopoc
Date: Fri Oct 19 06:53:26 2007 New Revision: 586458 URL: http://svn.apache.org/viewvc?rev=586458&view=rev Log: New examples for date/time fields. Modified: ofbiz/trunk/framework/example/widget/example/FormWidgetExampleForms.xml ofbiz/trunk/framework/example/widget/example/FormWidgetExampleScreens.xml Modified: ofbiz/trunk/framework/example/widget/example/FormWidgetExampleForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/example/widget/example/FormWidgetExampleForms.xml?rev=586458&r1=586457&r2=586458&view=diff ============================================================================== --- ofbiz/trunk/framework/example/widget/example/FormWidgetExampleForms.xml (original) +++ ofbiz/trunk/framework/example/widget/example/FormWidgetExampleForms.xml Fri Oct 19 06:53:26 2007 @@ -20,10 +20,98 @@ <forms xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-form.xsd"> + + <form name="DateTimeFieldsExampleForm" type="single" title=""> + <actions> + <set field="exampleDateField" value="${bsh:org.ofbiz.base.util.UtilDateTime.nowTimestamp();}" type="Timestamp"/> + </actions> + <!-- ***************** --> + <!-- *** field1 *** --> + <!-- ***************** --> + <field name="field1" + title="Field1: date and time selection field" + tooltip="TODO"> + <date-time/> + </field> + <!-- ***************** --> + <!-- *** field9 *** --> + <!-- ***************** --> + <field name="field9" + title="Field9: date and time selection field with default value" + tooltip="Same as above, Uses the ${bsh: notation to call an util method to get the now timestamp"> + <date-time default-value="${bsh: org.ofbiz.base.util.UtilDateTime.nowTimestamp()}"/> + </field> + <!-- ***************** --> + <!-- *** field10 *** --> + <!-- ***************** --> + <field name="field10" + title="Field10: date and time selection field with default value" + tooltip="Same as above, Uses the nowTimestamp variable (always available in the form context) to set the default value to now"> + <date-time default-value="${nowTimestamp}"/> + </field> + <!-- ***************** --> + <!-- *** field2 *** --> + <!-- ***************** --> + <field name="field2" + title="Field2: date selection field" + tooltip="TODO"> + <date-time type="date"/> + </field> + <!-- ***************** --> + <!-- *** field3 *** --> + <!-- ***************** --> + <field name="field3" + title="Field3: time selection field" + tooltip="TODO"> + <date-time type="time"/> + </field> + <!-- ***************** --> + <!-- *** field4 *** --> + <!-- ***************** --> + <field name="field4" + title="Field4: advanced date time selection" + tooltip="Use the input-method (time-dropdown) and clock (24) attributes to create drop down boxes for hour and minute selections"> + <date-time input-method="time-dropdown" clock="24"/> + </field> + <!-- ***************** --> + <!-- *** field5 *** --> + <!-- ***************** --> + <field name="field5" + title="Field5: advanced date time selection (AM/PM)" + tooltip="Use the input-method (time-dropdown) and clock (12) attributes to create drop down boxes for hour and minute selections"> + <date-time input-method="time-dropdown" clock="12"/> + </field> + <!-- ***************** --> + <!-- *** field6 *** --> + <!-- ***************** --> + <field name="field6" + entry-name="exampleDateField" + title="Field6: date and time simple display" + tooltip="TODO"> + <display/> + </field> + <!-- ***************** --> + <!-- *** field7 *** --> + <!-- ***************** --> + <field name="field7" + entry-name="exampleDateField" + title="Field7: date and time display with custom format" + tooltip="This is an example of MM/dd/yyyy format"> + <display description="${bsh:org.ofbiz.base.util.UtilDateTime.toDateString(exampleDateField, "MM/dd/yyyy");}"/> + </field> + <!-- ***************** --> + <!-- *** field8 *** --> + <!-- ***************** --> + <field name="field8" + entry-name="exampleDateField" + title="Field8: date and time display with custom format" + tooltip="This is an example of MMMM, dd, yyyy format"> + <display description="${bsh:org.ofbiz.base.util.UtilDateTime.toDateString(exampleDateField, "MMMM, dd, yyyy");}"/> + </field> + </form> + <form name="DropDownFieldsExampleForm" type="single" title=""> - <field name="entityOptionsFields1" title="entity-options"><display description="All these fields retrieve the list of values from another entity by using the entity-options element." also-hidden="false"/></field> - <field name="entityOptionsFields2" title=""><display description="entity-options will look up options for the field in the given entity." also-hidden="false"/></field> - <field name="entityOptionsFields3" title=""><display description="The complete syntax is... TODO" also-hidden="false"/></field> + <field name="dropDownFields1" title="drop-down"><display description="First of all you have to define a drop-down element inside of the field element that you want to render as a drop down field." also-hidden="false"/></field> <!-- ***************** --> <!-- *** field1 *** --> <!-- ***************** --> @@ -53,43 +141,63 @@ </drop-down> </field> <!-- ***************** --> - <!-- *** field3 *** --> + <!-- *** field5 *** --> <!-- ***************** --> - <field name="field3" - title="Field3: sort in descending order" + <field name="field5" + title="Field5: selection of a default value from the list" tooltip="TODO"> - <drop-down> + <drop-down no-current-selected-key="INSPIRED"> <entity-options entity-name="ExampleType" key-field-name="exampleTypeId" description="${description}"> - <entity-order-by field-name="-description"/> + <entity-order-by field-name="description"/> </entity-options> </drop-down> </field> <!-- ***************** --> - <!-- *** field4 *** --> + <!-- *** field8 *** --> <!-- ***************** --> - <field name="field4" - title="Field4: combined description" + <field name="field8" + title="Field8: Javascript event" + event="onChange" + action="return alert('You have changed the value in the select box');" tooltip="TODO"> - <drop-down> + <drop-down allow-empty="true"> <entity-options entity-name="ExampleType" key-field-name="exampleTypeId" - description="${exampleTypeId} - ${description}"> + description="${description}"> <entity-order-by field-name="description"/> </entity-options> </drop-down> </field> + + <field name="entityOptionsFields1" title="entity-options"><display description="All these fields retrieve the list of values from another entity by using the entity-options element." also-hidden="false"/></field> + <field name="entityOptionsFields2" title=""><display description="entity-options will look up options for the field in the given entity." also-hidden="false"/></field> + <field name="entityOptionsFields3" title=""><display description="The complete syntax is... TODO" also-hidden="false"/></field> <!-- ***************** --> - <!-- *** field5 *** --> + <!-- *** field3 *** --> <!-- ***************** --> - <field name="field5" - title="Field5: selection of a default value from the list" + <field name="field3" + title="Field3: sort in descending order" tooltip="TODO"> - <drop-down no-current-selected-key="INSPIRED"> + <drop-down> <entity-options entity-name="ExampleType" key-field-name="exampleTypeId" description="${description}"> + <entity-order-by field-name="-description"/> + </entity-options> + </drop-down> + </field> + <!-- ***************** --> + <!-- *** field4 *** --> + <!-- ***************** --> + <field name="field4" + title="Field4: combined description" + tooltip="TODO"> + <drop-down> + <entity-options entity-name="ExampleType" + key-field-name="exampleTypeId" + description="${exampleTypeId} - ${description}"> <entity-order-by field-name="description"/> </entity-options> </drop-down> @@ -118,22 +226,6 @@ <entity-constraint name="exampleTypeId" value="INSPIRED" operator="greater"/> - <entity-order-by field-name="description"/> - </entity-options> - </drop-down> - </field> - <!-- ***************** --> - <!-- *** field8 *** --> - <!-- ***************** --> - <field name="field8" - title="Field8: Javascript event" - event="onChange" - action="return alert('You have changed the value in the select box');" - tooltip="TODO"> - <drop-down allow-empty="true"> - <entity-options entity-name="ExampleType" - key-field-name="exampleTypeId" - description="${description}"> <entity-order-by field-name="description"/> </entity-options> </drop-down> Modified: ofbiz/trunk/framework/example/widget/example/FormWidgetExampleScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/example/widget/example/FormWidgetExampleScreens.xml?rev=586458&r1=586457&r2=586458&view=diff ============================================================================== --- ofbiz/trunk/framework/example/widget/example/FormWidgetExampleScreens.xml (original) +++ ofbiz/trunk/framework/example/widget/example/FormWidgetExampleScreens.xml Fri Oct 19 06:53:26 2007 @@ -35,13 +35,20 @@ </condition> <widgets> <container><label style="head1">${uiLabelMap.${titleProperty}}</label></container> - <container><label style="head2">Drop down fields</label></container> + <container><label style="head1">Date/Time fields</label></container> + <container> + <label style="head3">Source Code</label> + <label> - see the form definition with name "DateTimeFieldsExampleForm" in the file: </label> + <link target="http://svn.apache.org/repos/asf/ofbiz/trunk/framework/example/widget/example/FormWidgetExampleForms.xml" url-mode="plain" target-window="svnPage" text="framework/example/widget/example/FormWidgetExampleForms.xml" style="buttontext"/> + </container> + <include-form name="DateTimeFieldsExampleForm" location="component://example/widget/example/FormWidgetExampleForms.xml"/> + + <container><label style="head1">Drop down fields</label></container> <container> <label style="head3">Source Code</label> <label> - see the form definition with name "DropDownFieldsExampleForm" in the file: </label> <link target="http://svn.apache.org/repos/asf/ofbiz/trunk/framework/example/widget/example/FormWidgetExampleForms.xml" url-mode="plain" target-window="svnPage" text="framework/example/widget/example/FormWidgetExampleForms.xml" style="buttontext"/> </container> - <include-form name="DropDownFieldsExampleForm" location="component://example/widget/example/FormWidgetExampleForms.xml"/> </widgets> <fail-widgets> |
Free forum by Nabble | Edit this page |