Author: apatel
Date: Tue Jul 22 19:20:39 2008 New Revision: 678979 URL: http://svn.apache.org/viewvc?rev=678979&view=rev Log: Enhancements contributed by Mridul Pathal for Ajax InPlaceEditor for form widget Display field. Mridul, Thanks for your effort. Modified: ofbiz/trunk/applications/party/webapp/partymgr/party/PartyForms.xml ofbiz/trunk/framework/example/widget/example/ExampleForms.xml ofbiz/trunk/framework/images/webapp/images/prototypejs/controls.js ofbiz/trunk/framework/images/webapp/images/selectall.js ofbiz/trunk/framework/widget/dtd/widget-form.xsd ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java Modified: ofbiz/trunk/applications/party/webapp/partymgr/party/PartyForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/webapp/partymgr/party/PartyForms.xml?rev=678979&r1=678978&r2=678979&view=diff ============================================================================== --- ofbiz/trunk/applications/party/webapp/partymgr/party/PartyForms.xml (original) +++ ofbiz/trunk/applications/party/webapp/partymgr/party/PartyForms.xml Tue Jul 22 19:20:39 2008 @@ -101,14 +101,6 @@ <form name="ViewPartyGroup" type="single" default-map-name="lookupGroup"> <auto-fields-entity entity-name="PartyGroup" default-field-type="display"/> <field name="partyTypeId"><ignored/></field> - <field name="groupName" id-name="groupName" widget-style="label"> - <display> - <in-place-editor url="/partymgr/control/ajaxUpdatePartyGroup" cancel-control="button" saving-text="Updating..." text-between-controls=" "> - <simple-editor/> - <field-map field-name="partyId" env-name="lookupGroup.partyId"/> - </in-place-editor> - </display> - </field> <field name="comments"><ignored/></field> <field name="logoImageUrl"><ignored/></field> <field name="description" title="${uiLabelMap.CommonDescription}"><display/></field> Modified: ofbiz/trunk/framework/example/widget/example/ExampleForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/example/widget/example/ExampleForms.xml?rev=678979&r1=678978&r2=678979&view=diff ============================================================================== --- ofbiz/trunk/framework/example/widget/example/ExampleForms.xml (original) +++ ofbiz/trunk/framework/example/widget/example/ExampleForms.xml Tue Jul 22 19:20:39 2008 @@ -68,6 +68,24 @@ <actions> <entity-condition entity-name="Example"><order-by field-name="exampleName"/></entity-condition> </actions> + <field name="exampleName" title="${uiLabelMap.CommonName}" id-name="exampleName" widget-style="tabletext"> + <display> + <in-place-editor url="/example/control/updateExample" cancel-control="button" saving-text="Updating..." text-between-controls=" "> + <simple-editor/> + <field-map field-name="exampleId" env-name="exampleId"/> + <field-map field-name="statusId" env-name="statusId"/> + </in-place-editor> + </display> + </field> + <field name="description" title="${uiLabelMap.CommonDescription}" id-name="description" widget-style="tabletext"> + <display> + <in-place-editor url="/example/control/updateExample" cancel-control="button" saving-text="Updating..." text-between-controls=" "> + <simple-editor/> + <field-map field-name="exampleId" env-name="exampleId"/> + <field-map field-name="statusId" env-name="statusId"/> + </in-place-editor> + </display> + </field> <on-event-update-area event-type="paginate" area-id="ListExamplesAjax" area-target="ListExampleFormOnly"/> </form> Modified: ofbiz/trunk/framework/images/webapp/images/prototypejs/controls.js URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/prototypejs/controls.js?rev=678979&r1=678978&r2=678979&view=diff ============================================================================== --- ofbiz/trunk/framework/images/webapp/images/prototypejs/controls.js (original) +++ ofbiz/trunk/framework/images/webapp/images/prototypejs/controls.js Tue Jul 22 19:20:39 2008 @@ -688,7 +688,9 @@ if (e) Event.stop(e); }, updateElement: function() { - $(this.element).update(this._paramValue); + if (this.options.updateAfterRequestCall) { + $(this.element).update(this._paramValue); + } }, leaveEditMode: function() { this.element.removeClassName(this.options.savingClassName); Modified: ofbiz/trunk/framework/images/webapp/images/selectall.js URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/selectall.js?rev=678979&r1=678978&r2=678979&view=diff ============================================================================== --- ofbiz/trunk/framework/images/webapp/images/selectall.js (original) +++ ofbiz/trunk/framework/images/webapp/images/selectall.js Tue Jul 22 19:20:39 2008 @@ -404,7 +404,6 @@ */ function ajaxInPlaceEditDisplayField(element, url, options) { - options.htmlResponse = false; new Ajax.InPlaceEditor($(element), url, options); } // ===== End of Ajax Functions ===== // Modified: ofbiz/trunk/framework/widget/dtd/widget-form.xsd URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/dtd/widget-form.xsd?rev=678979&r1=678978&r2=678979&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/dtd/widget-form.xsd (original) +++ ofbiz/trunk/framework/widget/dtd/widget-form.xsd Tue Jul 22 19:20:39 2008 @@ -1174,7 +1174,7 @@ <xs:attribute name="highlight-color" type="xs:string"/> <xs:attribute name="highlight-end-color" type="xs:string"/> <xs:attribute name="hover-class-name" type="xs:string"/> - <xs:attribute name="html-response"> + <xs:attribute name="html-response" default="false"> <xs:simpleType> <xs:restriction base="xs:token"> <xs:enumeration value="false"/> @@ -1208,6 +1208,14 @@ <xs:attribute name="text-after-controls" type="xs:string"/> <xs:attribute name="text-before-controls" type="xs:string"/> <xs:attribute name="text-between-controls" type="xs:string"/> + <xs:attribute name="update-after-request-call" default="true"> + <xs:simpleType> + <xs:restriction base="xs:token"> + <xs:enumeration value="false"/> + <xs:enumeration value="true"/> + </xs:restriction> + </xs:simpleType> + </xs:attribute> </xs:attributeGroup> <xs:element name="list-options"> <xs:annotation> Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java?rev=678979&r1=678978&r2=678979&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java Tue Jul 22 19:20:39 2008 @@ -1794,6 +1794,7 @@ protected String textBeforeControls; protected String textAfterControls; protected String textBetweenControls; + protected String updateAfterRequestCall; protected String rows; protected String cols; protected Map<FlexibleMapAccessor, Object> fieldMap; @@ -1820,6 +1821,7 @@ this.textBeforeControls = element.getAttribute("text-before-controls"); this.textAfterControls = element.getAttribute("text-after-controls"); this.textBetweenControls = element.getAttribute("text-between-controls"); + this.updateAfterRequestCall = element.getAttribute("update-after-request-call"); Element simpleElement = UtilXml.firstChildElement(element, "simple-editor"); this.rows = simpleElement.getAttribute("rows"); @@ -1837,91 +1839,95 @@ } public String getCancelControl() { - return cancelControl; + return this.cancelControl; } public String getCancelText() { - return cancelText; + return this.cancelText; } public String getClickToEditText() { - return clickToEditText; + return this.clickToEditText; } public String getFieldPostCreation() { - return fieldPostCreation; + return this.fieldPostCreation; } public String getFormClassName() { - return formClassName; + return this.formClassName; } public String getHighlightColor() { - return highlightColor; + return this.highlightColor; } public String getHighlightEndColor() { - return highlightEndColor; + return this.highlightEndColor; } public String getHoverClassName() { - return hoverClassName; + return this.hoverClassName; } public String getHtmlResponse() { - return htmlResponse; + return this.htmlResponse; } public String getLoadingClassName() { - return loadingClassName; + return this.loadingClassName; } public String getLoadingText() { - return loadingText; + return this.loadingText; } public String getOkControl() { - return okControl; + return this.okControl; } public String getOkText() { - return okText; + return this.okText; } public String getParamName() { - return paramName; + return this.paramName; } public String getSavingClassName() { - return savingClassName; + return this.savingClassName; } public String getSavingText() { - return savingText; + return this.savingText; } public String getSubmitOnBlur() { - return submitOnBlur; + return this.submitOnBlur; } public String getTextBeforeControls() { - return textBeforeControls; + return this.textBeforeControls; } public String getTextAfterControls() { - return textAfterControls; + return this.textAfterControls; } public String getTextBetweenControls() { - return textBetweenControls; + return this.textBetweenControls; + } + + public String getUpdateAfterRequestCall() { + return this.updateAfterRequestCall; } public String getRows() { - return rows; + return this.rows; } public String getCols() { - return cols; + return this.cols; } public Map<String, Object> getFieldMap(Map<String, Object> context) { @@ -2014,6 +2020,10 @@ this.textBetweenControls = string; } + public void setUpdateAfterRequestCall(String string) { + this.updateAfterRequestCall = string; + } + public void setRows(String string) { this.rows = string; } Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java?rev=678979&r1=678978&r2=678979&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java Tue Jul 22 19:20:39 2008 @@ -225,7 +225,14 @@ writer.append("paramName: '" +modelFormField.getFieldName()+ "'"); } if (UtilValidate.isNotEmpty(inPlaceEditor.getCancelControl())) { - writer.append(", cancelControl: '" +inPlaceEditor.getCancelControl()+ "'"); + writer.append(", cancelControl: "); + if (!"false".equals(inPlaceEditor.getCancelControl())) { + writer.append("'"); + } + writer.append(inPlaceEditor.getCancelControl()); + if (!"false".equals(inPlaceEditor.getCancelControl())) { + writer.append("'"); + } } if (UtilValidate.isNotEmpty(inPlaceEditor.getCancelText())) { writer.append(", cancelText: '" +inPlaceEditor.getCancelText()+ "'"); @@ -234,7 +241,14 @@ writer.append(", clickToEditText: '" +inPlaceEditor.getClickToEditText()+ "'"); } if (UtilValidate.isNotEmpty(inPlaceEditor.getFieldPostCreation())) { - writer.append(", fieldPostCreation: '" +inPlaceEditor.getFieldPostCreation()+ "'"); + writer.append(", fieldPostCreation: "); + if (!"false".equals(inPlaceEditor.getFieldPostCreation())) { + writer.append("'"); + } + writer.append(inPlaceEditor.getFieldPostCreation()); + if (!"false".equals(inPlaceEditor.getFieldPostCreation())) { + writer.append("'"); + } } if (UtilValidate.isNotEmpty(inPlaceEditor.getFormClassName())) { writer.append(", formClassName: '" +inPlaceEditor.getFormClassName()+ "'"); @@ -258,7 +272,14 @@ writer.append(", loadingText: '" +inPlaceEditor.getLoadingText()+ "'"); } if (UtilValidate.isNotEmpty(inPlaceEditor.getOkControl())) { - writer.append(", okControl: '" +inPlaceEditor.getOkControl()+ "'"); + writer.append(", okControl: "); + if (!"false".equals(inPlaceEditor.getOkControl())) { + writer.append("'"); + } + writer.append(inPlaceEditor.getOkControl()); + if (!"false".equals(inPlaceEditor.getOkControl())) { + writer.append("'"); + } } if (UtilValidate.isNotEmpty(inPlaceEditor.getOkText())) { writer.append(", okText: '" +inPlaceEditor.getOkText()+ "'"); @@ -281,6 +302,9 @@ if (UtilValidate.isNotEmpty(inPlaceEditor.getTextBetweenControls())) { writer.append(", textBetweenControls: '" +inPlaceEditor.getTextBetweenControls()+ "'"); } + if (UtilValidate.isNotEmpty(inPlaceEditor.getUpdateAfterRequestCall())) { + writer.append(", updateAfterRequestCall: " +inPlaceEditor.getUpdateAfterRequestCall()); + } if (UtilValidate.isNotEmpty(inPlaceEditor.getRows())) { writer.append(", rows: '" +inPlaceEditor.getRows()+ "'"); } |
Free forum by Nabble | Edit this page |