[TYPO3-mvc] JSON - based View

Frank Gerards F.Gerards at esolut.de
Thu May 10 15:10:32 CEST 2012


Hi,

I use the JSON ViewClass standalone now to render such kind of data structure:

Data(array)
   |----Locations(Tx_Extbase_Persistence_QueryResult)
            |--------------- <0...n>(Tx_MyExtension_Domain_Model_ObjektA)
                    |---------------vorname (string)
                    |---------------nachname (string)
                    |--------------- bereich (Tx_Extbase_Persistence_LazyObjectStorage )
                           |---------------<0...n> (Tx_MyExtension_Domain_Model_ObjektB)

<0...n> means, that this is an array of objects corresponding to the number of results returned.

I now have this configuration running:

...->setConfiguration(
              Array(
                 'data' => array(
                    'locations' => array(
                         '_descendAll' => array()
                    )
                 )
             )
      )

What is rendered are all ObjektA array-entries , but NOT the ObjektB entries.

What would be the right syntax for the configuration to render the complete structure down to ObjektB with the ext_js_json_view ?

Greetz,
Frank


-----Ursprüngliche Nachricht-----
Von: typo3-project-typo3v4mvc-bounces at lists.typo3.org [mailto:typo3-project-typo3v4mvc-bounces at lists.typo3.org] Im Auftrag von Frank Gerards
Gesendet: Donnerstag, 26. April 2012 11:53
An: TYPO3 v4 MVC project
Betreff: Re: [TYPO3-mvc] JSON - based View

Hi,
yes - i now set the content-type in the JSONView.php class - works for now, but I think I will enhance my q.a.d. dispatcher :).

Greetz,
frank

-----Ursprüngliche Nachricht-----
Von: typo3-project-typo3v4mvc-bounces at lists.typo3.org [mailto:typo3-project-typo3v4mvc-bounces at lists.typo3.org] Im Auftrag von Dennis Ahrens
Gesendet: Donnerstag, 26. April 2012 10:22
An: typo3-project-typo3v4mvc at lists.typo3.org
Betreff: Re: [TYPO3-mvc] JSON - based View

Hi Frank,

On 25.04.2012 13:52, Frank Gerards wrote:
> thx I initialized it this way and it works like a charm :).
> One small thing I noticed: The response is of content-type text/html, 
> but maybe that is because of my dispatcher... ?!

There was a issue [1] in mvc_extjs in the past related to the content-type. We set the content-type in the RequestHandler. That's why i guess it is because of your dispatcher.

regards
Dennis

[1] http://forge.typo3.org/issues/27526
_______________________________________________
TYPO3-project-typo3v4mvc mailing list
TYPO3-project-typo3v4mvc at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
_______________________________________________
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