- Where Developers Learn, Share, & Build Careers
Good afternoon friend.
I have been struggling with a very disappointing problem for the last few days and at the end of my rope, everybody in my team can take some time of that time and this is driving me crazy!
Anyway, I have a controller with the delete action that is called when a user confirms the removal action from the bootstrap modal dialog is called and the redirect statement gets hit properly in the debug . It also shows the call called in Chrome Developer Tool!
But, for some reason, the page never redirects. I have also tried to redirect Google with clearly any other code in action, I do not know what the deal is, I will post a relevant code; Tell me if there is any other code that you may need.
CatalogController.groovy I have tried all kinds of different buttons (g: link, button, g: remote link, etc.) and also cleared the removal action. I have also tried to remove my browser cache, grails cache, running a sleu of grails-clean and other functions to see whether the issue is in my environment, but others do not get redirected either. Please forgive the ugly coding, it will be cleaned after redirection work. I also welcome tips and corrections :) Thank you very much for your time and support! The version currently shown can not work because the remote line will not redirect because the response is parse from JS. She goes. You have to take care of it in javascript manually or Eg: link. Additionally, you can not use the
def delete = {Def catalog = Catalog.get (params.id) if (Catalog: == blank) {Redirect (Controller: 'Home', Action: 'Dashboard') println "Catalog is empty and can not be removed" return} if (request.method == "post") {// catalog .deleted = Correct Testing to Redirect Works (if catalog.validate ()) {userService.addUserActivity ("deleted Catalog" + catalog.title, catalog.class.getName (), Catalog.Id, null) flash.notice = " The catalog has been deleted "catalog.save () println" catalog successfully deleted "} else {flash.error =" deleted There was an error marking the inventory "} Redirect (Controller: 'home') Bootstrap model markup < / P>
& lt; div id = "deleteDialog" class = "modal hide fade" tabindex = "- 1" role = "dialog" aria-labelbedby = "myModalLabel" aria-hidden = "True">
data-dismiss = "modal" with the link, as Twitter Bootstrap will block your click and stop any other server communication. If you delete data = "Model", this will work.
Comments
Post a Comment