[TYPO3-project-formidable] Pass datasource fields through box childs in LISTER

Adrian Föder adrian at foeder.de
Sun Mar 22 16:59:31 CET 2009


...and Hi again,

another occurrence in the same situation:

please remember my code posted previously. I moved the Majix code to a 
codebehind file.
There is my

<column type="renderlet:BUTTON" name="btnEdit" label="Bearbeiten">
   <onclick runat="client" exec="cbAdverthandling.btnEdit_click()" />
</column>

...and corresponding CB:
function btnEdit_click() {
	return array(
	 
$this->oForm->aORenderlets["lstAdverts"]->aOColumns["btnEdit"]->majixReplaceData('Abbrechen'),
		$this->oForm->aORenderlets["lstAdverts"]->aOColumns["editArea"]->majixFx(
			'toggleBlind',
			array('duration' => 0.5)
		)
	);
}

(clicking the button should open the box and change its caption to 
"Abbrechen" (Cancel). Clicking again toggles it to close the box (I 
didn't get how to find out what state the button currently is to apply 
the correct caption back; but however).

Having now my <column type="renderlet:BOX" ... with the <childs> inside, 
there should be a button to "save and close" the data entered:

<renderlet:BUTTON name="btnSaveClose" label="Speichern und schließen">
	<onclick
		runat="ajax"
		params="editArea.title, editArea.price"
		cache="false"
		exec="cbAdverthandling.btnSaveClose_click()"
	/>
</renderlet:BUTTON>

On the CB side, I use the same "object address" for the elements:

function btnSaveClose_click()	{
	//get the submitted params:
	#$aParams = $this->oForm->oMajixEvent->getParams();
	
	return array(
	 
$this->oForm->aORenderlets["lstAdverts"]->aOColumns["btnEdit"]->majixReplaceData('Bearbeiten'),
		$this->oForm->aORenderlets["lstAdverts"]->aOColumns["editArea"]->majixFx(
			'toggleBlind',
			array('duration' => 0.5)
		)
	);
}

but this doesn't work, and that's why:

clicking the first button "edit", that is defined to runat:client, my 
firebug console says

 >>Executing client event sObjectId: advertHandling.lstAdverts.1.btnEdit<<

Clicking the second button "save and close" that is defined to 
runat:ajax, the console says

 >>executeAjaxResponse: single task: No object named 
advertHandling.lstAdverts.btnEdit<<


In the first case there automatically comes the row identifier with the 
call, in our case "1". In the second case there doesn't.


For testing purposes I changed the first button "edit" to runat:ajax 
too, and the same error occurs.
It seems that in AJAX context the object can't be discovered right...


Thanks for helping and a hint,

best,

adrian


Adrian Föder wrote:
> Hi there @ all,
> 
> I am standing in front of a problem and I don't know if it is a "missing 
> feature" or of my approach is completely wrong...
> 
> The thing is the following: I would like the frontend user being enabled 
> to edit recordsets of his own. The base should be a LISTER that lists 
> each recordset, and the visualisation should be a row with each dataset 
> containing some columns that identify the RS and an edit button.
> Clicking that edit button a box should scroll down with "all" fields of 
> that recordset for making the user edit the rest of those entries.
> 
> It's a simple, usual need of edit user's recordsets.
> 
> 
> so I created (sorry for pasting so many code):
> 
> 
> <control>
> 			<datasources>
> 				<datasource:DB name="dsUMadverts">
> 					<sql>
> 						<userobj>
> 							<php><![CDATA[
> 								return 'SELECT * from tx_umadverts_advert WHERE owner = 
> "'.$GLOBALS['TSFE']->fe_user->user['uid'].'"';
> 							]]></php>
> 						</userobj>
> 					</sql>
> 				</datasource:DB>
> 			</datasources>
> 	</control>
> 
> 	<elements>
> 		<renderlet:LISTER name="lstAdverts">
> 			<datasource use="dsUMadverts" />
> 			<template
> 				path="typo3conf/ext/umadverts/pi1/formidable/tplAdverthandling.html"
> 				subpart="###advertlist###"
> 				alternateRows="###ROW###" />
> 			<columns>
> 				<column type="renderlet:TEXT" name="title" style="display:block;" />
> 				<column type="renderlet:TEXT" name="tradebranch" />
> 				<column type="renderlet:BUTTON" name="btnEdit" label="Bearbeiten">
> 				<onclick runat="client">
> 						<userobj><php><![CDATA[/*<?php*/ 						
> 							return 
> $this->aORenderlets["lstAdverts"]->aOColumns["editArea"]->majixFx(
> 								"toggleBlind",
> 								array("duration" => 0.5)
> 							); 						
> 						/*?>*/]]></php></userobj>
> 					</onclick>
> 				</column>
> 				
> 				<column type="renderlet:BOX" name="editArea" mode="div" 
> class="editBox-dropdown" activeListable="true" style="display: none;">
> 					<childs>
> 						<renderlet:TEXT name="title" label="The label 1" />
> 						<renderlet:TEXT name="loc_country" label="The label 2" />
> 						<renderlet:TEXT name="loc_countryzone" label="The label 3" />
> 						<renderlet:TEXT name="loc_freetext" label="...and-so-on..." />
> 						
> 					</childs>
> 				</column>
> 				
> 			</columns>
> 		</renderlet:LISTER>
> 		
> 				
> 	</elements>
> 
> 
> The dropdown then clicking the button works, don't worry; the problem is 
> that the renderlet:TEXT-fields inside the renderlet:box inside the 
> <column> isn't filled with data from the datasource.
> I think as soon as "leaving" the direct <column>-context and inserting a 
> renderlet:box and <child>-Elements, the lister won't assign the database 
> values down there.
> 
> 
> Am I right an/or is there any workaround you know of?
> 
> 
> 
> Thanks and best regards,
> 
> adrian
> _______________________________________________
> TYPO3-project-formidable mailing list
> TYPO3-project-formidable at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-project-formidable
> 
> 


More information about the TYPO3-project-formidable mailing list