On Jul 9, 2006, at 6:22 AM, Sarah Allen wrote: > Hey Jim, > > Did you ever make this fix? I'm finally using this syntax and took > a look at the docs (trunk about a week ago), unchanged from the 3.3 > reference page: > http://localhost:8080/video/docs/reference/handler.html > Yes, I did, a long time ago. It should be solid against the spec:
http://wiki.openlaszlo.org/Event_and_handler_tags John's spent some time converting examples, but I don't know if he's written anything in the DevGuide about the new syntax. John? > It looks like methodName is still called method, which I find a bit > confusing. Will this be fixed for 3.4? > Do you mean the <handler> attribute is still called @name? I found that confusing as well, but I've gotten used to it and besides it's what we agreed to in the proposal. > There's also no description of what "method" does so I would guess > it is safe to change to it. It would be hard to figure out how to > use that syntax from the reference as is. Also, the description of > name seems to be inherited from node, which is not particularly > helpful. > @method is used to point a handler at a method you have separately declared. It's useful if you want to call the method directly: <handler name="onmyevent" method="handlemyevent"/> <method name="handlemyevent"> ... </method> Perhaps a bug or two filed against the RefGuide would be in order? Thanks, jim > Thanks, > Sarah > > > On Thu, Jan 12, 2006 at 8:47 PM, Jim Grandy wrote: > > > No worries, I'm pretty bad at reading them! > > thanks, > > > jim > > On Jan 12, 2006, at 6:23 PM, Henry Minsky wrote: > > I'm terrible at writing .rnc schemas... > > I'll send you the test cases I was using as soon as I can find them. > > > On 1/12/06, Jim Grandy wrote: I'm converting the base components to > use <event> and <handler>, and ran into something I don't think is > quite right. > > The proposal ( http://wiki.openlaszlo.org/Event_and_handler_tags) > suggests that <handler> should have two forms: <http:// > wiki.openlaszlo.org/Event_and_handler_tags> > > <http://wiki.openlaszlo.org/Event_and_handler_tags> > <handler name="eventName" [reference="..."] [args="..."]> > ... > </handler> > > and > > > <handler name="eventName" [reference="..."] method="methodName" /> > > But the schema entry looks like this: > > > handler = > element handler { > ( nameAttribute | > ( nameAttribute? & > ## The name of the method that this handler will call > attribute method {string} & > ## If this attribute is present, it is a JavaScript expression > ## that evaluates to an object. The code in this method executes > ## when this object sends the event named by the @a{event} > ## attribute. This attribute may be present only if > ## the @a{event} attribute is present too. > [a:defaultValue="this"] > attribute reference {reference}?)) & > ## The parameter names of this method. The value of this > attribute > ## is a comma-separated list of JavaScript identifiers. > [a:defaultValue="" > lza:modifiers="final"] > attribute args {string}? & > text > } > > > > I read this as allowing > > > <handler name="eventName" [args="..."]> ... </handler> > > > or > > > <handler [name="eventName"] method="methodName" [reference="..."] > [args="..."]> ... </handler> > > > Whether text is allowed or not (it shouldn't if @method is given) > is one problem. Another is that I can't write > > > <handler name="eventName" reference="..." args="..."> ... </handler> > > > The workaround for the second is (I think) to split the handler > definition into a handler and a method, but I shouldn't have to do > this. > > > Third, the comment says about @method that "this attribute may be > present only if the @a{event} attribute is present too," but > there's no @event attribute in handler. Does this mean to say @name > instead of @event? > > > If everyone agrees, I'll propose a change to the schema to fix both > of these problems. I don't see a unit test file; Henry, did you > write one when you did the initial implementation? > > > jim > > > > _______________________________________________ > Laszlo-dev mailing list > [email protected] <javascript:lzSetCanvasAttribute > ('js_mailto', '[email protected]')> > http://www.openlaszlo.org/mailman/listinfo/laszlo-dev > > > > > > -- > Henry Minsky > Software Architect > [EMAIL PROTECTED] <javascript:lzSetCanvasAttribute > ('js_mailto', '[EMAIL PROTECTED]')> > > > > > ------------------------------ > > > _______________________________________________ > Laszlo-dev mailing list > [email protected] <javascript:lzSetCanvasAttribute > ('js_mailto', '[email protected]')> > <javascript:lzSetCanvasAttribute('js_mailto', 'Laszlo- > [EMAIL PROTECTED]')> > http://www.openlaszlo.org/mailman/listinfo/laszlo-dev <http:// > www.openlaszlo.org/mailman/listinfo/laszlo-dev> > _______________________________________________ Laszlo-dev mailing list [email protected] http://www.openlaszlo.org/mailman/listinfo/laszlo-dev
