List selection behaviour

Hi,
The JList moves to a item beginning with the key that I typed on it. Is there a way
to stop this behaviour and move the list to some other position that I need to.
Thanks a lot,
Chamal.

When the user types in your list, the method getNextMatch will be called. Override this method to customize the behvaior you want. For more details, check the JList API:
http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/JList.html
or the JList source code.

Similar Messages

  • How can I get a drop-down list selection also be selected in another field with the same list but a different name?

    I have a street address and a billing address. A question is posed with a checkbox — "Is the billing address the same as the street address?" If Yes is checked, the street address automatically fills the billing fields. If No is checked, the user must fill in new information. In both the street address and billing addres, the State field is a drop-down list. How can I get the drop-down list selection in the street address State also be selected in drop-down list for the billing address State?

    Has anyone done this?

  • UI - How to make Columns in a Drop Down List Selection?

    I am altering a code from Peter Kahrel "Beginning Script UI". I am trying to make a searchable drop down list that will have 4 columns. So far, the search works and I have headings in the search, but I cannot seem to make the columns for the actual data. I believe I need to change the type_ahead since the array is looking at this data. I'm stuck in the water. Can someone tell me what I need to do to get the list to show up as columns? How do I turn the picked = type_ahead data into four columns? Code and Screenshot below:
    picked = type_ahead (["bat", "bear", "beaver", "bee", "cat", "cats_and_dogs",
    "dog", "maggot", "moose", "moth", "mouse"]);
    function type_ahead (array)
    var w = new Window ("dialog", "Quick select");
    var entry = w.add ("edittext", [0, 0, 800, 22]);
    entry.active = true;
    var list = w.add ("listbox",  [0, 0,800, 500], "",
    {numberOfColumns: 4, showHeaders: true,
    columnTitles: ["Non-Approved Word", "Approved Alternative", "Approved Use", "Non-Approved Use"], columnWidths: [200,200,200,200]});
    list.selection = 0;
    entry.onChanging = function ()
    var temp = this.text;
    list.removeAll ();
    for (var i = 0; i < array.length; i++)
    if (array[i].toLowerCase().indexOf (temp) == 0)
    list.add ("item", array[i]);
    if (list.items.length > 0)
    list.selection = 0;
    entry.onChange = function () {w.close (1)}
    if (w.show () != 2)
    return list.selection.text;
    else
    w.close ();

    Hi Peter,
    This is one of those developments that push the limits of my knowledge-base and when things do that, I lose sleep until I figure it out. With that said :-) here is where I have ended up.
    Basically I made a new array for the table data.  I then use an array lookup to sort the array in the listbox based on the 0 array item. See the code below. Once it is loaded type in "b" and the list will start to sort.
    I need to try to get this to work as a pallete instead of a dialog box. Do palletes support this type of functionality?
    var newarray = new Array(
    new Array('Butterfly ','has wings','can fly'),
    new Array('bohemith moth','has wings','cannot fly very good'),
    new Array('word 3','replacement word','use case'));
    picked = type_ahead (newarray);
    function type_ahead (array)
    var w = new Window ("dialog", "STE Checker");
    var entry = w.add ("edittext", [0, 0, 800, 22]);
    entry.active = true;
    var list = w.add ("listbox",  [0, 0,800, 500], "",
    {numberOfColumns: 3, showHeaders: true,
    columnTitles: ["Column 1",  "Column 2", "Column 3" ], columnWidths: [200,200,400]});
    list.selection = 0;
    entry.onChanging = function ()
    var temp = this.text;
    list.removeAll ();
    for (var i = 0; i < array.length; i++)
    if (array[i][0].toLowerCase().indexOf (temp) == 0)
    with (list.add ("item", array[i][0]))
    subItems[0].text = array[i][1];
    subItems[1].text = array[i][2];
    if (list.items.length > 0)
    list.selection = 0;
    entry.onChange = function () {}
    if (w.show () != 2)
    return list.selection.text;
    else
    w.close ();

  • Query Report - To display additional column in list selection box.

    Hi,
    There is query report where i want to display the additional column in list selection.
    Below is the system query report, where parameter passed is card code.
    When the cardcode - list selection is clicked system displays 2 columns i.e. Customer Code & No. of Records.
    Now in the same list selection; is it possible to display the customer name along with cardcode only for reference.
    SELECT T0.DocDate, T1.SlpName, T2.Name, T0.DocDueDate, T0.DocNum,    (CASE WHEN T0.DocStatus = 'O' THEN 'Open' ELSE 'Closed' END) AS Status,    T0.DocTotal FROM OQUT T0 LEFT JOIN OSLP T1    ON T0.SlpCode = T1.SlpCode LEFT JOIN OCPR T2 ON T0.CntctCode = T2.CntctCode WHERE T0.CardCode = N'[%0]'    ORDER BY T0.DocNum DESC
    Kindly let me know the details.
    Thanks & Regards,
    Yogesh Jadav

    Hi Yogesh Jadav,
    The answer is NO.  You may only display either code or name but not both.
    Thanks,
    Gordon

  • List selection bean

    Does anyone know where I could grab a "list selection bean" of some sort...I'm thinking the kind of widget that shows two lists. The list on the left is all available options while the list on the right can have 0 to n entries. The user selects items from the left list and puts them in the right, or removes items from the right list putting them back in the left list by pushing buttons with right/left facing arrows (or whatever) located in the center of the dialog between the two lists. Buttons on the bottom include the typical "OK", "Cancel". I'm writing some displays that require this sort of dialog to gather info from a user and am hoping I don't have to re-write the bean as I imagine several people have already accomplished this!
    Thanks!
    Dove

    It is actually not too hard to write. Create a JPanel with a TableLayout or a BorderLayout. Insert a JScrollPane each with a JList on the left and right. Grab both JList model's so you can insert/remove directly to the model. Now, in the event handler of --> you do something like:
    Object o[] = leftList.getSelectedValues();
    for (int cntr = 0; cntr < o.length; cntr++)
    rightListModel.addElement(o[cntr]);
    leftListModel.removeElement(o[cntr]);
    This would get any selected items on the left, move them to the right and remove them from the left. You would probably have to add:
    rightList.updateUI();
    leftList.updateUI();
    just to be sure both repain themselves.
    I believe that is all I used. Works great. Then, when you are ready, you get the selectedValues() from the rightList object and you are set to do what you need. Moving one or many is the same code, and the reverse is done just as easily. Removing all from either side is just as easy as well.

  • Disable Spark List selection indicator

    How do I get rid of the Spark List selection indicator entirely?  I don't want the rectangular indicator when the mouse hovers over an item, and I don't want the color to change when the mouse is clicked.

    You'll have to extend default item renderer (ItemRenderer for instance) and set autoDrawBackground to false. And then use your item renderer in a list.
    See this document for more information on spark item renderers.

  • Tile List selection after pressing embedded Image button

    Hi;
    I am working on SAP Work Manager 6.0 customizing using Agentry 6.1.3. I have this tile list that contains items. At the bottom of this tile list, I have a button that targets the selected item on the tile list. This button has an action which changes the icon  of the selected item when pressed and also executes an edit transaction that prints/changes the selected item property values based on rules. After selecting a particular item from the tile list and clicking on this button, the selected item's image changes to the image that I want, but the selection highlighter toggles and always moves to the first item on the tile list. I have tried implementing a list selection but it somehow always ignores this and always toggles back to the first item on the tile list. I would like it to stay on the selected item, whose image has just been changed. How would I go about having the selection highlighter stay on the same item before and after pressing the button?
    Your help is greatly appreciated!
    Thanks in advance!
    Sizo Ndlovu

    Hi Jason;
    Thank you for the prompt response.I'm using the .NET client to test on the development machine and the application is deployed onto an Android 4.0.4 device. I have tried implementing this as shown below:
    The action steps:
    The Navigation step:
    The List Selection step:
    The List Selection rule:
    I have also tried implementing this using the navigation only or the list selection only, with no success.
    Thanks and Regards;
    Sizo Ndlovu

  • Alert is not working for mutiple times for list "select" function in sapui5 XML view

    Hello All,
    I am trying to open an alert for multiple times for list "select" function. But it's opening for only one time .
    Please find code below.
    View Part
    <List id="contactedit" select="somefunction">
        <CustomListItem id="custom1" type="Inactive" >
    <content>
    <Label text="this is label" />
    </content>
    </CustomListItem>
    </List>
    Controller Part
    somefunction: function(oEvent){
    alert("this is an alert");
    Thanks in Advance
    D.Mohanbabu

    I think I saw this question in stack overflow. And I answered it :-)
    I believe that it is because you can only one item in the list and once the item is selected, re-selecting it will not fire the event.
    Try adding more items to the list and select different items.
    Thanks
    -D

  • Master detail where master is a list select menu

    I'd like to create something similar to this example http://labs.adobe.com/technologies/spry/samples/data_region/SprySetRowSample.html but instead of a static menu on the left I'd like it to be a list select menu. Is this possible? Thanks.

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>Untitled Document</title>
    <script src="SpryAssets/xpath.js"></script>
    <script src="SpryAssets/SpryData.js"></script>
    <link href="SpryAssets/SpryMasterDetail.css" rel="stylesheet">
    <script>
    var ds1 = new Spry.Data.XMLDataSet("employees.xml", "employees/employee");
    function selectDetail(row) {
        ds1.setCurrentRow(row);
    </script>
    </head>
    <body>
    <div class="MasterDetail">
      <div spry:region="ds1" class="MasterContainer">
          <select onChange="selectDetail(this.value)">
            <option spry:repeat="ds1" value="{ds_RowID}">{lastname}</option>
            </select>
      </div>
      <div spry:detailregion="ds1" class="DetailContainer">
        <div class="DetailColumn">{firstname}</div>
        <div class="DetailColumn">{lastname}</div>
        <div class="DetailColumn">{phone}</div>
        <div class="DetailColumn">{username}</div>
      </div>
      <br style="clear:both" />
    </div>
    </body>
    </html>
    Gramps

  • Could not see object list selection in SE80

    'Hi,
       I have IDES connection through my company VPN.I could not see object list selection in se80 ,instead I see blank white box in that place.I could not even see F1 help,all I see is blank page.Could any of you help me to sort out this problem.This is system specific as other computers do not have this problem.
    Regds
    Surendranath

    Hi,
    You have to install the Latest SAP GUI patch in your deskstop/system. Then it will be displayed.
    Regards,
    Chaitanya

  • Unwanted Android selection behaviour... different in Flex versus pure ActionScript... Why?

    Hi,
    I'm trying to get to the bottom of the text selection behaviour on my Android Xoom under different circumstances:
    1. In a pure ActionScript mobile app, selection and copy / paste is controlled through a floating control that appears on screen without resizing or otherwise moving anything
    2. In a Flex mobile app, selection and copy / paste is controlled through a UI bar that appears at the top of the screen, pushing the entire app downwards, losing focus on my textfield, ballsing up every bit of control I have in addition to confusing the hell out of my user whose finger is no longer pointing at the piece of text they wanted to select but rather at something else that is about a half-inch above that point...
    So...
    Obviously, I want to get to 1. for Flex - eg: I want to allow selection and copy / paste without loss of focus, without repositioning and without confusing the hell out of my user.
    Does anybody have any clues how I can achieve this?
    Thanks,
    G

    Got it. The two selection behaviours depend on the underlying skin.
    This one works with Flex:
    skinClass
    : ClassReference("spark.skins.mobile.TextInputSkin"
    Where this one shifts the app down, places a bar above, and generally screws with any interactivity you may have wanted to do using your selected text...
    skinClass: ClassReference("spark.skins.mobile.StageTextAreaSkin"
    G

  • How can i clear the textfield and the list selections?

    How can i clear the textfield and the list selections?
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    <applet code="ListDemo" width=300 height=400>
    </applet>
    public class ListDemo extends Applet implements ActionListener {
    List os, browser;
    String msg = "";
    String text;
    String named = "";
    TextField name;
    Button Ok, reset;
    public void init() {
    Ok = new Button("Ok");
    reset = new Button("reset");
    add(reset);
    add(Ok);
    reset.addActionListener(this);
    Ok.addActionListener(this);
    Label namep = new Label("Name: ", Label.RIGHT);
    name = new TextField(12);
    add(namep);
    add(name);
    name.addActionListener(this);
    os = new List(4, false);
    browser = new List(4, false);
    os.add("default");
    os.add("BMW");
    os.add("BENZ");
    os.add("Lexus");
    os.add("Acura");
    browser.add("default");
    browser.add("Red");
    browser.add("Black");
    browser.add("Silver");
    browser.add("Blue");
    browser.add("Yellow");
    browser.add("Pink");
    browser.add("Grey");
    browser.add("Blue/Black");
    os.select(0);
    browser.select(0);
    add(os);
    add(browser);
    os.addActionListener(this);
    browser.addActionListener(this);
    public void actionPerformed(ActionEvent ae) {
    String str = ae.getActionCommand();
    if(str.equals("Ok")){
    text = "You pressed Ok";
    else
    if(str.equals("reset")){
    browser.select(0);
    os.select(0);
    text = "";
    repaint();
    public void paint(Graphics g) {
    g.drawString("Name: " + name.getText(), 6, 120);
    int idx[];
    msg = "Current Car: ";
    idx = os.getSelectedIndexes();
    for(int i=0; i<idx.length; i++)
    msg += os.getItem(idx) + " ";
    g.drawString(msg, 6, 140);
    msg = "Current Color: ";
    msg += browser.getSelectedItem();
    g.drawString(msg, 6, 160);
    g.drawString(text, 6, 200);

    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    <applet code="ListDemo" width=300 height=400>
    </applet>
    public class ListDemo extends Applet implements ActionListener {
    List os, browser;
    String msg = "";
    String text;
    String named = "";
    TextField name;
    Button Ok, reset;
    public void init() {
    Ok = new Button("Ok");
    reset = new Button("reset");
    add(reset);
    add(Ok);
    reset.addActionListener(this);
    Ok.addActionListener(this);
    Label namep = new Label("Name: ", Label.RIGHT);
    name = new TextField(12);
    add(namep);
    add(name);
    name.addActionListener(this);
    os = new List(4, false);
    browser = new List(4, false);
    os.add("default");
    os.add("BMW");
    os.add("BENZ");
    os.add("Lexus");
    os.add("Acura");
    browser.add("default");
    browser.add("Red");
    browser.add("Black");
    browser.add("Silver");
    browser.add("Blue");
    browser.add("Yellow");
    browser.add("Pink");
    browser.add("Grey");
    browser.add("Blue/Black");
    os.select(0);
    browser.select(0);
    add(os);
    add(browser);
    os.addActionListener(this);
    browser.addActionListener(this);
    public void actionPerformed(ActionEvent ae) {
    String str = ae.getActionCommand();
    if(str.equals("Ok")){
    text = "You pressed Ok";
    else
    if(str.equals("reset")){
    browser.select(0);
    os.select(0);
    text = "";
    name.setText("");
    repaint();
    public void paint(Graphics g) {
    g.drawString("Name: " + name.getText(), 6, 120);
    int idx[];
    msg = "Current Car: ";
    idx = os.getSelectedIndexes();
    for(int i=0; i<idx.length; i++)
    msg += os.getItem(idx) + " ";
    g.drawString(msg, 6, 140);
    msg = "Current Color: ";
    msg += browser.getSelectedItem();
    g.drawString(msg, 6, 160);
    g.drawString(text, 6, 200);

  • How to list selected parent and child rows with values from ADF TreeTable

    I created one tree table having three levels using DepartmentsVO, EmployeesVO and
    JobHistoryVO where these tables contains parent and child relationship on database.
    Then i added one more column to the tree table which displays selectBooleanCheckBox. This
    check box is available for parent and child rows in that column.
    My first concern is i
    want to list out all the parentids and its child ids from three levels where the check
    box is selected.
    second concern is
    if i select the check box for a parent row, then the remaining check boxes for child rows also select automatically which are comes under the parent row.
    Thanks in advance.
    jk

    hi Frank,
    Thanks for the quick reply...
    As I mentioned before I am able to get the children using JUCtrlHierNodeBinding. but wanted to change the value of child row which have specific data.
    Is it possible through JUCtrlHierNodeBinding to update data of child and parent?? If so then can you please post the code snippet for the same???
    Viral

  • How do I display Text linked to a dropdown list selection in a form?

    Ok, I have a form that has a dropdown list with several selections. What I want to have happen is when someone selects one of the options from the dropdown, I want to have text displayed to the right of that information that pertains to that selection.
    I have attached the page with the form I have created as well as the css document that is used.
    Any insight would be most appriciated! Thanks in advance!

    Hi,
    I browsed for you a bit and found this: http://javascript.internet.com/forms/suggest-messages.html Looks like what you need!
    Otherwise just search this database: http://javascript.internet.com/forms/

  • Error in TCode S_ALR_87013431 "Confirmation Using Operation List" selection

    Hello Experts,
    I think I have encountered an error in the functionality of the S_ALR_87013431 "Confirmation Using Operation List" in ECC 6.0.
    When I select the "collective time confirmation" checkbox, the intended functionality is (form the transaction help) "If you select this field, the report program enters the selection result directly in the collective entry screen, without previously displaying a list of results from which you can reselect."
    However, if I check the box, the results still don't appear directly in the collective entry screen, but still as a list of results.
    Is there some configuration missing? Have you encountered a similar error?
    Thanks!
    Andreas

    hi
    i think there is some problem with the transaction ,in easy access menu it is displayed as S_ALR_87013431 confirmation with operation selection.
    i think same screen it has incorporated
    you can use IW48 which fullfil your requirement
    regards
    thyagarajan

Maybe you are looking for

  • List view and datagrid

    Hi friends, I used list view or datagrid in .net , I dnt know how to implement in forms 6i. In my module, I have to enter sales items ..it will come like this:(it will come from textbox to listview) item_name qty price x 1 23.00 y 2 34.00 z 1 23.00 f

  • Is it possible to get a system disk for my old iMac without the receipt?

    I use an iMac at work and it's really slowing down. (10 minutes at least to open any application) I have 3 GB of ram and use only a quarter of my hard drive space. I've looked everywhere for the startup disk to no avail. I've used TechTool Deluxe and

  • Error in sap query

    Dear Experts , I have a query and executing using SQ01 . Here im getting warnings as  The query specifications cannot be used to generate a list, i.e. the query will probably not return the list you desire. If you still want to execute the query, ple

  • JS RegExp Bug in CS5

    var text = "aXbY"; var re = /^(.*?)(?:X(.+)Y)?$/; alert(text.match(re)); Returns "aXbY,,b" in Photoshop instead of "aXbY,a,b". The non-capturing parentheses seems to be the problem.

  • Is there any way to report users for spamming?

    Is there a way to report users for spamming? One of them in this forum is now editing their handle to nearly match genuine users.