Mixing Widgets into an HTML Page

Revision as of 20:26, 22 September 2008 by Cfremon (talk | contribs) (adding article footer and category)
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Zimbra AjaxTk->DHTML Widget Toolkit->Widgets

HTML

  <h1>Menu Test</h1>

  <div id="menu_bar">
    & nbsp;
  </div> <!-- menu_bar -->
  


Set up the Shell

Must set to virtual

 var shell = new DwtShell("MainShell", true, null, null, true);
 shell.setVirtual();

Putting a Widget in a <div>

To put a Dwt widget in a <div> , you need to get the document element of the <div> , clear the contents and then reparent the Dwt widget in the element. Here is an example of how to do that.

  // create a toolbar
  var toolbar = new DwtToolBar(parent, "mainMenu", DwtControl.ABSOLUTE_STYLE, 2);

  /*
    ... Here we would have the code to add buttons to the toolbar 
  */

  // Get the div into which we want to place the toolbar
  var div = document.getElementById("menu_bar");

  // Clean out any content
  div.innerHTML = "";

  // Reparent the toolbar's HTML element to the div
  toolbar.reparentHtmlElement(div);


Verified Against: unknown Date Created: 4/19/2006
Article ID: https://wiki.zimbra.com/index.php?title=Mixing_Widgets_into_an_HTML_Page Date Modified: 2008-09-22



Try Zimbra

Try Zimbra Collaboration with a 60-day free trial.
Get it now »

Want to get involved?

You can contribute in the Community, Wiki, Code, or development of Zimlets.
Find out more. »

Looking for a Video?

Visit our YouTube channel to get the latest webinars, technology news, product overviews, and so much more.
Go to the YouTube channel »

Jump to: navigation, search