So I display them in a div that renders outside the tab container, disable the submit button, and using dojo’s methods, I enable the button on the onValidStateChange dojo event. You may or may not like the buttons subForm I use here either…I do this because otherwise the submit buttons have to be in their own tab, and that makes it confusing for some of my users…they don’t know where the buttons are to submit the form. Be sure that you are in fact extending Zend_Dojo_Form, or using one of the other methods shown in the docs for dojo-enabling your form. As you can see, once you see you how it goes together, it’s actually trivial to add dijit layout containers to a zend form. There may be some errors in there, but the idea is there. $subForm->cancel->removeDecorator('DtDdWrapper') $subForm->submit->removeDecorator('DtDdWrapper') New Zend_Dojo_Form_Element_Button('cancel', array( 'attribs' => array('disabled' => 'disabled'), New Zend_Dojo_Form_Element_Button('submit', array( $this->generalInformation->setDecorators(array(Īrray('HtmlTag', array('tag' => 'dl', 'class' => 'addTrailer')),Īrray('HtmlTag', array('tag' => 'div', 'id' => 'buttonsSubForm', 'class' => 'span-7 push-3 prepend-top')), 'attribs' => array('maxlength' => 17, 'uppercase' => true, 'trim' =>true), 'invalidMessage' => "Please enter a value", New Zend_Dojo_Form_Element_ValidationTextBox('validationBox2', array( 'attribs' => array('uppercase' => true, 'trim' =>true), New Zend_Dojo_Form_Element_ValidationTextBox('validationBox1', array( 'attribs' => (array('propercase' => true, 'trim' =>true)), New Zend_Dojo_Form_Element_ComboBox('comboBox1', array( New Zend_Dojo_Form_Element_FilteringSelect('year', array( New Zend_Dojo_Form_Element_CheckBox('cb1', array( New Zend_Dojo_Form_Element_FilteringSelect('field1', array( general information display group elements call custom class methods to add form members 'dijitParams' => array('tabPosition' => 'top'), $this->setDisableLoadDefaultDecorators(true) Also, you may notice that I don’t include an action attrib or method attrib declaration to the form node itself…this is because I handle form submitting via xhr. #Zend studio dojo free#Feel free to customize it according to your needs. keep in mind that this is just my solution…there are probably other ways to do this. I do it all the time, including using other dijit containers as well. Nathan Garlington wrote a nice solution for Tab based forms Yes, it is possible to display a form in a tabContainer.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |