简体   繁体   中英

Grails Plugin Uploadr does not get rendered after Ajax call

I've got the following problem, I am using Grails in my application. I like to edit an entry called 'task', so a Foundation 5 Reveal pops out and is showing my form. This Reveal is a template and is being rendered after a click on the edit button of the task, I call my controller with Ajax and put the new data in my Reveal div.

The problem is, that the new data is containing my Uploadr plugin tag and it does not get rendered, it makes sense, but how do I solve this?

<uploadr:add name="myFirstUploadr" path="res/img/aufgaben" 
allowedExtensions="gif,png,jpg,jpeg"/>

and I am getting following Stacktrace:

Error 2013-12-17 13:29:02,573 [http-bio-8090-exec-9] ERROR [/LMS].[default]  - Servlet.service() for servlet [default] in context with path [/LMS] threw exception
Message: It looks like you are missing some calls to the r:layoutResources tag. After rendering your page the following have not been rendered: [defer]
    Line | Method
->> 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|    615 | run       in java.util.concurrent.ThreadPoolExecutor$Worker
^    724 | run . . . in java.lang.Thread

Solution for this is simple, adding the require tag for the Uploadr Plugin to the partial View, not the main layout, so javascript and dependencies can be resolved even on Ajax-Call.

<r:require modules="uploadr"/>

<uploadr:add name="editTaskUploadr" path="${imagePath}" 
                 allowedExtensions="gif,png,jpg,jpeg">

<r:layoutResources/>
<r:layoutResources/>

Has done it, simplified.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM