Zend Framework AjaxContext filters the results and Decorators not removable
Posted
by
Janis Peisenieks
on Stack Overflow
See other posts from Stack Overflow
or by Janis Peisenieks
Published on 2010-12-22T22:39:04Z
Indexed on
2010/12/22
22:54 UTC
Read the original article
Hit count: 195
Ok, since this problem has 2 parts, it will be easier to explain them together. So here goes:
I am trying to remove the default decorators from these elements, since I am using a little different way of styling them. But no matter what i do, the DtDDWrapper still shows up. If I try to remove all of the decorators, all of the fields below disappear.
public function newfieldAction() { $ajaxContext = $this->_helper->getHelper('AjaxContext'); $ajaxContext->addActionContext('newfield', 'html')->initContext(); $id = $this->_getParam('id', null); $id1=$id+1; $id2=$id+2; $element = new Zend_Form_Element_Text("newTitle$id1"); $element->setOptions(array('escape'=>false)); $element->setRequired(true)->setLabel('Vertiba')->removeDecorator('label'); $tinyelement=new Zend_Form_Element_Text("newName$id"); $tinyelement->setRequired(true)->setOptions(array('escape'=>false))->setLabel('Vertiba')->removeDecorator('label'); $textarea_element = new Zend_Form_Element_Textarea("newText$id2"); $textarea_element->setRequired(true)->setOptions(array('escape'=>false))->setLabel('Vertiba')->removeDecorator('label'); $this->view->descriptionField = "<td>".$textarea_element->__toString()."</td>"; $this->view->titleField = $element->__toString(); $this->view->field = $tinyelement->__toString(); $this->view->id=$id; }
The context view script seams to trim my code in one way or another. When I try to put a
<td>
or a<table>
tag in the view script, it just skips the tags. Is there a way to stop this escaping from happening? My view script:id; ?>"> asdfasdfasdfasd field ?> titleField ?> descriptionField ?>
id ?>">remove
P.S. the code formatting system is barfing at me, could someone please help me with the formatting of the code?
© Stack Overflow or respective owner