Aug 04, 2009, 11:33 AM
ext:window field loosing focus
Hello,
I have an ext:Window that has an ext:Textfield in it. When the window opens, the focus goes in the textfield one time then leaves the field. This is frustrating because I want the focus on the field so that the user can start typing as soon as the window opens.
Here's the window code:
I have an ext:Window that has an ext:Textfield in it. When the window opens, the focus goes in the textfield one time then leaves the field. This is frustrating because I want the focus on the field so that the user can start typing as soon as the window opens.
Here's the window code:
<ext:Button ID="ShowStudentGridWindowButton" runat="server" Text="Student Name:">
<Listeners>
<Click Handler="#{winFindStudent}.show();" />
</Listeners>
</ext:Button>
<ext:Window ID="winFindStudent" runat="server"
Collapsible="true"
Icon="Application"
Title="Student Search"
AutoHeight="true"
Width="700"
Modal="true"
Showonload="false"
BodyStyle="padding: 6px;">
<Body>
<table border="0">
<tr>
<td>Enter a name or student ID:</td>
<td>
<ext:TextField ID="SearchStringField" runat="server" EnableKeyEvents="true" FocusClass="highlight">
<AjaxEvents>
<KeyPress Before="var e = params[1]; var isEnter = e.getKey() == e.ENTER; if(isEnter){e.preventDefault();} return isEnter;" OnEvent="SearchString">
<EventMask ShowMask="true" Target="CustomTarget" CustomTarget="#{gpFindStudent}" />
</KeyPress>
</AjaxEvents>
</ext:TextField>
</td>
</tr>
<tr>
<td>I left out the data</td>
</tr>
</table>
</Body>
<Listeners>
<Show Handler="#{SearchStringField}.focus();" />
</Listeners>
</ext:Window>