If you set closeAfterEdit to false (from your example) the dialog will not close after post. If you set it to true the will close if there is no error – in case that afterSubmit check this.
The first parameter in afterSubmit should be true and not number (int) as per your example.
The error information apper at top and not at bottom.