I am interested in creating a widget in Yesod with the following properties:
- By default, it appears simply as some text "Title"
- When you drag in the upper right corner appears a small link "Change it"
- If the user clicks on the link or mouse over it, the text is replaced by a text field / area with text in it, for editing
- When the user presses ENTER, a REST request is made to the server to update the value; when the update is confirmed, the form disappears and the updated text is now present in the document
To a large extent, this is strictly JS work, which is mostly unsuitable for Yesod. However, there is one important point: we would like the form itself to be created by Yesod using Yesod forms and not be manually connected. But the situation here is a little strange: usually the forms are static, but here the form should be different depending on what the data represents, and Yesod may need to send a new form to the user after updating the REST. Can Yesod do this? In addition, what is history, how validation is?
source share