Results 1 to 3 of 3

Thread: How to getValue and setValue when using xtype textareafield

  1. #1
    Sencha User
    Join Date
    May 2017
    Posts
    9

    Default How to getValue and setValue when using xtype textareafield

    I'm writing a Sencha test run with Webdriver mode.
    I have a textareafield component, I can type text into it with below code:
    Code:
    ST.component('textareafield[reference="text"]').focus().type('test123456');  // this works
    But now I want to validate the input text and clear the input with below code
    Code:
    ST.component('textareafield[reference="text"]').textLike('test123456');  // not work
    ST.component('textareafield[reference="text"]').setValue('');   // not work
    How should getValue and setValue when using textareafield ?

  2. #2
    Sencha - Sales Team daniel.gallo's Avatar
    Join Date
    Apr 2009
    Location
    Redwood City, CA
    Posts
    340
    Answers
    55

    Default

    The example below works against a Text Area field in Ext JS:

    Code:
    // Set the value of the text field
    ST.textField('[name=msg]')
        .setValue('Random value');
    
    
    // Check value was set, by using built-in "value" method
    ST.textField('[name=msg]')
        .value('Random value');
        
    // Or, use the Jasmine-like syntax to do the same thing
    ST.textField('[name=msg]')
        .expect('value')
        .toEqual('Random value');
    
    
    // Now clear the text field value
    ST.textField('[name=msg]')
        .setValue('');
    Daniel Gallo
    Senior Solutions Architect
    Sencha Inc.

  3. #3
    Sencha User
    Join Date
    May 2017
    Posts
    9

    Default

    It works, thanks a lot Dan

Similar Threads

  1. Datefield setValue\getValue functions
    By ralfius in forum Ext: Q&A
    Replies: 3
    Last Post: 20 Nov 2012, 5:43 AM
  2. beginner: getValue and setValue on CheckboxGroup
    By Maik (SL) in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 30 Mar 2010, 10:39 PM
  3. [3.0] getValue and setValue of Checkbox and RadioGroup
    By arnold in forum Ext 2.x: User Extensions and Plugins
    Replies: 3
    Last Post: 29 May 2009, 12:46 AM
  4. [2.2][CLOSED] RadioGroup.getValue/setValue
    By Thylia in forum Ext 2.x: Bugs
    Replies: 3
    Last Post: 5 Aug 2008, 9:08 PM
  5. el.getValue() but no el.setValue()
    By objectwire in forum Ext 1.x: Help & Discussion
    Replies: 3
    Last Post: 19 Apr 2007, 6:34 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •