IdentityManager Event Listeners using AMD Syntax

422
2
Jump to solution
06-06-2013 06:57 AM
PhilHolleran
Occasional Contributor
I am trying to connect to the IdentityManager's "onDialogCancel" event and am not having success trying to adapt the legacy dojo style referenced here: http://forums.arcgis.com/threads/66410-Identity-Manager-Event-Listeners?highlight=identity+manager+c... to AMD.

The app is written using v 3.5 of the JSAPI.

Here is the code, inside of a define that includes, among other things, [on,IdentityManager,esriPortal]:


function logIn(){
[INDENT]currentPortal = new esriPortal.Portal(registry.byId("portalInput").get("value"));[/INDENT]

[INDENT]on(esri.id, "onDialogCancel", function(info){[/INDENT]
[INDENT][INDENT]console.log("cancelled");[/INDENT][/INDENT]
[INDENT]});[/INDENT]

[INDENT]currentPortal.signIn().then(function(loggedInUser){[/INDENT]
[INDENT][INDENT]// function here[/INDENT][/INDENT]
[INDENT]});[/INDENT]
}

I appreciate any help people can provide.

Thanks.
0 Kudos
1 Solution

Accepted Solutions
KellyHutchins
Esri Frequent Contributor
You need to use the 'On Style Events' syntax. To find the appropriate syntax navigate to the API reference for the Identity Manager then in the Events section click the 'On Style Events' link. Then you'll see the new event names - for example you'll need to use dialog-cancel instead of OnDialogCancel.

http://developers.arcgis.com/en/javascript/jsapi/identitymanager.html

View solution in original post

0 Kudos
2 Replies
KellyHutchins
Esri Frequent Contributor
You need to use the 'On Style Events' syntax. To find the appropriate syntax navigate to the API reference for the Identity Manager then in the Events section click the 'On Style Events' link. Then you'll see the new event names - for example you'll need to use dialog-cancel instead of OnDialogCancel.

http://developers.arcgis.com/en/javascript/jsapi/identitymanager.html
0 Kudos
PhilHolleran
Occasional Contributor
Thanks, Kelly.  Works like a charm.
0 Kudos