dojox.dtl with widgets in template

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

dojox.dtl with widgets in template

Thomas Friebel-2
Hi all,

I'm getting more and more desparete now, as I can't get this obviously
simple construction running.
I want to build complex view widgets that use the Django Templating
Language.
I got things working so far that I can use dijits within the template.
But what I can't achive is, to get widgets that are nested inside other
widgets working.
To make my thoughts more clear, here is a template that works as expected:

<!--{% load dojox.dtl.contrib.dijit %}-->
<div>
    {% for item in items %}
        <div dojoType="dijit.form.Button parsed">a button labeled '{{
item }}'</div>
    {% endfor %}
</div>
My object has three items, and it displays three buttons. Great so far!

But when it come to some more "complex" templates, I won't get the
buttons rendered (or better say "parsed") at all:
<!--{% load dojox.dtl.contrib.dijit %}-->
<div>
    <div dojoType="dijit.TitlePane parsed" title="A title pane">
    {% for item in items %}
        <div dojoType="dijit.form.Button parsed">a button labeled '{{
item }}'</div>
    {% endfor %}
    </div>
</div>
Here I get a fully working TitlePane, but the buttons inside are not
rendered as dijit-buttons.
I really read the whole internet concerning dojo and dtl (which is not
much stuff at all) but could not find any answers. The examples I found
are all not dealing with dijits inside the template. Even the very
interesting article from Shane O'Sullivan, where he wrote a simple
store-based feedreader only uses simple lists for visualization.
Can anybody give me a hint what I should to? I'd really appreciate any help.

Thanks for your attention

Thomas Friebel

--
Thomas Friebel                  Web:  http://tf.tdb.de
Creative Development            Mail: [hidden email]

Xing: http://www.xing.com/profile/Thomas_Friebel

tdb Software Service GmbH       Tel: +49 9122 9310-3
Bahnhofstr. 20                  Fax: +49 9122 9310-59
91126 Schwabach                 Web: http://www.tdb.de

Geschäftsführer Hermann Götz    UST-IDNR: DE-164568577
Registergericht Nürnberg        HRB 12596
Gerichtsstand Schwabach         ILN 42 6009306 000 8

_______________________________________________
FAQ: http://dojotoolkit.org/support/faq
Book: http://dojotoolkit.org/docs/book
Forums: http://dojotoolkit.org/forum
[hidden email]
http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: dojox.dtl with widgets in template

Neil Roberts
This is a bug, could you file a ticket for me (pottedmeat) at http://trac.dojotoolkit.org 
  ?

Thanks

-Neil


On Jul 14, 2008, at 3:24 AM, Thomas Friebel wrote:

> Hi all,
>
> I'm getting more and more desparete now, as I can't get this obviously
> simple construction running.
> I want to build complex view widgets that use the Django Templating
> Language.
> I got things working so far that I can use dijits within the template.
> But what I can't achive is, to get widgets that are nested inside  
> other
> widgets working.
> To make my thoughts more clear, here is a template that works as  
> expected:
>
> <!--{% load dojox.dtl.contrib.dijit %}-->
> <div>
>    {% for item in items %}
>        <div dojoType="dijit.form.Button parsed">a button labeled '{{
> item }}'</div>
>    {% endfor %}
> </div>
> My object has three items, and it displays three buttons. Great so  
> far!
>
> But when it come to some more "complex" templates, I won't get the
> buttons rendered (or better say "parsed") at all:
> <!--{% load dojox.dtl.contrib.dijit %}-->
> <div>
>    <div dojoType="dijit.TitlePane parsed" title="A title pane">
>    {% for item in items %}
>        <div dojoType="dijit.form.Button parsed">a button labeled '{{
> item }}'</div>
>    {% endfor %}
>    </div>
> </div>
> Here I get a fully working TitlePane, but the buttons inside are not
> rendered as dijit-buttons.
> I really read the whole internet concerning dojo and dtl (which is not
> much stuff at all) but could not find any answers. The examples I  
> found
> are all not dealing with dijits inside the template. Even the very
> interesting article from Shane O'Sullivan, where he wrote a simple
> store-based feedreader only uses simple lists for visualization.
> Can anybody give me a hint what I should to? I'd really appreciate  
> any help.
>
> Thanks for your attention
>
> Thomas Friebel
>
> --
> Thomas Friebel                  Web:  http://tf.tdb.de
> Creative Development            Mail: [hidden email]
>
> Xing: http://www.xing.com/profile/Thomas_Friebel
>
> tdb Software Service GmbH       Tel: +49 9122 9310-3
> Bahnhofstr. 20                  Fax: +49 9122 9310-59
> 91126 Schwabach                 Web: http://www.tdb.de
>
> Geschäftsführer Hermann Götz    UST-IDNR: DE-164568577
> Registergericht Nürnberg        HRB 12596
> Gerichtsstand Schwabach         ILN 42 6009306 000 8
>
> _______________________________________________
> FAQ: http://dojotoolkit.org/support/faq
> Book: http://dojotoolkit.org/docs/book
> Forums: http://dojotoolkit.org/forum
> [hidden email]
> http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest

