[TYPO3-mvc] Re: TYPO3 6.x way for extbase ajax applications
Joerg Schoppet
joerg at schoppet.de
Tue Apr 16 12:09:20 CEST 2013
Hi Robert,
thanks for the answer. But I have a more general problem.
I have a class \DerJoerg\Example\Domain\Model\Driver which extends \TYPO3\CMS\Extbase\Domain\Model\FrontendUser.
In the "DriverController" I have a simple listAction, which just displays all "Drivers". --> Working.
<snippet>
$drivers = $this->driverRepository->findAll();
$this->view->assign(...);
</snippet>
If I call this through the "ajax-way" (either by typeNum or eID) and modify the action to:
<snippet>
$drivers = $this->driverRepository->findAll();
$result = new array();
foreach ($drivers as $driver) {
$result[] = $driver->getUsername();
}
return json_encode($result);
</snippet>
It returns an empty array :(
Joerg
Quote: Robert Böttner wrote on Tue, 16 April 2013 11:53
----------------------------------------------------
> Hi Joerg,
>
> depending what you are doing with the response you´ll have to return it in that way. If you are using the method to load data into an ExtJS store your response has to be a json object structured like the your stores underlying model. If you are using HTML as a return a simple panel.update() with your response text should do.
>
> I´m using the eID approach and a store configuration may look like:
>
>
> Best
> Robert.
>
>
> Am 16.04.2013 um 11:17 schrieb Joerg Schoppet <joerg at schoppet.de>:
>
> > Hi list,
> >
> > I'm in the process of creating a new extension, which should be up-to-date regarding the coding-standards of TYPO3 6.x and extbase. Additionally I want to create a complete ExtJS application in the frontend.
> >
> > I found some (not so much) information in the web (including the blog of Daniel Lienert and also the pt_extbase extension).
> >
> > I tried the typeNum-way and also the eID-way, but still I have one unresolveable problem.
> >
> > With the extbase_kickstarter I created an extension, which holds a class which extends the fe_users class from Extbase. Currently this class doesn't has any additional fields.
> >
> > If I create new frontend-users with this "type" I can have the list-action in the frontend output all the users.
> >
> > BUT
> >
> > If I try to get these users with an ajax-request (typeNum- or eID-way) I get no result.
> >
> > Can anybody point me in the right direction what the problem is?
> >
> >
> > Thanks a lot.
> >
> > Joerg
> > _______________________________________________
> > TYPO3-project-typo3v4mvc mailing list
> > TYPO3-project-typo3v4mvc at lists.typo3.org
> > http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
----------------------------------------------------
More information about the TYPO3-project-typo3v4mvc
mailing list