Accessing dojo button outside script

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Accessing dojo button outside script

Koren, Bradley

Hello,

 

I have a script that contains a dojo button widget. The button is created in the script as follows. 

 

Then outside the dojo script, in another script I need to enable this button. Can the button be accessed in the other script? 

 

 

SCRIPT:        var btnSave = new Button({

               id: "_OK",

               name: "OK",

               label: "Submit",

               disabled: 'disabled',

               onClick: function () {

                   save();

               },

               required: false,

               autoComplete: true,

           }, "_OK").startup();

 

 

HTML:     <button id='_OK'>Submit</button>&nbsp;

 

Thanks for any help!



This County of Chester e-mail message, including any attachments, is intended for the sole use of the individual(s) and entity(ies) to whom it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended addressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use, copy, disclose or distribute to anyone this e-mail message including any attachments, or any information contained in this e-mail message including any attachments. If you have received this e-mail message in error, please immediately notify the sender by reply e-mail and delete the message. Thank you very much.
--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|

Re: Accessing dojo button outside script

theinnkeeper
var button = dijit.registry.byId("_OK");


--
Ricardo Diaz-Albertini




On Wed, 4 Mar 2015 18:15:30 +0000, "Koren, Bradley" <[hidden email]> wrote:

Hello,

 

 

I have a script that contains a dojo button widget. The button is created in the script as follows. 

 

 

Then outside the dojo script, in another script I need to enable this button. Can the button be accessed in the other script? 

 

 

 

SCRIPT:        var btnSave = new Button({

 

               id: "_OK",

 

               name: "OK",

 

               label: "Submit",

 

               disabled: 'disabled',

 

               onClick: function () {

 

                   save();

 

               },

 

               required: false,

 

               autoComplete: true,

 

           }, "_OK").startup();

 

 

 

HTML:     <button id='_OK'>Submit</button>&nbsp;

 

 

Thanks for any help!

 



This County of Chester e-mail message, including any attachments, is intended for the sole use of the individual(s) and entity(ies) to whom it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended addressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use, copy, disclose or distribute to anyone this e-mail message including any attachments, or any information contained in this e-mail message including any attachments. If you have received this e-mail message in error, please immediately notify the sender by reply e-mail and delete the message. Thank you very much.



--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest

--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|

Re: Accessing dojo button outside script

Harry Devine
In reply to this post by Koren, Bradley
dijit/registry or dojo/dom should be able to do this:

require(["dijit/registry"], function(registry) {
  registry.byId("_OK").setDisabled(false);
  // or use dom.byId instead
});

Hope this helps.
Harry


From: "Bradley Koren" <[hidden email]>
To: "[hidden email]" <[hidden email]>
Sent: Wednesday, March 4, 2015 1:15:30 PM
Subject: [Dojo-interest] Accessing dojo button outside script

Hello,

 

I have a script that contains a dojo button widget. The button is created in the script as follows. 

 

Then outside the dojo script, in another script I need to enable this button. Can the button be accessed in the other script? 

 

 

SCRIPT:        var btnSave = new Button({

               id: "_OK",

               name: "OK",

               label: "Submit",

               disabled: 'disabled',

               onClick: function () {

                   save();

               },

               required: false,

               autoComplete: true,

           }, "_OK").startup();

 

 

HTML:     <button id='_OK'>Submit</button>&nbsp;

 

Thanks for any help!



This County of Chester e-mail message, including any attachments, is intended for the sole use of the individual(s) and entity(ies) to whom it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended addressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use, copy, disclose or distribute to anyone this e-mail message including any attachments, or any information contained in this e-mail message including any attachments. If you have received this e-mail message in error, please immediately notify the sender by reply e-mail and delete the message. Thank you very much.
--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest


--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|

Re: Accessing dojo button outside script

Karl Tiedt
For the record, dom.byId is *NEVER* the answer to anything widget related. Always use register.by* methods to access widgets you do not have saved references for.

-Karl Tiedt

On Wed, Mar 4, 2015 at 10:21 AM, Harry Devine <[hidden email]> wrote:
dijit/registry or dojo/dom should be able to do this:

require(["dijit/registry"], function(registry) {
  registry.byId("_OK").setDisabled(false);
  // or use dom.byId instead
});

Hope this helps.
Harry


From: "Bradley Koren" <[hidden email]>
To: "[hidden email]" <[hidden email]>
Sent: Wednesday, March 4, 2015 1:15:30 PM
Subject: [Dojo-interest] Accessing dojo button outside script


Hello,

 