_______________________________________________
FAQ: http://dojotoolkit.org/support/faq
Book: http://dojotoolkit.org/docs/book
Forums: http://dojotoolkit.org/forum
[hidden email]
http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: dojox.dtl with widgets in template

Thomas Friebel-2
Hi Neil,

sorry, I can't. There is some issues with login to dtk.org and
bugs.dtk.org (at least for me). Perhaps someone else could create a
ticket for me?
When can I propably meet you at #dojo?
Is it a bug, that I could fix on my own if I knew where to do so? Or do
you think, it is a major issue?
I really would love to get this thing working soon, as I'm currently
evaluating the DTL for use in a project.

Regards,

Thomas Friebel aka psypath

Neil Roberts schrieb:

> This is a bug, could you file a ticket for me (pottedmeat) at http://trac.dojotoolkit.org 
>   ?
>
> Thanks
>
> -Neil
>
>
> On Jul 14, 2008, at 3:24 AM, Thomas Friebel wrote:
>
>  
>> Hi all,
>>
>> I'm getting more and more desparete now, as I can't get this obviously
>> simple construction running.
>> I want to build complex view widgets that use the Django Templating
>> Language.
>> I got things working so far that I can use dijits within the template.
>> But what I can't achive is, to get widgets that are nested inside  
>> other
>> widgets working.
>> To make my thoughts more clear, here is a template that works as  
>> expected:
>>
>> <!--{% load dojox.dtl.contrib.dijit %}-->
>> <div>
>>    {% for item in items %}
>>        <div dojoType="dijit.form.Button parsed">a button labeled '{{
>> item }}'</div>
>>    {% endfor %}
>> </div>
>> My object has three items, and it displays three buttons. Great so  
>> far!
>>
>> But when it come to some more "complex" templates, I won't get the
>> buttons rendered (or better say "parsed") at all:
>> <!--{% load dojox.dtl.contrib.dijit %}-->
>> <div>
>>    <div dojoType="dijit.TitlePane parsed" title="A title pane">
>>    {% for item in items %}
>>        <div dojoType="dijit.form.Button parsed">a button labeled '{{
>> item }}'</div>
>>    {% endfor %}
>>    </div>
>> </div>
>> Here I get a fully working TitlePane, but the buttons inside are not
>> rendered as dijit-buttons.
>> I really read the whole internet concerning dojo and dtl (which is not
>> much stuff at all) but could not find any answers. The examples I  
>> found
>> are all not dealing with dijits inside the template. Even the very
>> interesting article from Shane O'Sullivan, where he wrote a simple
>> store-based feedreader only uses simple lists for visualization.
>> Can anybody give me a hint what I should to? I'd really appreciate  
>> any help.
>>
>> Thanks for your attention
>>
>> Thomas Friebel
>>
>> --
>> Thomas Friebel                  Web:  http://tf.tdb.de
>> Creative Development            Mail: [hidden email]
>>
>> Xing: http://www.xing.com/profile/Thomas_Friebel
>>
>> tdb Software Service GmbH       Tel: +49 9122 9310-3
>> Bahnhofstr. 20                  Fax: +49 9122 9310-59
>> 91126 Schwabach                 Web: http://www.tdb.de
>>
>> Geschäftsführer Hermann Götz    UST-IDNR: DE-164568577
>> Registergericht Nürnberg        HRB 12596
>> Gerichtsstand Schwabach         ILN 42 6009306 000 8
>>
>> _______________________________________________
>> FAQ: http://dojotoolkit.org/support/faq
>> Book: http://dojotoolkit.org/docs/book
>> Forums: http://dojotoolkit.org/forum
>> [hidden email]
>> http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest
>>    
>
> _______________________________________________
> FAQ: http://dojotoolkit.org/support/faq
> Book: http://dojotoolkit.org/docs/book
> Forums: http://dojotoolkit.org/forum
> [hidden email]
> http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest
>  

_______________________________________________
FAQ: http://dojotoolkit.org/support/faq
Book: http://dojotoolkit.org/docs/book
Forums: http://dojotoolkit.org/forum
[hidden email]
http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: dojox.dtl with widgets in template

Neil Roberts
It's extremely complicated to fix, and I'll be introducing other features relating to Dijit with DTL shortly that might be better solutions.

-Neil

On Jul 14, 2008, at 1:48 PM, Thomas Friebel wrote:

Hi Neil,

