[TYPO3-project-formidable] Comment / questions and perhaps a solution to bug 10631 (Duplicate ID in renderlet:LISTER)

Jerome Schneider typo3dev at ameos.com
Mon Mar 9 12:06:33 CET 2009


Hi Hauke,

This postFlag is a feature that has been added in revision 307, to 
enable further Formidable enhancements (the databridges, edition of 
multiple records simultaneously, or edition directly in the lister)

I'll consider integrating your proposition in the core. I added a 
question to the bugtracker BTW (http://bugs.typo3.org/view.php?id=10641)

Kind regards,
Jerome Schneider

PS: Here's an excerpt of the revision 2.0.307 changelog:

Revision 307
Modified Fri Feb 13 10:37:55 2009 UTC (3 weeks, 3 days ago) by 
jschneiderameos
api/base/dh_db/api/class.tx_dhdb.php:
   -> getDataPreparedForDB(): readonly renderlets are now saved to DB

api/class.maindatahandler.php:
   -> getRdtValue_submit_readonly_noEdition(): readonly now behaves as 
it should with defaultValue and value

api/class.mainrenderlet.php:
   -> _renderReadOnly(): renderonly renderlets now add a hidden 
"postflag" to the page, to easily determine whether they were posted or 
not (it's not insecure, as it does not carry the value in any way)




Hauke Hain a écrit :
> Hi,
> 
> this thread refers to the following bug:
> 0010631: Not XHTML valid code: Duplicate ID in renderlet:LISTER
> http://bugs.typo3.org/view.php?id=10631
> 
> 
> I pointed out where the double ID is set:
> function &_refineRow(&$aRow)
>    function renderReadOnlyWithForcedValue
>        function _renderReadOnly()
> 
> in line 382:
> $sPostFlag = "<input type=\"hidden\" id=\"" . $this->_getElementHtmlId() 
> . "\" name=\"" . $this->_getElementHtmlName() . "\" value=\"1\" />";
> 
> It would be a simple solution to add some charakter to avoid the double id:
> $sPostFlag = "<input type=\"hidden\" id=\"" . $this->_getElementHtmlId() 
> . "Input\" name=\"" . $this->_getElementHtmlName() . "\" value=\"1\" />";
> 
> 
> Another possibility (I prefer it) is to change the id name in
> function wrapForReadOnly($sHtml)
> line 407
> 
> 
> I have a few questions regarding this problem:
> Does formidable need the hidden inputs and the span-Tags generated by
> function _renderReadOnly() -> $sPostFlag
> function wrapForReadOnly($sHtml)
> ?
> And for what does it need it?
> 
> I prefer the code generated if I change line 382 from
> $sCompiled = $this->wrapForReadOnly($mHuman) . $sPostFlag;
> To
> $sCompiled = $mHuman;
> 
> It is less HTML-Code, so the page can be faster loaded if there are 
> pretty big lists and I do not notice any different behaviour of 
> formidable. Everything seems to work fine.
> 
> 
> However, because I don't need the tags and perhaps somebody else also, I 
> made a few adjustements to set via the XML-file if thehidden 
> input-fields and the span tags should be generated:
> 
> 
> ameos_formidable\api\class.mainrenderlet.php:
> Replace line 370 with (", $humanOnly" is added):
> function renderReadOnlyWithForcedValue($mValue, $humanOnly) {
> 
> Replace line 377 with ("$humanOnly=0" is added):
> function _renderReadOnly($humanOnly=0) {
> 
> 
> Replace line 383 ("$sCompiled = $this->wrapForReadOnly($mHuman) . 
> $sPostFlag;") with the following:
> 
>   if ($humanOnly) {
>        $sCompiled = $mHuman;
>      } else {
>        $sCompiled = $this->wrapForReadOnly($mHuman) . $sPostFlag;
>      }
> 
> 
> 
> ameos_formidable\api\base\rdt_lister\api\class.tx_rdtlister.php:
> Add the following function to the class:
> 
>  function humanOutputOnly() {
>    if ($this->_navConf("/template/nospanandhiddeninput") === TRUE)
>      return TRUE;
>    return FALSE;
>  }
> 
> Replace line 1299
> $this->aOColumns[$sName]->renderReadOnlyWithForcedValue($aRow[$sName]),
> 
> With
> $this->aOColumns[$sName]->renderReadOnlyWithForcedValue($aRow[$sName],$this->humanOutputOnly()), 
> 
> 
> 
> Replace line 1325
> $this->aOColumns[$sName]->renderReadOnlyWithForcedValue($mValue),
> 
> With
> $this->aOColumns[$sName]->renderReadOnlyWithForcedValue($mValue,$this->humanOutputOnly()), 
> 
> 
> 
> 
> In your XML-file you may set
>   <template noSpanAndHiddenInput="True"/>
> in <renderlet:LISTER>
> 
> 
> 
> It would be great if you can fix the bug on a way formidable likes it.
> And I would really appreciate it, if formidable gets the ability like 
> "noSpanAndHiddenInput" in a upcoming SVN version.
> 
> 
> Kind regards,
> Hauke


More information about the TYPO3-project-formidable mailing list