I have a script that contains a dojo button widget. The button is created in the script as follows. 

 

Then outside the dojo script, in another script I need to enable this button. Can the button be accessed in the other script? 

 

 

SCRIPT:        var btnSave = new Button({

               id: "_OK",

               name: "OK",

               label: "Submit",

               disabled: 'disabled',

               onClick: function () {

                   save();

               },

               required: false,

               autoComplete: true,

           }, "_OK").startup();

 

 

HTML:     <button id='_OK'>Submit</button>&nbsp;

 

Thanks for any help!



This County of Chester e-mail message, including any attachments, is intended for the sole use of the individual(s) and entity(ies) to whom it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended addressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use, copy, disclose or distribute to anyone this e-mail message including any attachments, or any information contained in this e-mail message including any attachments. If you have received this e-mail message in error, please immediately notify the sender by reply e-mail and delete the message. Thank you very much.
--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest


--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest



--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|

Re: Accessing dojo button outside script

Koren, Bradley

Yes, but my issue is that I want to access the id from javascript that is not dojo enabled.

 

Can a javascript method that is not part of dojo access the id?

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Karl Tiedt
Sent: Wednesday, March 04, 2015 1:24 PM
To: [hidden email]
Subject: Re: [Dojo-interest] Accessing dojo button outside script

 

For the record, dom.byId is *NEVER* the answer to anything widget related. Always use register.by* methods to access widgets you do not have saved references for.


-Karl Tiedt

 

On Wed, Mar 4, 2015 at 10:21 AM, Harry Devine <[hidden email]> wrote:

dijit/registry or dojo/dom should be able to do this:

 

require(["dijit/registry"], function(registry) {

  registry.byId("_OK").setDisabled(false);

  // or use dom.byId instead

});

 

Hope this helps.

Harry

 


From: "Bradley Koren" <[hidden email]>
To: "[hidden email]" <[hidden email]>
Sent: Wednesday, March 4, 2015 1:15:30 PM
Subject: [Dojo-interest] Accessing dojo button outside script

 

 

Hello,

 

I have a script that contains a dojo button widget. The button is created in the script as follows. 

 

Then outside the dojo script, in another script I need to enable this button. Can the button be accessed in the other script? 

 

 

SCRIPT:        var btnSave = new Button({

               id: "_OK",

               name: "OK",

               label: "Submit",

               disabled: 'disabled',

               onClick: function () {

                   save();

               },

               required: false,

               autoComplete: true,

           }, "_OK").startup();

 

 

HTML:     <button id='_OK'>Submit</button>&nbsp;

 

Thanks for any help!



This County of Chester e-mail message, including any attachments, is intended for the sole use of the individual(s) and entity(ies) to whom it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended addressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use, copy, disclose or distribute to anyone this e-mail message including any attachments, or any information contained in this e-mail message including any attachments. If you have received this e-mail message in error, please immediately notify the sender by reply e-mail and delete the message. Thank you very much.

--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

 

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest

 


--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest

 


--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|

Re: Accessing dojo button outside script

Karl Tiedt
W/o using any dijit API's you would need to expose your button somehow to this other script.... You could access the raw domNode button that Dijit creates but you wont be able to modify the actual Widget instance of the button...

-Karl Tiedt

On Wed, Mar 4, 2015 at 10:26 AM, Koren, Bradley <[hidden email]> wrote:

Yes, but my issue is that I want to access the id from javascript that is not dojo enabled.

 

Can a javascript method that is not part of dojo access the id?

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Karl Tiedt
Sent: Wednesday, March 04, 2015 1:24 PM
To: [hidden email]
Subject: Re: [Dojo-interest] Accessing dojo button outside script

 

For the record, dom.byId is *NEVER* the answer to anything widget related. Always use register.by* methods to access widgets you do not have saved references for.


-Karl Tiedt

 

On Wed, Mar 4, 2015 at 10:21 AM, Harry Devine <[hidden email]> wrote:

dijit/registry or dojo/dom should be able to do this:

 

require(["dijit/registry"], function(registry) {

  registry.byId("_OK").setDisabled(false);

  // or use dom.byId instead

});

 

Hope this helps.

Harry

 


From: "Bradley Koren" <[hidden email]>
To: "[hidden email]" <[hidden email]>
Sent: Wednesday, March 4, 2015 1:15:30 PM
Subject: [Dojo-interest] Accessing dojo button outside script

 

 

Hello,

 

I have a script that contains a dojo button widget. The button is created in the script as follows. 

 

