Julian - Thank you for the suggestion and explanation. It works now Sergey - Thank you for answering my follow up question before I had even asked.
Graham Graham Hopper Director t: 01789 292618 f: 0845 86 220 86 w: forsomethingdifferent.com fb: facebook.com/forsomethingdifferent On Sat, Jul 25, 2015 at 7:31 AM, Sergey Mironov <[email protected]> wrote: > You may check the type signatures by consulting basis.urs from the > Ur/Web's repo. Among other 'built-in' declarations, we may find there > > val ccheckbox : cformTag ([Value = bool, Size = int, Source = source > bool, Onchange = transaction unit] ++ boxAttrs ++ inputAttrs) [] > > ... Onchange = transaction unit ... > > That is how Juian may 'know in advance' the correct style :) > > Regards, > Sergey > > > > 2015-07-24 15:30 GMT+03:00 Julian Squires <[email protected]>: > > On Fri, Jul 24, 2015 at 7:49 AM, Graham Hopper > > <[email protected]> wrote: > >> <ccheckbox onchange={fn _ => alert "Changed!"}/> > > > > Try > > <ccheckbox onchange={alert "Changed!"} /> > > > >> The error is long winded but I think the important part is: > >> > >> Need: > >> <UNIF:U52::{Type}> ++ [Onchange = <UNIF:U69::Type> -> transaction {}] > >> Field: #Onchange > >> Value 1: transaction {} > >> Value 2: <UNIF:U69::Type> -> transaction {} > >> Incompatible constructors > >> Have: transaction {} > >> Need: <UNIF:U69::Type> -> transaction {} > > > > Onchange has the signature transaction unit, where as you might have > > expected it to be like the mouse events (onclick, et cetera) which > > have signature mouseEvent -> transaction unit, which is why they are > > typically written with an anonymous function that discards its > > arguments as you did above. > > > > Hope this helps, > > > > -- > > Julian Squires > > > > _______________________________________________ > > Ur mailing list > > [email protected] > > http://www.impredicative.com/cgi-bin/mailman/listinfo/ur > > _______________________________________________ > Ur mailing list > [email protected] > http://www.impredicative.com/cgi-bin/mailman/listinfo/ur >
_______________________________________________ Ur mailing list [email protected] http://www.impredicative.com/cgi-bin/mailman/listinfo/ur
