Using MapAsync after WithSubmit is they way to go. If you want to add errors on some conditions you can use MapAsyncResult or MapResult.

By on 1/15/2016 1:58 AM ()

Hi Istvan, thanks for the reply. I can't figure out how to use MapAsyncResult and MapResult. Could you add it on top of the sample I pasted?

I would want to show an error message when the response of the Authentication.login returns a Failure and show a success message when it returns Success.

By on 1/15/2016 2:37 AM ()

Sorry, you actually want to use MapToAsyncResult here, and you need Form.TransmitView too if you want to get the final result as a View<Result<'T>> in the render function. Here's an example.

By on 1/15/2016 2:59 AM ()

Nice thanks, clear and simple.

By on 1/15/2016 3:26 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper