Tutorial "More Event Examples", wf:wire doesn't work with several #event in [] #29

Closed
thorwil opened this Issue Mar 10, 2011 · 1 comment

Projects

None yet

3 participants

thorwil commented Mar 10, 2011
wf:wire(mybutton, [
    #event { type=mouseover, postback=my_mouseover_event }
    #event { type=click, postback=my_click_event }
    #event { type=mouseout, postback=my_mouseout_event }
]),

As in the tutorial will result in only the last one working.
This instead does work, but makes me really wish the shorter way would, too:

wf:wire(mybutton, #event { type=mouseover, postback=my_mouseover_event }),
wf:wire(mybutton, #event { type=click, postback=my_click_event }),
wf:wire(mybutton, #event { type=mouseout, postback=my_mouseout_event }),

BTW, on the same tutorial slide, there's an MyEvent that should be OtherEvent. But many thanks for writing it in the first place ;)

Mutisk commented Jul 22, 2011

I think this is a typo in the tutorial. It stumped me for a while too, but I got it to work by adding commas. As such:

wf:wire(mybutton, [
        #event { type=mouseover, postback=my_mouseover_event },
        #event { type=click, postback=my_click_event },
        #event { type=mouseout, postback=my_mouseout_event }
    ]),
@choptastic choptastic closed this Jun 9, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment