title: How to use UI object inside an included view in Titanium Alloy
body: <p>I have four files that look similar to these:</p>
  
  <p><em>index.xml</em></p>
  
  <pre><code>&lt;Alloy&gt;
      &lt;Window&gt;
          &lt;View class="container"&gt;
              &lt;View id="report"&gt;
  
                  &lt;!-- Adds a textfield for name entry --&gt;
                  &lt;Require type="view" src="textfield" id="name"/&gt;
  
                  &lt;Button id="checkNameValue" title="Check Value"  width="100" height="40" onClick="checkname"/&gt;
              &lt;/View&gt;
          &lt;/View&gt;
      &lt;/Window&gt;
  &lt;/Alloy&gt;
  </code></pre>
  
  <p><em>index.js</em></p>
  
  <pre><code>function checkname(e) {
      alert("Your name is " + $.name.getView('nameTextField').value);
  }
  </code></pre>
  
  <p><em>textfield.xml</em></p>
  
  <pre><code>&lt;Alloy&gt;
      &lt;View id="nameView"&gt;
      &lt;/View&gt;
  &lt;/Alloy&gt;
  </code></pre>
  
  <p><em>textfield.js</em></p>
  
  <pre><code>var nameTextField = Titanium.UI.createTextField({
      hintText:"Type your name",
      height:40,
      width:300,
      top:20,
      borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED
  });
  
  $.nameView.add(nameTextField);
  </code></pre>
  
  <p>When I try clicking the Button to read the name value, I get an error:</p>
  
  <pre><code>message = "'undefined' is not an object (evaluating $.name.getView(\"nameTextField\").value')";
  </code></pre>
  
  <p>What is going wrong and how can I fix this?</p>