[Dojo-interest] Widgets....within widgets

Sol Kindle kindsol at hotpop.com
Thu Apr 20 20:06:07 MDT 2006


This is how I embed myWidget2 into myWidget1...

1) At the location where my embedded widget2 will live I place the 
following in myWidget1 template (HtmlMyWidget1.html)
...
<div dojoAttachPoint="_embededMyWidget2Container" ></div>
...


2) In myWidget1.js,  I have a call to createWidget() that creates 
myWidget2 in a the div defined above.  Below is a snippet of what that 
might look like:

this._embededMyWidget2Container = null;

this.fillInTemplate = function() {
...
this._myWidget2 =
            dojo.widget.createWidget("mywidget2",
                         {property1:"value1"},
                          this._embededMyWidget2Container,"last");
...
}

This probably isn't too clear.  Let me know if you have any questions 
and I will try to find the example in the nightly tests that I used for 
guidance.

-Sol



Bobby Rullo wrote:
> But is it even possible to have a widget template which contains 
> another widget?
>
> Thanks!



More information about the Dojo-interest mailing list