TextField ReadOnly

  1. #1

    TextField ReadOnly

    Hi there ...

    I have a TextField, with the property ReadOnly set to true.

    If I click on a button, and set the ReadOnly property to false, the TextField remains as ReadOnly (true).

    
    
    
    <ext:TextField ID="TxtClave" runat="server" Width="180px" ReadOnly="true" />
    
    
    <ext:Button ID="ChangeReadOnly" runat="server" Text="Change Read Only ">
    
    
        <Listeners>
    
    
            <Click Handler="#{TxtClave}.readOnly = false;" />
    
    
        </Listeners>
    
    
    </ext:Button>
    Is there a way to quit the ReadOnly property on client-side ?

    (Note: I'm using the v0.8 of the toolkit.)

    Thanks in advance.
    Alfonso Penunuri.
  2. #2

    RE: TextField ReadOnly

    Ok ...

    Googling I can figure out how to solve this issue.

    Just set the property readOnly = "", using the &#100;ocument.getElementById tag.

    To set a TextField as a ReadOnly:
    &#100;ocument.getElementById('TxtClave').readOnly='readonly';
    To quit the ReadOnly attribute to a TextField:
    &#100;ocument.getElementById('TxtClave').readOnly='';
    But I don't know why using the readOnly(), setReadOnly() and the other methods of Ext the TextField doesn't change it's ReadOnly property.

    If someone knows, please let me know.

    Cheers !
  3. #3

    RE: TextField ReadOnly

    Hi Penunuri,

    I tested the .setReadOnly function with v0.8.1 and it appears to work as expected. You should be able to change your <Click> Listener to the following.


    Example


    <Click Handler="#{TxtClave}.setReadOnly(false);" />

    Hope this helps.


    Geoffrey McGill
    Founder
  4. #4

    RE: TextField ReadOnly

    Hi Geoffrey !

    You're right ...

    And all my apologies.

    It's weird ... but maybe I don't test very well the functions.

    I will check twice now before put any post in the future.

    Thanks anyway for your help and support.

    Regards.
    Alfonso.

Similar Threads

  1. [CLOSED] TextField Readonly problem
    By speedstepmem4 in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Jun 01, 2009, 12:48 PM
  2. [CLOSED] Textfield Readonly Property
    By speedstepmem2 in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Mar 24, 2009, 11:52 AM
  3. Replies: 2
    Last Post: Feb 01, 2009, 10:40 PM
  4. Replies: 2
    Last Post: Dec 24, 2008, 6:17 AM
  5. Replies: 1
    Last Post: Nov 21, 2008, 7:10 AM

Posting Permissions