[TYPO3-german] Einfacher Filter (PropertyMapper Problem)

Thomas Schuster tschust at gmail.com
Thu Dec 19 15:44:15 CET 2013


Hallo,

ich bin nun schon seit einer Ewigkeit an einem sehr einfachen Problem eigentlich, komme aber nicht weiter.

Ich will in der einer ListAction eine einfache Filterung durchführen.

Mein flow Formular sieht so aus:

<f:form action="list" name="jobFilter" object="{jobFilter}">
	<f:form.select property="categoryId" options="{selectableCategories}" optionLabelField="title"/>
        <f:form.select property="months" options="{selectableMonths}"/>
	<f:form.submit value="Filtern" />
</f:form>



Meine listAction methode:

public function listAction(\TYPO3\Testdata\Domain\Model\JobFilter $jobFilter = NULL) {

	// -- job filter
	$this->view->assign('jobFilter', $jobFilter);

	// -- get jobs
	$this->view->assign('jobs', 
		$this->jobRepository->findAll()
	);
		
	// -- categories
	$this->view->assign('selectableCategories',
		array_merge(
			array(0 => 'Alle Kategorien'),
			$this->jobCategoryRepository->findAll()->toArray()
		)
	);

$selectableMonths = array('0' => 'Alle Monate');
	foreach ($this->jobRepository->findAll() as $job) {
		$dateId = $job->getStartDate()->format('Y-m');
		$selectableMonths[$dateId] = strftime('%B %G', $job->getStartDate()->getTimestamp());
	}
	$this->view->assign('selectableMonths', $selectableMonths);
}


Ich führe noch kein wirkliches Filtern durch, wollte es erst mal schaffen die Formulardaten an die Action zu bringen.

Das Problem ist, dass der PropertyMapper die Formulardaten nicht auf das Object Mappen kann, egal was ich mache - hier bekomme ich immer Exceptions:

Wenn ich mein Filter von AbstractEntity ableite:

#1297759968: Exception while property mapping at property path "":Property "months" was not found in target object of type "TYPO3\Testdata\Domain\Model\JobFilter".

sonst:

#1297759968: Exception while property mapping at property path "":No converter found which can be used to convert from "array" to "TYPO3\Testdata\Domain\Model\JobFilter"




Danke und Gruß
Thomas


More information about the TYPO3-german mailing list