-- jigen7 <[email protected]> wrote
(on Monday, 06 July 2009, 12:34 AM -0700):
> Matthew Weier O'Phinney-3 wrote:
> > -- jigen7 <[email protected]> wrote
> > (on Sunday, 05 July 2009, 08:56 PM -0700):
> > > Hi I'm new in using Zend Dojo Form and most of the tutorials is for
> > > version 1.7 as the latest ver is 1.8 
> > 
> > The changes to 1.8 will not affect Dojo integration in the least; the
> > tutorials that exist are still relevant.
> > 
> > > can anyone help me to add a combo box in my
> > > page where i can select default values or i can input my value when the
> > > value is not present in the list and also a date picker. 
> > 
> > Do you want to know (a) how to do a ComboBox AND (b) how to do a
> > DateTextBox, or are you (c) trying to combine the two? The latter, (c),
> > is something Dojo specific, and you would need to ask on the Dojo
> > mailing lists about creating custom widgets. For the former -- (a)
> > and/or (b) -- please read the Zend_Dojo documentation online.
> > 
> > > how will i declare it in the form.php then create a new form in the
> > > controller. what are the codes required in the layout so the dojo
> > > elements will run thanks  
> 
> the documentation is not that accurate as i dont have experience how to
> implement it 1st. I just want to display a combo box and a date picker
> separately

I'm not sure what you consider inaccurate about the documentation; if
you could clarify, that would be great.

The basics, however, are quite simple:

    $form = new Zend_Dojo_Form();
    
    $form->addElement('ComboBox', 'foo', array(
        // specify your options:
        'label' => 'Some options',
        'multiOptions' => array(...), // specify options here...
        'store' => array( // or setup a dojo.data store
            'type'   => '<dojo.data type>',
            'id'     => '<id that dojo will use>'.
            'params' => array(...), // data store parameters
        ),
    ));
    
    $form->addElement('DateTextBox', 'bar', array(
        // specify your options
        'label' => 'A date text box',
    ));
    

-- 
Matthew Weier O'Phinney
Project Lead            | [email protected]
Zend Framework          | http://framework.zend.com/

Reply via email to