[CLOSED] Can not change EmptyText

  1. #1

    [CLOSED] Can not change EmptyText

    When you set EmptyText, it injects the old EmptyText as the text value of the textfield. It's very subtle but after you press Change Empty Text, put your cursor in the textbox.

    The only workaround is to set the Empty Text and if the textfield was empty in hte first place, clear it.

    <!DOCTYPE html>
    <head id="Head1" runat="server">
        <style type="text/css">
        <form id="Form1" runat="server">
        <ext:ResourceManager ID="ResourceManager1" runat="server" ScriptMode="Debug" Theme="Gray"
            DisableViewState="true" />
        <ext:TextField runat="server" ID="txtField" EmptyText="Initial Empty Text" Width="300">
        <ext:Button runat="server" Text="Change Empty Text">
                <Click Handler="#{txtField}.emptyText = 'New Empty Text';">
    Last edited by Daniil; Jan 31, 2013 at 3:43 AM. Reason: [CLOSED]
  2. #2

    Sorry, I don't quite understand you. What's your problem?

    If the problem is that you have to focus and blur textfield to show new EmptyText? You can try to call applyEmptyText

    <Click Handler="#{txtField}.emptyText = 'New Empty Text'; #{txtField}.applyEmptyText(); ">
  3. #3
    The empty text is not changed when you call textField.emptyText = "Some Text".
  4. #4
    As far as I can know there is no any mechanism in JavaScript to get something updated just after updating a JavaScript object's property.

    I mean that there is no "setter" where it would be possible to run some additional JavaScript code to update the required things.

    So, calling the applyEmptyText method should be a solution.

Similar Threads

  1. [CLOSED] Keep EmptyText on Focus
    By SouthDeveloper in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Dec 12, 2012, 10:24 AM
  2. [CLOSED] EmptyText GridPanel
    By osef in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Sep 04, 2012, 6:45 PM
  3. [CLOSED] Change the syle of EmptyText
    By RCN in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Jun 04, 2012, 7:25 PM
  4. [1.0] Field EmptyText
    By Timothy in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Mar 11, 2010, 3:47 PM
  5. TextField.EmptyText and Radio's
    By dlouwers in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Jan 13, 2009, 12:26 PM

Posting Permissions