Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: AutocompleteBox, possibile to select items via JS?

  1. #1
    Join Date
    Apr 2010
    Posts
    127

    Default AutocompleteBox, possibile to select items via JS?

    Hello,
    is it possibile to select one or more items for an autocompletebox component using javascript?

    Why, you might ask?
    Well, I store user's selections in cookies, and load them the next time he opens that page (so it is already configured like last time).
    I'm able to do this with selects, text boxes, etc.; I can store & load values for autocomplete boxes too, but they won't be shown (the user won't know which values, if any, are selected); I can even do some javascript innerHTML trick to print the selected values under the search box, just like they were just chosen from the component, but then removing or searching items won't work anymore.

    Even a workaround would be ok, of course something like component.select("blahblah") would be better

    Also, I'd like to know if there's a workaround to have case-insensitive search.

  2. #2
    Join Date
    Jul 2007
    Posts
    2,497

    Default

    The answer is yes - cause I know we've done some similar thing. But that component is a nightmare, you need to look into the code. Unfortunately, there's no better autocomplete component available that allows multiple selection, so that's what we have to use.


    For the case insensitive search.... convert everything to lowecase
    Pedro Alves
    Meet us on ##pentaho, a FreeNode irc channel

  3. #3
    Join Date
    Apr 2010
    Posts
    127

    Default

    Quote Originally Posted by pmalves View Post
    The answer is yes - cause I know we've done some similar thing. But that component is a nightmare, you need to look into the code. Unfortunately, there's no better autocomplete component available that allows multiple selection, so that's what we have to use.
    Ouch, where do I start from?

    For the case insensitive search.... convert everything to lowecase
    Tried that, but I can't really change values since I have to pass them around.
    I even tried a query like
    SELECT value + '<span style="display:none">' + lower(value) + "</span>" etc.
    but guess what, it screws up HTML tags (also, if I searched e.g. "non" or "spa" or "sty", all records would be returned).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.