I've been experimenting with Zimlets and am struggling with some concepts here. I've borrowed from the Zimbra Email zimlet as well as some examples I've found on the Internet. I know it's not going to work the way it is now, but maybe someone can enlighten me and help push me in the right direction.
Let me post what I've got so far and then ask my questions.
Code:<zimlet name="edu_wiu_directory" version="1.0" description="WIU Directory"> <include>edu_wiu_directory.js</include> <handlerObject>Edu_Wiu_Directory</handlerObject> <zimletPanelItem label="WIU Directory"> <toolTipText> Perform Directory Actions on WIU's LDAP Directory </toolTipText> <contextMenu> <menuItem label="My Info" id="MYINFO"/> <menuItem label="User Search" id="USERSEARCH"/> <menuItem label="Faculty: Email Classes" id="FACULTYEMAIL"/> </contextMenu> </zimletPanelItem> </zimlet>So the Zimlet icon "WIU Directory" appears, and when I right click it I get the three menu options, but clicking on one of the options does not produce any results. Right now all I would like it to do is return a window with the HTML stuff from the "singleClicked" JS function....and have the third line tell me which option I clicked.Code:function Edu_Wiu_Directory() { } Edu_Wiu_Directory.prototype = new ZmZimletBase(); Edu_Wiu_Directory.prototype.constructor = Edu_Wiu_Directory; Edu_Wiu_Directory.prototype.doubleClicked = function() { this.singleClicked(); }; Edu_Wiu_Directory.prototype.singleClicked = function() { var view = new DwtComposite(this.getShell()); view.setSize("500px","500px"); var el = view.getHtmlElement(); var myBox = document.createElement("div"); el.appendChild(myBox); var html=new Array(); var i=0; html[i++] = "First line of HTML <br/>"; html[i++] = "Second line of HTML"; html[i++] = "WHAT MENU ITEM DID I CLICK GOES HERE...."; //package up html and display it myBox.innerHtml = html.join(''); this._dialog = this._createDialog({title:"My Dialog Title", view:view}); this._dialog.setButtonListener(DwtDialog.OK_BUTTON, new AjxListener(this, this.myHandler)); this._dialog.setButtonTitle(DwtDialog.OK_BUTTON, "Go go gadget Zimlet!"); this._dialog.popup(); }; Edu_Wiu_Directory.prototype.myHandler = function(ev) { //do more stuff with web services, api calls, etc this._dialog.popdown(); } Com_Zimbra_Email.prototype.menuItemSelected = function(itemId, item, ev) { switch (itemId) { case "MYINFO": this._SOMETHINGHERE(); break; case "USERSEARCH": this._SOMETHINGHERE(); break; case "FACULTYEMAIL": this._SOMETHINGHERE(ev); break; } };
Single or double left clicking the Zimlet produces no action, only right clicking produces the menu. I'm pretty sure the "DoubleClicked" and "singleClicked" JS functions are not being called or are being overridden.
Can anyone tell me how to make what I want to happen...happen?
NEXT QUESTION:
Eventually I will want to send a call off to my JSP file that does the LDAP query....and return the results back to the JS for presentation to the user. Anyone know how to send a request off to JSP with parameters...from JS?
Thanks,
Matt


LinkBack URL
About LinkBacks






