Author: jleroux
Date: Sun Mar 7 19:23:42 2010 New Revision: 920061 URL: http://svn.apache.org/viewvc?rev=920061&view=rev Log: A modified patch from Sascha Rodekamp "Some improvements for the layer lookup" (https://issues.apache.org/jira/browse/OFBIZ-3524) - OFBIZ-3524 A little fix for the faded background and make fading as default. I have also refactored a bit the lookups examples fields Modified: ofbiz/trunk/framework/example/widget/example/FormWidgetExampleForms.xml ofbiz/trunk/framework/images/webapp/images/fieldlookup.js ofbiz/trunk/framework/widget/dtd/widget-form.xsd ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl Modified: ofbiz/trunk/framework/example/widget/example/FormWidgetExampleForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/example/widget/example/FormWidgetExampleForms.xml?rev=920061&r1=920060&r2=920061&view=diff ============================================================================== --- ofbiz/trunk/framework/example/widget/example/FormWidgetExampleForms.xml (original) +++ ofbiz/trunk/framework/example/widget/example/FormWidgetExampleForms.xml Sun Mar 7 19:23:42 2010 @@ -282,10 +282,26 @@ <!-- Lookup Layer Example --> <form name="ExampleLookupFields" type="single" title=""> - <!-- Standard LookupLayer --> - <field name="partyIdFrom" position="1" title="${uiLabelMap.CommonPartyID} ${uiLabelMap.CommonFrom}"><lookup target-form-name="LookupPartyExamplePopup" presentation="layer" position="normal"/></field> + <!-- Standard LookupLayer using separated labels is not recommended but here we use only Common labels to avoid dependencies from application to framework--> + <field name="partyIdFrom" title="${uiLabelMap.CommonPartyID} ${uiLabelMap.CommonFrom}"> + <lookup target-form-name="LookupPartyExamplePopup" presentation="layer" fade-background="false"/> + </field> <!-- passes the name in one and the id in another field, the layer is centered --> - <field name="partyIdTo" position="2" title="${uiLabelMap.CommonPartyID} ${uiLabelMap.CommonTo}"><lookup target-form-name="LookupPartyExamplePopupByName" description-field-name="partyIdTo" presentation="layer" position="center" height="500px" width="600px" fade-background="true"/></field> + <field name="partyName" title="${uiLabelMap.CommonName}"> + <lookup target-form-name="LookupPartyExamplePopupByName" description-field-name="partyIdTo" + presentation="layer" position="center" height="500px" width="600px"/> + </field> + <!-- This field may be hidden and the name rendered in partyName using default-value if partyIdTo exists--> + <field name="partyIdTo" title="${uiLabelMap.CommonPartyID} ${uiLabelMap.CommonTo}"><text/></field><!-- the text field is only used for rendering --> + <sort-order> + <field-group> + <sort-field name="partyIdFrom"/> + </field-group> + <field-group> + <sort-field name="partyName"/> + <sort-field name="partyIdTo"/> + </field-group> + </sort-order> </form> <form name="SelectionBoxesExampleForm" type="single"> Modified: ofbiz/trunk/framework/images/webapp/images/fieldlookup.js URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/fieldlookup.js?rev=920061&r1=920060&r2=920061&view=diff ============================================================================== --- ofbiz/trunk/framework/images/webapp/images/fieldlookup.js (original) +++ ofbiz/trunk/framework/images/webapp/images/fieldlookup.js Sun Mar 7 19:23:42 2010 @@ -191,9 +191,8 @@ if (CURRENT_LOOKUP != null) { CURRENT_LOOKUP.removeLayer(); } - //fade the background if the flag is set - if (fadeBackground) { + if (!fadeBackground != "false") { this.createFadedBackground(); } //set dimension isn't set, set default parameters Modified: ofbiz/trunk/framework/widget/dtd/widget-form.xsd URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/dtd/widget-form.xsd?rev=920061&r1=920060&r2=920061&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/dtd/widget-form.xsd (original) +++ ofbiz/trunk/framework/widget/dtd/widget-form.xsd Sun Mar 7 19:23:42 2010 @@ -938,8 +938,8 @@ </xs:restriction> </xs:simpleType> </xs:attribute> - <xs:attribute name="fade-background" default="false"> - <xs:annotation><xs:documentation>True = The Background will be faded.</xs:documentation></xs:annotation> + <xs:attribute name="fade-background" default="true"> + <xs:annotation><xs:documentation>True = The window Background will be faded.</xs:documentation></xs:annotation> <xs:simpleType> <xs:restriction base="xs:string"> <xs:enumeration value="true"/> Modified: ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl?rev=920061&r1=920060&r2=920061&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl (original) +++ ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl Sun Mar 7 19:23:42 2010 @@ -437,7 +437,7 @@ <li><#if lookupPresentation?has_content && descriptionFieldName?has_content && lookupPresentation == "layer"> <a href="javascript:call_fieldlookupLayer3(document.${formName?html}.${name?html}, document.${formName?html}.${descriptionFieldName},'${lookupFieldFormName}','${lookupWidth}','${lookupHeight}','${lookupPosition}', '${fadeBackground}'<#rt/> <#elseif lookupPresentation?has_content && lookupPresentation == "layer"> - <a href="javascript:call_fieldlookupLayer(document.${formName?html}.${name?html},'${lookupFieldFormName}','${lookupWidth}','${lookupHeight}','${lookupPosition}'<#rt/> + <a href="javascript:call_fieldlookupLayer(document.${formName?html}.${name?html},'${lookupFieldFormName}','${lookupWidth}','${lookupHeight}','${lookupPosition}', '${fadeBackground}'<#rt/> <#elseif descriptionFieldName?has_content> <a href="javascript:call_fieldlookup3(document.${formName?html}.${name?html}, document.${formName?html}.${descriptionFieldName},'${lookupFieldFormName}'<#rt/> <#else> |
Free forum by Nabble | Edit this page |