Cancel onAccepted [answered]
Hi,
I am wondering if it is possible to stop accepting a Dialog. Before saving the data I would like to check them and if there is an error I want to stay on the Dialog page. The documentation tells me that onDone is executed before onAccepted but how do I manage to stay on the page?
Thanks
One way to do it is use onDone (called before onAccepted or onRejected), validate input and set canAccept property accordingly.
koudi ( 2014-08-22 11:26:33 +0200 )editI already tried that. All that happens is that I get a grey layer on top of everything but the dialogue still closes. My plan was to keep the user on the page until a valid input was done or he rejects.
What I did is setting canAccept = false when my check logic returns an error. I guessed that is the way to do it. Is there another way?
FloR707 ( 2014-08-22 15:38:58 +0200 )editIf you can check them "real-time" ? Default canAccept to false and when everything is ok set canAccept to true?
Atleast usable with validator checks in TextField (acceptableInput)
kimmoli ( 2014-08-22 23:40:43 +0200 )editYou might try calling reject() in onDone (haven't tried).
koudi ( 2014-08-23 11:47:46 +0200 )edit