SubForm elements not aware of all parents. (before render)

1 message Options
Embed this post
Permalink
Gustav Ernberg

SubForm elements not aware of all parents. (before render)

Reply Threaded More More options
Print post
Permalink
<?php
class Test extends Zend_Form{
    function init() {
        $this->setElementsBelongTo("tree");
        $branch = new Zend_Form();
        $branch->setElementsBelongTo("branch");
        $branch->addElement("text", "leaf");
        $this->addSubForm($branch, "branch");
        echo $this->getSubForm("branch")->getElement("leaf")->getFullyQualifiedName();
    }
}
?>

Echos "branch[leaf]" and not expected "tree[branch][leaf]"
When the whole form is rendered the getFullyQualifiedName() of the element is (as expected) "tree[branch][leaf]".

Am I missing something here?