yes, i'm using mg3; trying <cfset myEvent = arguments.event.getInitialEventHandlerName() > i get:
Message You have attempted to dereference a scalar variable of type class java.lang.String as a structure with members. Detail Extended Info Tag Context C:\ColdFusion8\wwwroot\ModelGlue\gesture\eventrequest \EventContext.cfc (451) C:\ColdFusion8\wwwroot\newArtea\controller\loginController.cfc (12) C:\ColdFusion8\wwwroot\ModelGlue\gesture\eventrequest\EventContext.cfc (328) C:\ColdFusion8\wwwroot\ModelGlue\gesture\eventrequest\EventContext.cfc (255) C:\ColdFusion8\wwwroot\ModelGlue\gesture\eventrequest\phase \Invocation.cfc (59) C:\ColdFusion8\wwwroot\ModelGlue\gesture\eventrequest\EventContext.cfc (180) C:\ColdFusion8\wwwroot\ModelGlue\gesture\ModelGlue.cfc (223) C:\ColdFusion8\wwwroot\modelGlue\gesture\ModelGlue.cfm (77) C:\ColdFusion8\wwwroot\newArtea\index.cfm (72) using <cfset myEvent = arguments.event.getEventHandlerName() > Message You have attempted to dereference a scalar variable of type class java.lang.String as a structure with members. Detail Extended Info Tag Context C:\ColdFusion8\wwwroot\ModelGlue\gesture\eventrequest \EventContext.cfc (455) C:\ColdFusion8\wwwroot\newArtea\controller\loginController.cfc (12) C:\ColdFusion8\wwwroot\ModelGlue\gesture\eventrequest\EventContext.cfc (328) C:\ColdFusion8\wwwroot\ModelGlue\gesture\eventrequest\EventContext.cfc (255) C:\ColdFusion8\wwwroot\ModelGlue\gesture\eventrequest\phase \Invocation.cfc (59) C:\ColdFusion8\wwwroot\ModelGlue\gesture\eventrequest\EventContext.cfc (180) C:\ColdFusion8\wwwroot\ModelGlue\gesture\ModelGlue.cfc (223) C:\ColdFusion8\wwwroot\modelGlue\gesture\ModelGlue.cfm (77) C:\ColdFusion8\wwwroot\newArtea\index.cfm (72) bye On 26 Mag, 16:19, Dan Wilson <[email protected]> wrote: > If you happen to be using MG 3, there are 2 methods on the event which might > be of use. > getInitialEventHandlerName() > > getEventHandlerName() > > The preference is to use getInitialEventHandlerName as it is more explicit > in what it does and makes more sense when chaining events. > getEventHandlerName() will return the same value, but could lead to > confusion in complicated chained event scenarios. > > Are you using MG3? If so, would you please verify these methods do what you > need them to? > > DW > > On Tue, May 26, 2009 at 10:14 AM, salvatore fusto <[email protected]>wrote: > > > > > > > > > all together now! > > seriously, this is fine, thank you all. > > salvatore > > > On 26 Mag, 15:59, Dan Wilson <[email protected]> wrote: > > > It really isn't a hack, it is just a nested function. > > > The value of the event is inside of the Event object, so we use > > > arguments.event.getValue() to return it. > > > > Since ModelGlue allows any key name to be used for the event, you can > > change > > > event=Some.Event, to x= Some.Event, or even whatever= Some.Event. The > > price > > > for this abstraction is you gotta dynamically determine which key you are > > > using... by this function: arguments.event.getValue("eventValue"). So put > > > all together: > > > > arguments.event.getValue(arguments.event.getValue("eventValue")) > > > > Now you can get the name of the event, however you choose to refer to the > > > event. Hack-free, Future Proof. Compact, Yet Stylish, no? > > > > DW > > > > On Tue, May 26, 2009 at 9:48 AM, salvatore fusto <[email protected] > > >wrote: > > > > > Yup, this works, but is so strange (it seems an hack) so can yoy > > > > expalin me? > > > > thanks > > > > salvatore > > > > > On 26 Mag, 14:41, Tom McNeer <[email protected]> wrote: > > > > > Salvatore, > > > > > > On Tue, May 26, 2009 at 3:20 AM, salvatore fusto < > > [email protected] > > > > >wrote: > > > > > > > in mg1 i used to extract the name of the triggered event with a > > > > > > trivial event.getEventHandlerName() in the onRequestStart of a > > > > > > controller: how can i do the same in mg3? > > > > > > Try: > > > > > > arguments.event.getValue(arguments.event.getValue("eventValue")) > > > > > > -- > > > > > Thanks, > > > > > > Tom > > > > > > Tom McNeer > > > > > MediumCoolhttp://www.mediumcool.com > > > > > 1735 Johnson Road NE > > > > > Atlanta, GA 30306 > > > > > 404.589.0560 > > > > -- > > > “Come to the edge, he said. They said: We are afraid. Come to the edge, > > he > > > said. They came. He pushed them and they flew.” > > > > Guillaume Apollinaire quotes- Nascondi testo citato > > > > - Mostra testo citato - > > -- > “Come to the edge, he said. They said: We are afraid. Come to the edge, he > said. They came. He pushed them and they flew.” > > Guillaume Apollinaire quotes- Nascondi testo citato > > - Mostra testo citato - --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "model-glue" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/model-glue?hl=en For more about Model-Glue, check http://www.model-glue.com . -~----------~----~----~----~------~----~------~--~---
