2008年8月5日星期二

Re: [fw-mvc] Zend_Form_Element will be created twice

Axel Wüstemann wrote:
>
>
> I hope I will get to run my form inspite of that.
>
> <form .....>
> <!-- not wrapped and separately ordered hidden element -->
> <input type="hidden" name="ID" value="5">
> <!-- starting the definition list -->
> <dl>
> <!-- a normaly decorated element -->
> <dt><label for="DESCRIPTION">Description</label></dt>
> <dd><textarea name="DESCRIPTION" id="DESCRIPTION" rows="5"
> cols="50"></textarea></dd>
> <!-- to elements in one dd tag with one label -->
> <dt><label for="STARTDATETIME_DATEPART" >Start</label></dt>
> <dd><input type="text" name="STARTDATETIME_DATEPART">
> <input type="text" name="STARTDATETIME_TIMEPART" ></dd>
> </dl></form>
>
>

Unfortunately, I won't get it. All works fine with hidden and normal
elements, but not with multiple elements in one row:

1. I take the elements an decorate them as hidden elements, i.e without any
decoration
2. Then I put them together in a display group with this decorator:

array(
'FormElements',
array('HtmlTag', array('tag' => 'dd')),
);

I get this:
<dd>
<input type="text" name="STARTDATETIME_DATEPART" >
<input type="text" name="STARTDATETIME_TIMEPART">
</dd>

That's right. But, this group is placed before my other elements!

I build all hidden elements and group them. Then I build all visible
elements an group them as well, where the InRowElementsGroup is treated as a
simple element:

...
$this->groupElements('hidden', array('ID', 'PARENT_EVENT_ID'));
...
$this->groupElements('visible', array('EVENT', 'LOCATION', 'STARTDATETIME',
'SUBMIT'));

STARTDATETIME is my InRowElementsGroup.

And how I can set the label end the error decorator? I can't add them to the
group decorator, because there are no methods for this in display groups!

This ist what I wand to achive:
<dt><label for="STARTDATETIME_DATEPART" >Start</label></dt>
<dd><input type="text" name="STARTDATETIME_DATEPART">
<input type="text" name="STARTDATETIME_TIMEPART" ></dd>

Can somebody advice my how to get it to work?

Thank you

Axel

--
View this message in context: http://www.nabble.com/Zend_Form_Element-will-be-created-twice-tp18838277p18840405.html
Sent from the Zend MVC mailing list archive at Nabble.com.

没有评论: