[TYPO3-mvc] Loading JS files in Extbase plugins: best practice?

François Suter fsu-lists at cobweb.ch
Tue Mar 29 11:08:19 CEST 2011


Hi,

> Next question: I need to load this JS file only for some actions, not
> for all them. For example, I placed my code in the newAction() method.
> This works fine. But when I submit the data and have one or more
> validation errors, the create action redirects to the new action. And in
> this case, my JS file is not loaded. I'm assuming that it's being called
> too late and thus the JS file is not loaded, but I'm not sure. In such a
> case where would be the right place to call up the loading of the JS file?

Still no luck. I tried to load my JS file from within initializeView() 
or initializeAction(), but no luck. As soon as there's an internal 
redirection (in this case from "create" action to "new" action, because 
there are validation errors), my JS file does not get loaded.

Does anyone have an idea where I should place my loading call so that it 
doesn't get lost upon redirection?

Cheers

-- 

Francois Suter
Cobweb Development Sarl - http://www.cobweb.ch


More information about the TYPO3-project-typo3v4mvc mailing list