Jul 12, 2010, 10:26 AM
[CLOSED] Focus TextField if Window Hide=true
Hello,
I am using a TextField in a Window which is not initially loaded (Hidden=true):
I cannot use the
What do I have to do to solve this?
I am sure that I have already read about this problem here in the board but cannot find it anymore.
Regards,
Martin
I am using a TextField in a Window which is not initially loaded (Hidden=true):
<ext:Window ID="Window1" runat="server" Icon="Pencil" Hidden="true" Title="Aufenthaltsort"
Height="200px" Width="400px" Closable="False">
<Content>
<ext:TextField ID="textLocation" runat="server" AllowBlank="False" Width="300px"
Style="font-size: large" EnableKeyEvents="true">
<Listeners>
<KeyPress Handler="if ((e.getKey() == e.ENTER)) {
#{DirectMethods}.btnSave_Click();
}" />
</Listeners>
</ext:TextField>
</Content>
<Buttons>
<ext:Button ID="btnCancel" runat="server" Icon="Cancel" Style="text-align: right"
Text="Abbrechen">
<Listeners>
<Click Handler="#{DirectMethods}.btnCancel_Click();" />
</Listeners>
</ext:Button>
<ext:Button ID="btnSave" runat="server" Icon="Disk" Text="Speichern">
<Listeners>
<Click Handler="#{DirectMethods}.btnSave_Click();" />
</Listeners>
</ext:Button>
</Buttons>
<Listeners>
<AfterLayout Handler="#{textLocation}.focus();" />
</Listeners>
</ext:Window>
I cannot use the
<AfterLayout Handler="#{textLocation}.focus();" />
because the textLocation TextField is not initially rendered (Firebug-Message: textLocation is not defined) if I set the window to hidden=true.What do I have to do to solve this?
I am sure that I have already read about this problem here in the board but cannot find it anymore.
Regards,
Martin
Last edited by geoffrey.mcgill; Jul 15, 2010 at 12:42 AM.