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 8121825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T05:37:35+00:00 2026-06-06T05:37:35+00:00

I’m new to blackberry development. There is this question I’ve come across several times,

  • 0

I’m new to blackberry development. There is this question I’ve come across several times, which is “How to get the Selected item as string”. The answers that were given did not fully answer the question:

AutoCompleteField autoCompleteField = new AutoCompleteField(filterList)
{
 public void onSelect(Object selection, int SELECT_TRACKWHEEL_CLICK) {
     ListField _list = getListField();
     if (_list.getSelectedIndex() > -1) {
         Dialog.alert("You selected: "+_list.getSelectedIndex());
         // get text selected by user and do something...
     }
 }

The point is how can I get the selected text and “do something”. Imagine I want to send the items as a string to a server via post. How would I do that in code?

Thank you! Michael.

  • 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-06T05:37:37+00:00Added an answer on June 6, 2026 at 5:37 am

    These are really (at least) two different things.

    To get the selected text, see this answer

    To send a HTTP POST request, see this other answer

    Normally, it’s also bad to make network requests on the UI thread (which is what will callback your onSelect() method). So, it would be better to take the HTTP POST code from the second answer, and put it inside the run() method of a Runnable object you could run on a background thread. Something like this:

    private class PostRequest implements Runnable {
    
      private String _postParam;
    
      public PostRequest(String param) {
        _postParam = param;
      }
    
      public void run() {
        // make POST request here, using _postParam
      }
    }
    

    And use it like this:

      AutoCompleteField acf = new AutoCompleteField(list) {
         protected void onSelect(Object selection, int type) {
            super.onSelect(selection, type);
            if (selection != null) {
              String selectionAsString = getEditField().getText();
              Thread worker = new Thread(new PostRequest(selectionAsString));
              worker.start();
            }
         }
      };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
This could be a duplicate question, but I have no idea what search terms
I know there's a lot of other questions out there that deal with this
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small

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.