sorry, I can't. There is some issues with login to dtk.org and
bugs.dtk.org (at least for me). Perhaps someone else could create a
ticket for me?
When can I propably meet you at #dojo?
Is it a bug, that I could fix on my own if I knew where to do so? Or do
you think, it is a major issue?
I really would love to get this thing working soon, as I'm currently
evaluating the DTL for use in a project.

Regards,

Thomas Friebel aka psypath

Neil Roberts schrieb:
This is a bug, could you file a ticket for me (pottedmeat) at http://trac.dojotoolkit.org
 ?

Thanks

-Neil


On Jul 14, 2008, at 3:24 AM, Thomas Friebel wrote:


Hi all,

I'm getting more and more desparete now, as I can't get this obviously
simple construction running.
I want to build complex view widgets that use the Django Templating
Language.
I got things working so far that I can use dijits within the template.
But what I can't achive is, to get widgets that are nested inside  
other
widgets working.
To make my thoughts more clear, here is a template that works as  
expected:

<!--{% load dojox.dtl.contrib.dijit %}-->
<div>
  {% for item in items %}
      <div dojoType="dijit.form.Button parsed">a button labeled '{{
item }}'</div>
  {% endfor %}
</div>
My object has three items, and it displays three buttons. Great so  
far!

But when it come to some more "complex" templates, I won't get the
buttons rendered (or better say "parsed") at all:
<!--{% load dojox.dtl.contrib.dijit %}-->
<div>
  <div dojoType="dijit.TitlePane parsed" title="A title pane">
  {% for item in items %}
      <div dojoType="dijit.form.Button parsed">a button labeled '{{
item }}'</div>
  {% endfor %}
  </div>
</div>
Here I get a fully working TitlePane, but the buttons inside are not
rendered as dijit-buttons.
I really read the whole internet concerning dojo and dtl (which is not
much stuff at all) but could not find any answers. The examples I  
found
are all not dealing with dijits inside the template. Even the very
interesting article from Shane O'Sullivan, where he wrote a simple
store-based feedreader only uses simple lists for visualization.
Can anybody give me a hint what I should to? I'd really appreciate  
any help.

Thanks for your attention

Thomas Friebel

--
Thomas Friebel                  Web:  http://tf.tdb.de
Creative Development            Mail: [hidden email]

Xing: http://www.xing.com/profile/Thomas_Friebel

tdb Software Service GmbH       Tel: +49 9122 9310-3
Bahnhofstr. 20                  Fax: +49 9122 9310-59
91126 Schwabach                 Web: http://www.tdb.de

Geschäftsführer Hermann Götz    UST-IDNR: DE-164568577
Registergericht Nürnberg        HRB 12596
Gerichtsstand Schwabach         ILN 42 6009306 000 8

_______________________________________________
FAQ: http://dojotoolkit.org/support/faq
Book: http://dojotoolkit.org/docs/book
Forums: http://dojotoolkit.org/forum
[hidden email]
http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest


_______________________________________________
FAQ: http://dojotoolkit.org/support/faq
Book: http://dojotoolkit.org/docs/book
Forums: http://dojotoolkit.org/forum
[hidden email]
http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest


_______________________________________________
FAQ: http://dojotoolkit.org/support/faq
Book: http://dojotoolkit.org/docs/book
Forums: http://dojotoolkit.org/forum
[hidden email]
http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest


_______________________________________________
FAQ: http://dojotoolkit.org/support/faq
Book: http://dojotoolkit.org/docs/book
Forums: http://dojotoolkit.org/forum
[hidden email]
http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: dojox.dtl with widgets in template

jgautam
This post has NOT been accepted by the mailing list yet.
In reply to this post by Thomas Friebel-2
I am facing the same issue with a widget I am trying ti build. Has this been resolved or is there a work around for this problem?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: dojox.dtl with widgets in template

allnamesrtaken
Bump!

Maybe there is a better solution nowadays. What I need to do is to be able to instanciate a custom complex widget but preferably not render the template since I after use my AutoMapper to populate the instance, and if it renders before the template (and the controls ID) is wrong. (Reason for this is that my factory instanciates (through my IoC container) controls and child controls and then looks up the templates in a registry, and uses my AutoMapper to combine the two.)

After the instance is populated, I would like to run a render function to actually generate the html from the template and then dojo.place it where it should be. The dojox/dtl module exposes a render() function that lets me rerender the widget when all the data is available. (In a perfect world I would like to not render it at all before but that I guess could be fixed with some tampering of the _Templated.js file.)

I tried to run with dojox/dtl/_DomTemplated but it needs a html node to attach it to as it is renderd.
dojox/dtl/_Templated works fine and generates the html for me but does not seem to understand dijit/_WidgetsInTemplateMixin.

Please! Anyone have any ideas or are there better solutions than to use DTL?

Cheers,
Joel
Loading...