[Ur] event propagation

Julian Squires julian at cipht.net
Thu May 7 09:38:15 EDT 2015


I tried to write something like the following:

 datatype s = A | B | C

 fun main () =
     s <- source A;
     return <xml><body><form>
       <radio{#Test}>
         <radioOption value="A" onclick={fn _ => set s A} />
         <radioOption value="B" onclick={fn _ => set s B} />
         <radioOption value="C" onclick={fn _ => set s C} />
       </radio>
       <dyn signal={v <- signal s;
                    return <xml><div>{[case v of A => "A"
                                               | B => "B"
                                               | C => "C"]}</div></xml>} />
     </form></body></xml>

Because the onclick event handler produced is hard-coded to return
false, the radio buttons don't update correctly.

I have applied the attached patch to my own installation to get around
it, but I imagine this might break existing code.  It seems like one
would want more explicit control of the return value of the event
handler.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: no-return-false.patch
Type: text/x-diff
Size: 1143 bytes
Desc: not available
URL: <http://www.impredicative.com/pipermail/ur/attachments/20150507/750b589f/attachment.patch>
-------------- next part --------------

--
Julian Squires


More information about the Ur mailing list