views:

17

answers:

1

I have a template that renders a list of things. I have a submitToRemote Button on this template that then pops up another template overlayed.

inside template2:

Now I have it working nicely. If the template2 submits correctly, the action renders template1 and all is well. The problem is what happens if when submitting template2, the command object has an error. I believe I want to get the action to generate a failure, so that the failure:'groupSpecialtyCreateDiv' updates the groupSpecialtyCreateDiv instead of the groupSpecialtyList div.

Otherwise I am misunderstanding the purpose of the failure update parameter, so is there anyway to correctly handle command errors in this case?

A: 

I found the answer eventually. To trigger the 'failure' condition you need to throw an error status in the controller action; response.status = 409 // conflict

Amoeba