Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8867663
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T17:06:02+00:00 2026-06-14T17:06:02+00:00

I am working with Alloy UI auto-complete plugin that comes with Liferay. My auto

  • 0

I am working with Alloy UI auto-complete plugin that comes with Liferay. My auto complete part is working completely fine.

Now, what I want to do is that I want to capture the data which is selected from the auto complete auto suggest, and do the operation.

Let say, if I write ry in auto complete and then list comes up like this :

ryan
rynda
ryab

Now, if I click on any item or select via keyboard arrow key and press enter, it gets copied to autocomplete source input box. But I want is that I want to return back and do nothing when user selects a particular one item lets say ryab.

I found the event

autocomplete.on('itemSelect',function(event) {
};

which is fired when I select any item, but I don’t know how to get the object which is selected and how to return false/do nothing by comparing the object.

Any help would be appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T17:06:03+00:00Added an answer on June 14, 2026 at 5:06 pm

    The following code should do the trick:

    var expandit = false;
    
    autocomplete.on('itemSelect', function(event) {
        var currentValue = autocomplete.inputNode.get('value');
        //do comparison logic with currentValue here, and eventually set input node value to empty string
        if (currentValue == 'foo') {
            expandit = true;
            autocomplete.inputNode.set('value', '');
            // stop event propagation
            event.stopImmediatePropagation();
            return false;
        }
    });
    
    autocomplete.on('containerCollapse', function(event) {
        //reopen the menu in case of "do nothing" selection
        if (expandit) {
            autocomplete._sendQuery(autocomplete.inputNode.get('value') + '*');
            expandit = false;
        }
    });
    

    Alloy UI Reference API and Source Code for the Autocomplete widget have been useful.


    To programmatically show the menu you can use:

    autocomplete._sendQuery(autocomplete.inputNode.get('value') + '*');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been trying to add auto complete functionality to a text box. I want
I'm working with a client to build a newsstand app that uses auto-renewing subscriptions.
I am working on a project that requires to autocomplete textbox when some data
I am working on eclipse plugin that will allow a java bean to be
I'm working on implementing a way to allow HTML in a field that I
I am working on a method that will allow me to pull in the
I'm working on a WordPress that will allow the site administrator to switch between
I'm working in PHP to allow users to delete content and I want delete
Hi im working on a trigger that will not allow inserts/updates when the newly
I am working on a 2 part form to allow users to create posts

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.