Thank you for replying Matthew.

Actuall my layout script (main.phtml) has this code in the head:
if ($this->dojo()->isEnabled()){
                        
$this->dojo()->setLocalPath('/library/dojo/dojo/dojo.js')
                        ->addStyleSheetModule('dijit.themes.tundra');
                        echo $this->dojo();
I tested by copy pasting a html code for the tabContainer from dojotoolkit and it works (the html divs from dojotoolkit website, with the dojo requests from my zf structure).

My complete view script is as follow:
-------------------------------------------------------------------------------------------------------
<div class="span-18 last" style="padding-top:25px;padding-left:10px;" align="center">
<?
        Zend_Dojo_View_Helper_Dojo::setUseProgrammatic();
$this->dojo ()->enable ()
        ->setDjConfigOption ( 'parseOnLoad', true )
        ->requireModule ( 'dojo.parser' )
        ->requireModule ( 'dijit.layout.ContentPane' )
        ->requireModule ( 'dijit.form.Button' )
        ->requireModule ( 'dijit.layout.TabContainer' );
$this->dojo()->enable() ?>
<? $this->tabContainer()->captureStart('pastebin', array('class' => 'paste-tab')) ?>
<?= $this->contentPane('active', 'SOME TEXT', array(
   'title' => 'Active Pastes',
   'class' => 'tab',
   'href' => $this->url(
       array(
           'controller' => 'paste',
           'action' => 'active',
           'format' => 'ajax',
       ),
       'default',
       true
   ),
   'parseOnLoad' => true)) ?>
<?= $this->contentPane('active2', 'TEXT HERE', array(
   'title' => 'Active Pastes2',
   'class' => 'tab',
   'href' => $this->url(
       array(
           'controller' => 'paste',
           'action' => 'active',
           'format' => 'ajax',
       ),
       'default',
       true
   ),
   'parseOnLoad' => true)) ?>

<--! the code below is copied from DojoToolkit and it generates the correct result -->
<?= $this->tabContainer()->captureEnd('pastebin') ?>
<div id="mainTabContainer" dojoType="dijit.layout.TabContainer"
       style="width:500px;height:100px">
<div id="LittleRed" dojoType="dijit.layout.ContentPane" title="Little Red Cap">
     Once upon a time there was a dear little girl who was loved by
     every one who looked at her, but most of all by her grandmother,
     and there was nothing that she would not have given to the child.
     </div>
     <div id="HanselGretel" dojoType="dijit.layout.ContentPane"
          title="Hansel and Gretel" closable="true" selected="true">
     Hard by a great forest dwelt a poor wood-cutter with his wife
     and his two children. The boy was called Hansel and the girl Gretel.
     He had little to bite and to break, and once when great dearth fell
     on the land, he could no longer procure even daily bread.
     </div>
     <div id="GreenTwigs" dojoType="dijit.layout.ContentPane"
            title="The Three Green Twigs">
     There was once upon a time a hermit who lived in a forest at the foot
     of a mountain, and passed his time in prayer and good works,
     and every evening he carried, to the glory of God, two pails of water
     up the mountain.
     </div>
</div>
</div>
-------------------------------------------------------------------------------------------------------
Thank you for your time.

Just another comment, the PasteBin is interesting, but for the sake of keeping things simple, could you please consider for future tutorials, presenting the new features in small steps. Like: here is a simple Editor from Dojo, this code goes in the layout, this one in the controller and this one in the viewer. Maybe we can benefit more (and quickly) :)

Great work by the way! Keep it up
rgds
Armand



--------------------------------------------------
From: "Matthew Weier O'Phinney" <[EMAIL PROTECTED]>
Sent: Tuesday, September 30, 2008 10:26 PM
To: <[email protected]>
Subject: Re: [fw-general] Zend_Dojo - Getting it working?

-- Armand Brahaj <[EMAIL PROTECTED]> wrote
(on Tuesday, 30 September 2008, 08:56 PM +0200):
Trying to setup a simple TabContainer with Dojo, (ZF VERSION = '1.6.1')
I followed the tutorial from Matthew (the webinar exactly).

Umm... no, you didn't. You need to echo the dojo() view helper in your
layout script's <head> area. ;)


My script view is like:
<? $this->dojo()->enable() ?>
<? $this->tabContainer()->captureStart('pastebin', array('class' =>
'paste-tab')) ?>
<?= $this->contentPane('active', 'SOME TEXT', array(
   'title' => 'Active Pastes',
   'class' => 'tab',
   'href' => $this->url(
       array(
           'controller' => 'paste',
           'action' => 'active',
           'format' => 'ajax',
       ),
       'default',
       true
   ),
   'parseOnLoad' => true)) ?>
<?= $this->contentPane('active2', 'TEXT HERE', array(
   'title' => 'Active Pastes2',
   'class' => 'tab',
   'href' => $this->url(
       array(
           'controller' => 'paste',
           'action' => 'active',
           'format' => 'ajax',
       ),
       'default',
       true
   ),
   'parseOnLoad' => true)) ?>
<?= $this->tabContainer()->captureEnd('pastebin') ?>

but the Generated HTML is not the expected one:

<div class="span-18 last" style="padding-top:25px;padding-left:10px;"
align="center">
<div id="pastebin"><div id="active">SOME TEXT</div>
<div id="active2">TEXT HERE</div>
</div>

Any idea what should be wrong?

Thank you
Armand



--
Matthew Weier O'Phinney
Software Architect       | [EMAIL PROTECTED]
Zend Framework           | http://framework.zend.com/

Reply via email to