views:

11

answers:

1

I have a dijit validationtextbox widget:

<input dojoAttachPoint="tbIPAddress" type="text" size="15" class="ipaddress"
                    dojoType="dijit.form.ValidationTextBox"
                    required="true"
                    regExp="^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$"
                    promptMessage="Enter IP Address."
                    invalidMessage="A valid IP Address is required." />

If I give it an id and then access it with dijit.byId then I can call isValid on it. However, if it's in a dijit templated widget and is using dojoAttachPoint, then when I access it in the associated js class using this.tbIPAddress, calling isValid gives the following error:

this.tbIPAddress.isValid is not a function

I would assume that doing this. would be smart enough to know whether to do a dijit.byId or dojo.byId behind the scenes and would make available all the pertinent functions. What am I missing?

+1  A: 

I figured it out, I was missing in my dijit templated widget class:

widgetsInTemplate: true,

Justin