[Dojo-interest] I am dumbfounded. Why wouldn't dojo.widget.byId() return my object

eric.liu eric.liu at nexolink.com
Mon Feb 19 11:23:20 MST 2007


Hi,

 

I have been trying really hard to figure out what could be causing my code
to behave funny. What I have here is a combo box with a valuechange event,
the intention is to call setExchange function when value changes on the
combo box. The problem I can't seem to understand is why
dojo.widget.byId("select1") is not returning handle to the combo box. What
am I missing? It's a great tookit btw. =)  I want to know what I can do to
get it working.

 

<script type="text/javascript" src="lib/dojo/dojo.js"></script>

           <script type="text/javascript">

                                dojo.require("dojo.widget.*");

                                dojo.require("dojo.dojo.js");

                                dojo.require("dojo.widget.Select");

                                dojo.require("dojo.widget.Button.js");

 
dojo.require("dojo.widget.AccordionContainer");

                                dojo.require("dojo.widget.ContentPane");


                                dojo.require("dojo.widget.LayoutContainer");

                                dojo.require("dojo.widget.HtmlWidget");

                                dojo.require("dojo.widget.FilteringTable");

                                dojo.require("dojo.widget.ComboBox");

                                dojo.require("dojo.widget.validate");

                                dojo.require("dojo.widget.Editor");

                                dojo.require("dojo.widget.CurrencyTextbox");

                      

                                          

                     function setExchange(name) {

                                if(name == "select1") {

                                          var combo =
dojo.widget.byId("select1");

                                           // do something to the object


}                    

                     }

</script>

 

<select dojoType="combobox" name="select1"  style="width: 100px;"
autocomplete="false" onValueChanged="setExchange('select1');">

           <option value="USD"> USD </option>

<option value="EUR"> EUR </option>

           <option value="GBP"> GBP </option>

<option value="CAD"> CAD </option>

           <option value="AUD"> AUD </option>

</select>

 

           

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://dojotoolkit.org/pipermail/dojo-interest/attachments/20070219/db882f17/attachment.html


More information about the Dojo-interest mailing list