[Ur] Forms that call rpc instead of redirect
Adam Chlipala
adamc at csail.mit.edu
Sun Feb 11 19:09:17 EST 2018
I'm not sure what to suggest. No, there is no existing feature like
what you suggest. I have found it quite pleasant to work with sources
and widgets connected to them. And it is even better to use
higher-level abstractions like in UPO <http://upo.csail.mit.edu/>
(itself likely not applicable to your card game).
On 02/11/2018 05:03 PM, Aistis Raulinaitis wrote:
> Yes I did get a little demo working with ctextbox, cchecbox, and the
> like. However the result is much more verbose and more likely to have
> runtime errors over a regular form.
>
> The way that a form will pack all of its contents into a stuct is a
> clear advantage over the source based route. It requires defining
> possibly many sources and wiring them all into the right slots, having
> to call "get" on each one of them in the onclick handler and then wire
> all the gotten values into the handler.
>
> Losing the form submit struct typing mechanism and the added verbosity
> of all the sources would be very painful if you are expecting the
> majority of your forms to be of this style. Which I am.
>
> On Feb 11, 2018 13:20, "Adam Chlipala" <adamc at csail.mit.edu
> <mailto:adamc at csail.mit.edu>> wrote:
>
> I think that kind of form has gone out of style, and I personally
> almost always use the Ur/Web tags like <ctextbox> to collect data
> and then choose RPCs programmatically.
>
> On 02/11/2018 04:10 PM, Aistis Raulinaitis wrote:
>
> The form mechanism is excellent, with the built in type
> checking, but the submit action function returns a page: state
> -> transaction page.
>
> Is there such a thing such as a version of forms that has a
> submit action function with a type of: state -> transaction unit.
>
> This is so I can call rpc functions there in the submit action
> and then the current page is updated using responses over a
> channel from the server.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.impredicative.com/pipermail/ur/attachments/20180211/98361b5a/attachment-0001.html>
More information about the Ur
mailing list