Issues

ZF-9165: Zend_Dojo_Form can't have unlimited elements in setUseProgrammatic() mode

Issue Type: Bug Created: 2010-02-13T04:21:09.000+0000 Last Updated: 2011-04-23T17:08:06.000+0000 Status: Closed Fix version(s): Reporter: Max Gordon (mgordon) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Dojo

Related issues: - ZF-10604

Attachments:

Description

When creating many elements that are to be detected by firefox 3.5.7 the zendDijits variable dissapears. I've encountered this problem when creating tabbed forms. This problem is easily overcome by setting setUseDeclarative().

I guess the Zend_Dojo_View_Helper_Dojo_Container::registerDijitLoader needs some way of noticing if amount of dijits is too large.

<pre class="highlight">
public function testAction(){
    $this->view->dojo()
    ->setDjConfigOption('isDebug', true)
    ->setCdnBase(Zend_Dojo::CDN_BASE_GOOGLE)
    ;

    Zend_Dojo_View_Helper_Dojo::setUseProgrammatic();

    $form  = new Zend_Dojo_Form();
    $form->setMethod('post');
    $form->setAttribs(array(
        'name'  => 'masterForm',
        'method' => 'post',
    ));

    $form->setDecorators(
        array(
            'FormElements',
            array('TabContainer',
                array(
                    'id' => 'tabContainer',
                    'style' => 'width: 800px; height: 600px',
                    'dijitParams' => array('tabPosition' => 'top')
                )
            ),
            'DijitForm',
        )
    );

    for ($i = 0 ; $i < 3 ; $i++) {
        $new_subform = new Zend_Dojo_Form_SubForm();
        $new_subform->setAttribs(array('name'   => 'sub_form_' . $i,
            'legend' => 'sub_form_' . $i,
            'dijitParams' => array(
            'title' =>'my advanced sub_form_' . $i,
            ),
            'class' => 'zend_form'
        ));

        for ($c = 0 ; $c < 140 ; $c++) {
            $element = $new_subform->createElement('NumberTextBox', 
                'test_text_' . $i . "_" . $c, 
                array('maxlength' => 10, 'label' => 'test ' . $i . "_" . $c));
            $new_subform->addElement($element);
        }

        $form->addSubForm($new_subform, 'sub_form_' . $i);
    }

    $this->view->form = $form->render();
}

Comments

Posted by Robert Basic (robertbasic) on 2011-04-23T17:07:36.000+0000

After investigating, it's the same issue as ZF-10604.

Posted by Robert Basic (robertbasic) on 2011-04-23T17:08:06.000+0000

Closing as a duplicate of ZF-10604

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts