[TYPO3-dev] EXTBASE Repository.

Iffland, Sebastian Sebastian.Iffland at ecom-ex.com
Mon Mar 23 06:46:37 CET 2015


Hi Christian,

Have you submitted the argument ³categoryOptions" to the partial in
Edit.html Template?
Should look like:

<f:render partial=³Model/Properties² arguments=³{printitem: printitem,
categoryOptions: categoryOptions}² />

Am 21/03/15 22:15 schrieb "g4-lisz at tonarchiv.ch" unter
<g4-lisz at tonarchiv.ch>:

>Hi Christian
>
>Waht's the line where you define CategoryRepository? Maybe you inject
>the wrong repository class?
>
>Bye
>Till
>
>On 03/21/2015 09:43 PM, Christian Tauscher wrote:
>> Hello.
>>
>> I have a DB table printitem.
>> A second table category which printitem is categoized.
>>
>> In Create/Edit Mode I want a select field with category.
>>
>> fluid.partial:
>> ---------------
>> <f:form.select property="substrate" options="{categoryOptions}" />
>>
>>
>>
>> /**
>>  * action edit
>>  *
>>  * @param \Tmd\screenprinting\Domain\Model\Printitem $printitem
>>  * @ignorevalidation $printitem
>>  * @return void
>>  */
>> public function editAction(\Tmd\screenprinting\Domain\Model\Printitem
>> $printitem) {
>>   $this->view->assign('printitem', $printitem);
>>   $allItems = $this->CategoryRepository->findAll();
>>
>>   foreach($allItems as $item) {
>>     $options[$item->getUid()] = $item->getName();
>>   }
>>   $this->view->assign('categoryOptions', $options);
>> }
>>
>>
>> The Problem:
>> in $options is not the Expected Array of Category but of Printitem.
>>
>> ???
>>
>> What is wrong.
>> I have added Class/Controller/Repositpry/CategoryRepository.php whith
>> no other result.
>>
>> <?php
>> namespace Tmd\Screenprinting\Domain\Repository;
>> /**
>>  * The repository for Category
>>  */
>> class CategoryRepository extends
>> \TYPO3\CMS\Extbase\Persistence\Repository {
>> }
>>
>>
>> Next try:
>> I habe a next table branch. Same as bevor, only different Name.
>>
>> changin the CategoryRepository zu branch
>>   $allItems = $this->branchRepository->findAll();
>>
>> leads to.
>>
>> Fatal error: Call to a member function findAll() on a non-object in
>> .../screenprinting/Classes/Controller/PrintitemController.php on line
>>158
>>
>>
>>
>> WTF....
>>
>>
>>
>>
>>
>> Thank you for your help,
>>
>> Christian
>>
>> PS:
>> rm * typo3temp/Cache/*,
>> clearing cache in BE does not help.
>>

Mit freundlichen Grüßen
Kind regards

Sebastian Iffland
Senior Web Developer

Phone: +49 6294 4224 994  •  Fax: +49 6294 4224 100
E-Mail: mailto:Sebastian.Iffland at ecom-ex.comhttp://www.ecom-ex.com



THINK GREEN - KEEP IT ON THE SCREEN

_______________________________________________
>> TYPO3-dev mailing list
>> TYPO3-dev at lists.typo3.org
>> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-dev
>
>_______________________________________________
>TYPO3-dev mailing list
>TYPO3-dev at lists.typo3.org
>http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-dev



ecom instruments GmbH
Industriestraße 2  •  97959 Assamstadt  •  Germany

Headquarters: Assamstadt  •  District Court Ulm: HRB 680352
Chief Executive Officer: Dipl. Ing. (FH) Rolf Nied  •  Customs Tax-No.: DE 146589088

_______________________________________________
>> TYPO3-dev mailing list
>> TYPO3-dev at lists.typo3.org
>> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-dev
>
>_______________________________________________
>TYPO3-dev mailing list
>TYPO3-dev at lists.typo3.org
>http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-dev




More information about the TYPO3-dev mailing list