Hi all, I'm a very new user of dropwizard framework and i'd like to know 
the correct way of handling form submits in a view. I have a view with a 
list of items I'd like to delete on selection. Fro that i've setup a loop 
using Freemarker and for each item I show a Delete button.
Now I'd like this button sends a submit to my app, I male the necessayre 
deleteion stuff and then return the same page again minus the deleted item.
I tried something like:
<button type="submit" name="composedKey" class="btn btn-danger" 
formaction="/admin/deleteItem" formmethod="post" 
formenctype="multipart/form-data" value="${composedKey}" 
target="_self">Delete</button>

and declared a correct method in my resource class:

@POST
@Path("/deleteItem")
@Consumes(MediaType.MULTIPART_FORM_DATA)
public void delete(@FormDataParam("composedKey") String composedKey) {
log.info("Received form value: " + composedKey);
if (composedKey != null) {
... internal stuff...
}
}

but it doesn not seem to work, when the submit button is clicked the log 
shows the method is called and correct value is recovered, but the page 
doesn't reload....
What am I doing wrong ?

-- 
You received this message because you are subscribed to the Google Groups 
"dropwizard-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dropwizard-user/c20a5113-2d97-4200-82bf-91b488f33a5dn%40googlegroups.com.

Reply via email to