Closed gbersac closed 10 years ago
I reported a bug ( #33 ) related to your problem. Are you using the latest version of this plugin?
Hi,
I am using the last commit :
commit b629c853814a451817a93d72ebef536b5861bf5a
Merge: 9383e36 890b963
Author: Hakan Dilek <hakandilek@users.noreply.github.com>
Date: Tue Jul 22 20:34:10 2014 +0200
Merge pull request #40 from pablo/master
I am not able to reproduce the problem anymore. Maybe I was still using the old version.
Thanks for your help.
Issue description
When I call to the address : http://localhost:9000/app/User/3/edit I get an error about wrong parameter type for method execution. The exeception has been send from the line 97 of TemplateController.java (in the call method) :
Hypothesis
This is probably a problem of cast of the string in the url to the generic type K of the CRUDController. RouterController.editForm(String name, String key) is call in the route and its argument key is cast implicitly to the type K while relay to ControllerProxyCRUD.editForm(key). This is not throwing any exception at this moment, but it seems like a lack of correct cast come to fame while used in the TemplateController.call function.
The strange thing is that, if I type the url http://localhost:9000/app/User/3/delete, the deletion work fine while the same cast procedure (ie: no procedure) is processed.
Workaround
!!!Warning: ugly code!!!
I have a class User which inherit a class MyCrudController<Long, User> which extend CRUDController<Long, User>. The idea is to render the form independently of the crudPlay plugin, so that I can have my own cast engine (which is very ugly):
This few words solve the entire problem !
User.java
MyCrudController.java
And this is de dao. I don't know what is the utility of that class, but I know it is involved in the process of getting a Model instance out of a key. In case it is helpful.