[Dojo-interest] Problem using widgetsInTemplate with LayoutContainer

Andrew Scott andrew.scott at aegeon.com.au
Tue Nov 14 04:50:50 MST 2006


Hmm, am I missing something?

Why do you have a layout container that only has a client, why do you not
use a normal dive?

Secondly, I have no experince with inline xml namespaces as of yet. But I do
not thing you need to define a namespace for them when doing so.




On 11/14/06, Yann Herve <yh_mailinglist at laposte.net> wrote:
>
>
> Hello Andrew,
>
> This is precisely what I have done. The sample code that I have sent in
> my previous email contains the same piece of code used directly
> and as a template. One works and the other does not. Regarding the
> behavior, the code in the template simply does nothing regarding layout.
> It is just as
> if I had put regular divs, instead of LayoutContainer/ContentPane. The
> dojo button works fine in both cases.
>
> I have copied the html directly in the email this time instead of
> attachment for easier reading (see below). Also note that in the code
> below, the
> isContainer attribute is set to false. If I set to true it won't work
> either.
>
> <html xmlns:dojo xmlns:myown>
> <head>
>
> <script type="text/javascript">
>    var djConfig = {isDebug: true};
> </script>
> <script language="JavaScript" type="text/javascript"
> src="../../dojo.js"></script>
>
> <script>
>    dojo.require('dojo.widget.HtmlWidget');
>    dojo.require("dojo.widget.LayoutContainer");
>    dojo.require("dojo.widget.Button");
>    dojo.require("dojo.widget.ContentPane");
>    dojo.require("dojo.widget.Button");
>    dojo.registerNamespace("myown", "myown");
> </script>
> </head>
> <body>
>
>
> <xmp id="Test1Template" style="display:none">
>        <div dojoType="LayoutContainer" style="width:100%;height:100%">
>          <div style="background-color:cyan" dojoType="ContentPane"
> layoutAlign="left">
>          <button dojoType="Button">PressMe</button><p>
>          bvlfdlfdldf<p>
>          </div>
>          <div style="background-color:yellow"  layoutAlign="client"
> dojoType="ContentPane">
>          bla<p>bla<p>bla<p>bla<p>
>          </div>
>        </div>
> </xmp>
>
> <script>
>    dojo.widget.defineWidget('myown.Test1', dojo.widget.HtmlWidget, {
>        widgetsInTemplate: true,
>        isContainer: false,
>
>        templateString: dojo.byId('Test1Template').textContent ||
> dojo.byId('Test1Template').innerText,
>
>    });
> </script>
>
> <hr>
>
> <h1>Code using a template (LayoutContainer does not work)</h1>
>
> <div style="width: 400px; height: 300px">
>    <div dojoType="myown:Test1" widgetId="test1Widget" ></div>
> </div>
>
> </hr>
>
>
> <h1>Regular Code (LayoutContainer works ok)</h1>
>
> <div style="width: 400px; height: 300px">
>        <div dojoType="LayoutContainer" style="width:100%;height:100%">
>          <div style="background-color:cyan" dojoType="ContentPane"
> layoutAlign="left">
>          <button dojoType="Button">PressMe</button><p>
>          bvlfdlfdldf<p>
>          </div>
>          <div style="background-color:yellow"  layoutAlign="client"
> dojoType="ContentPane">
>          bla<p>bla<p>bla<p>bla<p>
>          </div>
>        </div>
> </div>
>
> </body>
> </html>
>
>
> Andrew Scott wrote:
> >
> > Oh one thing the dojo wiki has made me realise is that I get the
> > compund widget first working as a standard HTML page first then code
> > it up as a widget. That might help you better.
> >
> >
> >
> >
> > On 11/14/06, *Andrew Scott* <andrew.scott at aegeon.com.au
> > <mailto:andrew.scott at aegeon.com.au>> wrote:
> >
> >     Do you have an attach point on the button. I can't see the code so
> >     I am guessing here I have done compund widgets with out any
> >     problems so as you haven't described what actually happens then
> >     its a bit hard to really help you.
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > Dojo FAQ: http://dojo.jot.com/FAQ
> > Dojo Book: http://manual.dojotoolkit.org/DojoDotBook
> > Dojo-interest at dojotoolkit.org
> > http://dojotoolkit.org/mailman/listinfo/dojo-interest
> >
>
>
> _______________________________________________
> Dojo FAQ: http://dojo.jot.com/FAQ
> Dojo Book: http://manual.dojotoolkit.org/DojoDotBook
> Dojo-interest at dojotoolkit.org
> http://dojotoolkit.org/mailman/listinfo/dojo-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://dojotoolkit.org/pipermail/dojo-interest/attachments/20061114/9bea5d56/attachment.html


More information about the Dojo-interest mailing list