SPONSORS:






User Tag List

Results 1 to 7 of 7
  1. #1
    Senior Member
    Join Date
    Jul 1999
    Location
    Columbus, OH, USA
    Posts
    689
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    New method to class?

    Has anyone ever had any problems adding new methods to a class? I'm trying to add a SelectAll method to the TextField class. The code is below:

    The SelectAll() function shows up in the library browser, but when the testcase hits the wTextField.SelectAll() line, I get the error:
    **Function SelectAll() is not defined for WindowName.TextField("#1")

    Any ideas? Thanks!

    -Damian Synadinos
    damsyn@symix.com


    [This message has been edited by AJ (edited 11-17-1999).]

  2. #2
    Member
    Join Date
    Sep 1999
    Location
    Austin, Texas
    Posts
    64
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: New method to class?

    Is your textfield an instance of TextField itself or of a subclass of TextField? With 4test, unfortunately, it makes a difference. Extended methods are not inherited.
    Bret Pettichord
    Book - www.testinglessons.com
    Hotlist - www.testinghotlist.com
    Consulting - www.pettichord.com

  3. #3
    Guest

    Re: New method to class?

    Did you put the declaration for the SelectAll() method in the winclass.inc file? If not try putting the declaration in the TextField declaration within the winclass.inc file.

  4. #4
    Senior Member
    Join Date
    Jul 1999
    Location
    Columbus, OH, USA
    Posts
    689
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: New method to class?

    Update -

    The same code (see above) works when pasted into a frame file created for Winodws Notepad.exe!

  5. #5
    Junior Member
    Join Date
    Aug 1999
    Location
    mt view, Ca
    Posts
    8
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: New method to class?

    Damian,
    Your code looks good for selecting the text. There is an example in the 5.0.1 manual using Ctrl-Home and Ctrl-Shift-End for the keystrokes. You might try changing the inheritance to the AnyWin class, which will make your method available to all text fields. Also assign a unique name for the class other than TextField. It is confusing to see textfield : textfield - don't you agree? Give your class a name like MyTextField : AnyWin and see how it works.

    Len Jagelski
    Lotus cc:Mail
    Len Jagelski
    Automation Engineer
    Lotus, cc:Mail

  6. #6
    Junior Member
    Join Date
    Aug 1999
    Location
    Boston, MA
    Posts
    16
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: New method to class?

    I've had trouble with extending builtin classes via the
    mechanism. Specifically (as Bret pointed out), subclasses didn't inherit the added methods. Things work better for me in 5.0.

    The following code worked for me:
    If you are running into the subclass issue, there is a simple workaround ... type casting ...

    [This message has been edited by jmcgrail (edited 11-22-1999).]
    John McGrail

  7. #7
    Junior Member
    Join Date
    Aug 1999
    Location
    Boston, MA
    Posts
    16
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: New method to class?

    Ack!! My indenting got trashed ... Visit http://www.employees.org/~skaterat/s...t/derived.html

    for more info
    John McGrail

 

 

Posting Permissions

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

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 11:02 PM.

Copyright BetaSoft Inc.