ZCS 6.0:Zimlet Developers Guide:Examples:HTTP GET and POST: Difference between revisions
(New page: {| cellspacing="0" cellpadding="5" style="border: 1px solid rgb(153, 153, 170); margin: 0pt 0.5em 0.5em 0pt; float: none; background-color: rgb(249, 249, 255);" |[[Image:zdg-6-menu-icon-zi...) |
|||
Line 18: | Line 18: | ||
== Description == | == Description == | ||
This zimlet shows | This zimlet shows using the <code>AjxRps.invoke()</code> method to call a URL from your zimlet via GET and POST. | ||
== Definition File == | == Definition File == |
Revision as of 20:06, 24 February 2010
Introduction | Getting Started | Dev Environment Setup | Developing Zimlets | Advanced Concepts | API Specifications | Example Zimlets |
Description
This zimlet shows using the AjxRps.invoke()
method to call a URL from your zimlet via GET and POST.
Definition File
<zimlet name="com_zimbra_example_httpgetpost" version="1.0" description="An example zimlet using HTTP GET and POST."> <include>com_zimbra_example_httpgetpost.js</include> <handlerObject>com_zimbra_example_httpgetpost_HandlerObject</handlerObject> <zimletPanelItem label="Zimlet Example (HTTP GET and POST)" icon="zimbraIcon"> <toolTipText>Right click to display the menu</toolTipText> <contextMenu> <menuItem label="HTTP GET" id="CALL_VIA_HTTP_GET" /> <menuItem label="HTTP POST" id="CALL_VIA_HTTP_POST" /> </contextMenu> </zimletPanelItem> </zimlet>
Handler Object
/** * Displays the zimlet jsp page. * */ com_zimbra_example_httpgetpost_HandlerObject.prototype._executeHttpGet = function() { var jspUrl = this.getResource("jspfile.jsp"); var response = AjxRpc.invoke(null, jspUrl, null, null, true); if (response.success == true) { appCtxt.getAppController().setStatusMsg(response.text); } }; /** * Displays the zimlet jsp page. * */ com_zimbra_example_httpgetpost_HandlerObject.prototype._executeHttpPost = function() { var jspUrl = this.getResource("jspfile.jsp"); var response = AjxRpc.invoke(null, jspUrl, null, null, false); if (response.success == true) { appCtxt.getAppController().setStatusMsg(response.text); } };
Download
Zimlet Package | com_zimbra_example_httpgetpost.zip |