SPONSORS:






User Tag List

Results 1 to 6 of 6
  1. #1
    Senior Member
    Join Date
    Dec 2001
    Location
    Bozeman, MT, USA
    Posts
    265
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    JavaJFCListBox cant see contents

    I tried selecting an item in a JavaJFCListBox using the .Select( "<item>" ) method and it says that is cant find <item>.

    I do a print( wMainWin.JavaListBox.GetContents() ) and it prints {} even though the listbox contains 9 items. If I select an index value of 5 it selects the correct item but that is too strict. I need something a little more flexible and dynamic. Any ideas?

    ------------------
    Ryan McCullough
    Accelrys Inc.
    ryan@accelrys.com
    Ryan McCullough
    RightNow Tech. Inc.

  2. #2
    Senior Member
    Join Date
    Nov 2001
    Location
    UK, Oxford
    Posts
    150
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: JavaJFCListBox cant see contents

    If your list actually contains String objects (in the java code) then everything should be working OK.
    However, if the list contains other objects (in java code )then ST will identify them by using the toString method of the class. We had to write a whole bunch of toString methods which returned the display name of the object.
    Even so, a ListPrint on list.GetContents(), should return a list containing a whole bunch of object information at least, which is what the default toString method of any java class will return...?
    Anyway, you could try this:
    Find out what class of object is in the list (in the java code).
    Write a toString method for that class, which returns whatever is actually displayed in the list. Now your developers might be using the toString method for their own purposes (debugging etc) so you might have to set up some sort of conditional mechanism.
    Recompile the java code.
    Then try and select by name again.
    Hope any of this helps

    ------------------




    [This message has been edited by johntest (edited 12-04-2002).]
    Tempus fugit, Carpe Diem, et al

  3. #3
    Junior Member
    Join Date
    Oct 2002
    Location
    Kirkland, WA, USA
    Posts
    7
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: JavaJFCListBox cant see contents

    I encountered this same problem, and found that in my case, I can select an item from the JavaJFCListBox by index. Once I have an item from the listbox selected, I can get the text from it using GetSelText(). I created a function to loop through selecting each item and check it against my desired selection string specified as input parameters to the function. Once it finds the match, it confirms the selection. Not a pretty workaround, but it works in my case.

    Aaron

    ------------------

  4. #4
    Senior Member
    Join Date
    Feb 2000
    Posts
    1,497
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: JavaJFCListBox cant see contents

    Hi Ryan,

    Working with Silk 6.0 are we?

    Change the GetContents() to GetContents(TRUE) and see what happens.

    As for select() not working properly, I'll have to check some code on Tuesday and report back.



    John


    ------------------

  5. #5
    Junior Member
    Join Date
    Mar 2003
    Posts
    19
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: JavaJFCListBox cant see contents

    >I need something a little more flexible
    >and dynamic. Any ideas?

    Hmmm... Try another tool? We have been checking out the new TestSmith beta from qualityforge.com for our Java applications. So far no problems. (And it really does work "out of the box"!)


    ------------------

  6. #6
    Senior Member
    Join Date
    Jul 1999
    Location
    Bellingham, WA USA
    Posts
    1,323
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: JavaJFCListBox cant see contents

    Ryan,

    IF (that's the qualifier) if nothing mentioned above works for you, can you select each by index and then get text on that item?

    ------------------

 

 

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 06:03 PM.

Copyright BetaSoft Inc.