1. *** New version of B4J is available ***
    B4J v7.8
    Dismiss Notice

B4A Library [Class] SearchView - More powerful alternative to AutoCompleteEditText

Discussion in 'Additional libraries, classes and official updates' started by Erel, Jul 8, 2012.

Thread Status:
Not open for further replies.
  1. shashkiranr

    shashkiranr Active Member Licensed User

    Hi Erel,

    im using this search view with Ultimate List View. The problem i am facing is when i set the index for the list, the ULV is not loading properly since the time taken to set the index is more. i tried to create a service and do the indexing in the background not able to pass the output back to the calling Class Module.

    Kindly let me know how i can use the Indexing of the searchview in a service.

    Regards,
    SK
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Moving the code to a service will not help. Services code run in the same thread as any other code.

    If the data is static then you can store the index in a file and then load it instead of building it.
     
  3. shashkiranr

    shashkiranr Active Member Licensed User

    yes i can try that. Thank you for your suggestion Erel. I will try it and let you know. :)
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    You can use RandomAccessFile.WriteObject to serialize it.
     
  5. anallie0

    anallie0 Active Member Licensed User

    hi Erel
    I'm using your example but I have a problem.
    If I insert it in a black panel, there are no display problems.
    But if I insert it in a white panel, the imputbox is not visible.
    how can I make it black ?
     
  6. Mahares

    Mahares Well Known Member Licensed User

    In the below sub in the class module add the items I listed. You can change the colors to your liking:
    Code:
    Public Sub Initialize (Callback As Object, EventName As String)
        et.Initialize(
    "et")

        et.Color=
    Colors.White 'add this
        et.TextColor=Colors.black   'add this
        et.TextSize=24  'add this
     
    Last edited: Feb 2, 2014
  7. anallie0

    anallie0 Active Member Licensed User

    Thank you Mahares ;)
     
  8. katrad

    katrad Member Licensed User

    I love this searchview, my only want is that when someone searches something that the list still stays there. I'm using the searchview to show places on a map and would like to retain that result, I have also implemented the "show all" function, so I dont know what to change to make that happen.

    Thank you very much in advance!!!
     
  9. Erel

    Erel Administrator Staff Member Licensed User

    Do you mean that you want to keep the list open?

    Go to SearchView class code. Select lv (the ListView) and press F7. You will immediately see all the references:

    [​IMG]

    Now you can see where its visible property is changed.
     
    JOTHA likes this.
  10. katrad

    katrad Member Licensed User

    No, what I mean is when a user searches and there is more defined detail in the list that even after they select something (from that list) that it isnt redrawn and the original (search) list is intact. So, they can select others from that (prev searched) list.
     
  11. katrad

    katrad Member Licensed User

    PS. I didnt know you could do that, cool! (about F7)
     
  12. Erel

    Erel Administrator Staff Member Licensed User

    Do you want to resort the list and move the matched items to the top?
     
  13. katrad

    katrad Member Licensed User

    Let me try to make this simple, if I could retrive the original search (text), I think I could make it just go to that. I just cant find how to get the original search text out of the the search view. I always get what I'm searching for (selected) not the texted searched. It's because its in the other class. (I think)
     
    Last edited: Mar 2, 2014
  14. Erel

    Erel Administrator Staff Member Licensed User

    This is indeed simple. Make 'et' variable a public variable and then get the query with et.Text.
     
  15. katrad

    katrad Member Licensed User

    Thank you very much!
     
  16. LucaMs

    LucaMs Expert Licensed User

    I had the impression of seeing a "SearchView db" or something like that, yesterday when I did a search on the site.

    Am I wrong?

    Using a db there would be no limit to the index characters.
     
  17. Erel

    Erel Administrator Staff Member Licensed User

    I don't remember seeing a database implementation.
     
  18. shashkiranr

    shashkiranr Active Member Licensed User

  19. Erel

    Erel Administrator Staff Member Licensed User

    No. You cannot intercept the text changed event of the search dialog. Without it SearchView it not useful.
     
  20. sulsys

    sulsys Member Licensed User

    Hello,

    How would I add the search view to a tab in a Tabhost?

    Thank you
     
Thread Status:
Not open for further replies.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice