Hello all

Note: I apologize if this message is a tad on the long side, but I wanted to 
try and define as much of my environment as possible so that everyone could 
have a clearer picture.

I have a non-Dojo enabled/integrated form defined in the following way:

class Forms_LoginForm extends Zend_Form
{
                public function __construct( $options = null )
                {
                                parent::__construct( $options = null );

                                $this->setMethod( 'post' )
                                                ->setName( 'login' )
                                                ->setAttrib( 'id', 'login' );

                                $username = new Zend_Form_Element_Text( 
'username' );
                                $username->setLabel( 'Username (from new 
location)' )
                                                ->setRequired(true)
                                                ->addValidator( 'NotEmpty' );

                                $password = new Zend_Form_Element_Text( 
'password' );
                                $password->setLabel( 'Password (from new 
location)' )
                                                ->setRequired(true)
                                                ->addValidator( 'NotEmpty' );

                                $submit = new Zend_Form_Element_Submit( 
'submit' );
                                $submit->setLabel( 'Login' );

                                $this->addElements( array( $username, 
$password, $submit ) );
                }
}

This form works exactly as I expect it to when I do the following:

Controller
-------------
$form = new Forms_LoginForm();
$this->view->form_login = $form;

View
------
<?= $this->form_login ?>


In my attempt to try using a Dojo enabled/integrated form, I have attempted to 
use similar syntax to achieve a select list, not even with anything special 
about it:

class Forms_SetQuarterForm extends Zend_Dojo_Form
{
                public function __construct( $options = null )
                {
                                parent::__construct( $options = null );

            $this->addElement(
                  'ComboBox',
                  'comboboxselect',
                  array(
                        'label' => 'ComboBox (select)',
                        'value' => 'blue',
                        'autocomplete' => false,
                        'multiOptions' => array(
                              'red'    => 'Rouge',
                              'blue'   => 'Bleu',
                              'white'  => 'Blanc',
                              'orange' => 'Orange',
                              'black'  => 'Noir',
                              'green'  => 'Vert',
                        )
                  )
            );
      }
}

I have the following in my layout:

<?
if ( $this->dojo()->isEnabled() ):
                $this->dojo()->setCdnBase( Zend_Dojo::CDN_BASE_GOOGLE )
                                                                
->setCdnDojoPath( Zend_Dojo::CDN_DOJO_PATH_GOOGLE )
                                                                
->addStyleSheetModule( 'dijit.themes.tundra' )
                                                                ->useCdn();
                echo $this->dojo() . "\n";
endif;
?>

And I add the View Helper by doing:

$view->addHelperPath( 'Zend/Dojo/View/Helper/', 'Zend_Dojo_View_Helper' );

I know the above (two) works, because I get the following in the HTML:

<style type="text/css">
<!--
    @import 
"http://ajax.googleapis.com/ajax/libs/dojo/1.1.1/dijit/themes/tundra/tundra.css";;
-->
</style>

<script type="text/javascript" 
src="http://ajax.googleapis.com/ajax/libs/dojo/1.1.1/dojo/dojo.xd.js";></script>

<script type="text/javascript">
//<![CDATA[
dojo.require("dojo.rpc.JsonService");
//]]>

</script>
<script type="text/javascript">
//<![CDATA[
function demoRpc()
{
    var myObject = new dojo.rpc.JsonService( '/manage/json/environment' );
    console.log( myObject.setQuarterID() );
}

//]]>
</script>

when I use:

<input name="foo" type="button" value="Demo" onClick="demoRpc()"/>
<?
$this->dojo()->enable()
                  ->requireModule( 'dojo.rpc.JsonService' );

$this->headScript()->captureStart(); ?>
function demoRpc()
{
    var myObject = new dojo.rpc.JsonService( '<?= $this->url( array( 'module' 
=> 'manage', 'controller' => 'json', 'action' => 'environment' ) ) ?>' );
    console.log( myObject.setQuarterID() );
}
<? $this->headScript()->captureEnd() ?>


With all of that having been said,I am unable to get a Dojo enabled/integrated 
form to render correctly.  At present, with the code examples above, there is 
just literally nothing in the HTML source where <?= $this->setQuarterForm ?> is 
at in the layout after $this->view->setQuarterForm = new 
Forms_SetQuarterForm(); is called in the controller.

Thank you all for your help!

Regards

----
Jeremy Brown
Senior Web Developer
Spear One
972.661.6038
www.spearone.com<http://www.spearone.com>

Reply via email to