Re: DO Formbuilder: crosslinks (checkboxes) Problem solved !! ?
| From: | Alexander Petri | Date: | Mon, 06 Dec 2004 13:20:45 +0000 |
| Subject: | Re: DO Formbuilder: crosslinks (checkboxes) Problem solved !! ? | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-16049@lists.php.net to get a copy of this message | ||
i pointed out another error:
if you have a crosslink, the value "checked" is not setted by the method
setDefaults
there is an array $selected_options which is directly from the DB
and is putted directly into the method _createCheckbox
so it works like setConstants i guess...
but Justin Patrin wrote:
"Leaving a POST in the browser history can easily cause problems"
i dont know really what this means, or if it is a problem for my thoughts to
solve
the "crosslink Problem"
"Alexander Petri" <alex.petri@gmx.de> schrieb im Newsbeitrag
news:20041206123756.2383.qmail@pb1.pair.com...
> The Problem was
> if you do a submit on a form with crosslinks
> and you want to show the form again (direct after it is submitted)
> you will recognize that the "checked"-value on crosslinks are lost...
> (i described the problem a short time ago in this mailing list)
>
>
> Now i hope i solved this Problem:
> in file DB/DataObject/FormBuilder.php Linie (around) 962
> i changed this line:
>
> $crossLinksElement = $this->_createCheckbox($groupName.'[]', $value, $key,
> in_array($key, $selected_options));
>
> to this line:
>
> $crossLinksElement = $this->_createCheckbox($groupName.'['.$key.']',
$value,
> $key, in_array($key, $selected_options));
>
> note this: '['.$key.']'
>
> now it seems to work...
> it would be great to update the whole class if there are no side
effects...
>
> another point are triple links LINE (around)1041
>
> $tripleLinksElement = $this->_createCheckbox('__tripleLink_' .
> $tripleLink['table'] . '[' . $key1 . '][]',
>
> i guess there should be also:
>
> $tripleLinksElement = $this->_createCheckbox('__tripleLink_' .
> $tripleLink['table'] . '[' . $key1 . ']['.$key2.']',