Then outside the dojo script, in another script I need to enable this button. Can the button be accessed in the other script? 

 

 

SCRIPT:        var btnSave = new Button({

               id: "_OK",

               name: "OK",

               label: "Submit",

               disabled: 'disabled',

               onClick: function () {

                   save();

               },

               required: false,

               autoComplete: true,

           }, "_OK").startup();

 

 

HTML:     <button id='_OK'>Submit</button>&nbsp;

 

Thanks for any help!



This County of Chester e-mail message, including any attachments, is intended for the sole use of the individual(s) and entity(ies) to whom it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended addressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use, copy, disclose or distribute to anyone this e-mail message including any attachments, or any information contained in this e-mail message including any attachments. If you have received this e-mail message in error, please immediately notify the sender by reply e-mail and delete the message. Thank you very much.

--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

 

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest

 


--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest

 


--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest



--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|

Re: Accessing dojo button outside script

dylanks
Within your Dojo code where you create the widget, you could store the
widgetId or widget ref as some global property, or perhaps as a setting
on your dojoConfig. Not that you really want to do that, but you could.

on 3/4/15, 11:29 (GMT-07:00) Karl Tiedt said the following:

> W/o using any dijit API's you would need to expose your button somehow
> to this other script.... You could access the raw domNode button that
> Dijit creates but you wont be able to modify the actual Widget instance
> of the button...
>
> -Karl Tiedt
>
> On Wed, Mar 4, 2015 at 10:26 AM, Koren, Bradley <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     Yes, but my issue is that I want to access the id from javascript
>     that is not dojo enabled. ____
>
>     __ __
>
>     Can a javascript method that is not part of dojo access the id?____
>
>     __ __
>
>     *From:*[hidden email]
>     <mailto:[hidden email]>
>     [mailto:[hidden email]
>     <mailto:[hidden email]>] *On Behalf Of
>     *Karl Tiedt
>     *Sent:* Wednesday, March 04, 2015 1:24 PM
>     *To:* [hidden email]
>     <mailto:[hidden email]>
>     *Subject:* Re: [Dojo-interest] Accessing dojo button outside script____
>
>     __ __
>
>     For the record, dom.byId is *NEVER* the answer to anything widget
>     related. Always use register.by <http://register.by>* methods to
>     access widgets you do not have saved references for.____
>
>
>     ____
>
>     -Karl Tiedt____
>
>     __ __
>
>     On Wed, Mar 4, 2015 at 10:21 AM, Harry Devine <[hidden email]
>     <mailto:[hidden email]>> wrote:____
>
>     dijit/registry or dojo/dom should be able to do this:____
>
>     __ __
>
>     require(["dijit/registry"], function(registry) {____
>
>       registry.byId("_OK").setDisabled(false);____
>
>       // or use dom.byId instead____
>
>     });____
>
>     __ __
>
>     Hope this helps.____
>
>     Harry____
>
>     __ __
>
>     ------------------------------------------------------------------------
>
>     *From: *"Bradley Koren" <[hidden email] <mailto:[hidden email]>>
>     *To: *"[hidden email]
>     <mailto:[hidden email]>"
>     <[hidden email]
>     <mailto:[hidden email]>>
>     *Sent: *Wednesday, March 4, 2015 1:15:30 PM
>     *Subject: *[Dojo-interest] Accessing dojo button outside script____
>
>     __ __
>
>     __ __
>
>     Hello,____
>
>      ____
>
>     I have a script that contains a dojo button widget. The button is
>     created in the script as follows. ____
>
>      ____
>
>     Then outside the dojo script, in another script I need to enable
>     this button. Can the button be accessed in the other script? ____
>
>      ____
>
>      ____
>
>     SCRIPT:        varbtnSave = newButton({____
>
>                    id: "_OK",____
>
>                    name: "OK",____
>
>                    label: "Submit",____
>
>                    disabled: 'disabled',____
>
>                    onClick: function() {____
>
>                        save();____
>
>                    },____
>
>                    required: false,____
>
>                    autoComplete: true,____
>
>                }, "_OK").startup();____
>
>      ____
>
>      ____
>
>     HTML:     <buttonid='_OK'>Submit</button>&nbsp;____
>
>      ____
>
>     Thanks for any help!____
>
>
>
>     This County of Chester e-mail message, including any attachments, is
>     intended for the sole use of the individual(s) and entity(ies) to
>     whom it is addressed, and may contain information that is
>     privileged, confidential and exempt from disclosure under applicable
>     law. If you are not the intended addressee, nor authorized to
>     receive for the intended addressee, you are hereby notified that you
>     may not use, copy, disclose or distribute to anyone this e-mail
>     message including any attachments, or any information contained in
>     this e-mail message including any attachments. If you have received
>     this e-mail message in error, please immediately notify the sender
>     by reply e-mail and delete the message. Thank you very much.____
>
>     --
>     Dojo Toolkit: http://dojotoolkit.org/
>     Tutorials: http://dojotoolkit.org/documentation/____
>
>     __ __
>
>     [hidden email]
>     <mailto:[hidden email]>
>     To unsubscribe, visit:
>     http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest____
>
>     __ __
>
>
>     --
>     Dojo Toolkit: http://dojotoolkit.org/
>     Tutorials: http://dojotoolkit.org/documentation/
>
>     [hidden email]
>     <mailto:[hidden email]>
>     To unsubscribe, visit:
>     http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest____
>
>     __ __
>
>
>     --
>     Dojo Toolkit: http://dojotoolkit.org/
>     Tutorials: http://dojotoolkit.org/documentation/
>
>     [hidden email]
>     <mailto:[hidden email]>
>     To unsubscribe, visit:
>     http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
>
>

--
Dylan Schiemann
SitePen, Inc.
Dojo workshops in the US, Canada, and Europe:
http://www.sitepen.com/workshops/
SitePen Insider: http://sitepen.com/insider/
http://www.sitepen.com/

--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Co-Founder, Dojo Toolkit
CEO, SitePen, Inc.  http://www.sitepen.com/
Reply | Threaded
Open this post in threaded view
|

Re: Accessing dojo button outside script

Koren, Bradley
In reply to this post by Karl Tiedt

OK. Maybe there is another way to approach my problem.

 

I am instantiating a google recaptcha widget in my HTML. It generates events that are captured in the non-dojo script. This works fine.

 

But then when I move the event handlers to the dojo script they never execute.

 

Is it possible to handle events from non dojo widgets inside my dojo script?

 

Thanks.

 

 

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Karl Tiedt
Sent: Wednesday, March 04, 2015 1:29 PM
To: [hidden email]
Subject: Re: [Dojo-interest] Accessing dojo button outside script

 

W/o using any dijit API's you would need to expose your button somehow to this other script.... You could access the raw domNode button that Dijit creates but you wont be able to modify the actual Widget instance of the button...


-Karl Tiedt

 

On Wed, Mar 4, 2015 at 10:26 AM, Koren, Bradley <[hidden email]> wrote:

Yes, but my issue is that I want to access the id from javascript that is not dojo enabled.

 

Can a javascript method that is not part of dojo access the id?

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Karl Tiedt
Sent: Wednesday, March 04, 2015 1:24 PM
To: [hidden email]
Subject: Re: [Dojo-interest] Accessing dojo button outside script

 

For the record, dom.byId is *NEVER* the answer to anything widget related. Always use register.by* methods to access widgets you do not have saved references for.


-Karl Tiedt

 

On Wed, Mar 4, 2015 at 10:21 AM, Harry Devine <[hidden email]> wrote:

dijit/registry or dojo/dom should be able to do this:

 

require(["dijit/registry"], function(registry) {

  registry.byId("_OK").setDisabled(false);

  // or use dom.byId instead

});

 

Hope this helps.

Harry

 


From: "Bradley Koren" <[hidden email]>
To: "[hidden email]" <[hidden email]>
Sent: Wednesday, March 4, 2015 1:15:30 PM
Subject: [Dojo-interest] Accessing dojo button outside script

 

 

Hello,

 

I have a script that contains a dojo button widget. The button is created in the script as follows. 

 

Then outside the dojo script, in another script I need to enable this button. Can the button be accessed in the other script? 

 

 

SCRIPT:        var btnSave = new Button({

               id: "_OK",

               name: "OK",

               label: "Submit",

               disabled: 'disabled',

               onClick: function () {

                   save();

               },

               required: false,

               autoComplete: true,

           }, "_OK").startup();

 

 

HTML:     <button id='_OK'>Submit</button>&nbsp;

 

Thanks for any help!



This County of Chester e-mail message, including any attachments, is intended for the sole use of the individual(s) and entity(ies) to whom it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended addressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use, copy, disclose or distribute to anyone this e-mail message including any attachments, or any information contained in this e-mail message including any attachments. If you have received this e-mail message in error, please immediately notify the sender by reply e-mail and delete the message. Thank you very much.

--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

 

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest

 


--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest

 


--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest

 


--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest