ComboBox doesnt auto-select items

Hello,
my AutoCompleteComboBox doesnt autoselect the first item after initializing and doesnt recognize if user clicks on an item in the list.
I thought every combobox has an actionlistner therefor.
I'm using custom editor-component and model but i dont know where i could have done something wrong.
Any suggestions ?
* AutoCompleteComboBox.java
import java.awt.Component;
import java.util.*;
import javax.swing.*;
import javax.swing.plaf.basic.BasicComboBoxEditor;
import javax.swing.text.*;
public class AutoCompleteComboBox extends JComboBox
     private static final Locale[] INSTALLED_LOCALES = Locale.getAvailableLocales();
     private ComboBoxModel model = null;
     public static void main(String[] args)
          JFrame f = new JFrame("AutoCompleteComboBox");
          f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          AutoCompleteComboBox box = new AutoCompleteComboBox(INSTALLED_LOCALES, false);
          f.getContentPane().add(box);
          f.pack();
          f.setLocationRelativeTo(null);
          f.setVisible(true);
      * Constructor for AutoCompleteComboBox -
      * The Default Model is a TreeSet which is alphabetically sorted and doesnt allow duplicates.
      * @param items
     public AutoCompleteComboBox(Object[] items, boolean caseSensitive)
          super(items);
          model = new ComboBoxModel(items);
          setModel(model);
          setEditable(true);
          setEditor(new AutoCompleteEditor(this, caseSensitive));
      * Constructor for AutoCompleteComboBox -
      * The Default Model is a TreeSet which is alphabetically sorted and doesnt allow duplicates.
      * @param items
     public AutoCompleteComboBox(Vector items, boolean caseSensitive)
          super(items);
          model = new ComboBoxModel(items);
          setModel(model);
          setEditable(true);
          setEditor(new AutoCompleteEditor(this, caseSensitive));
      * Constructor for AutoCompleteComboBox -
      * This constructor uses JComboBox's Default Model which is a Vector.
      * @param caseSensitive
     public AutoCompleteComboBox(boolean caseSensitive)
          super();
          setEditable(true);
          setEditor(new AutoCompleteEditor(this, caseSensitive));
      * ComboBoxModel.java
     public class ComboBoxModel extends DefaultComboBoxModel
           * The TreeSet which holds the combobox's data (ordered no duplicates)
          private TreeSet values = null;
          public ComboBoxModel(List items)
               super();
               this.values = new TreeSet();
               int i, c;
               for (i = 0, c = items.size(); i < c; i++)
                    values.add(items.get(i).toString());
               Iterator it = values.iterator();
               while (it.hasNext())
                    super.addElement(it.next().toString());
          public ComboBoxModel(final Object items[])
               this(Arrays.asList(items));
      * AutoCompleteEditor.java
     public class AutoCompleteEditor extends BasicComboBoxEditor
          private JTextField editor = null;
          public AutoCompleteEditor(JComboBox combo, boolean caseSensitive)
               super();
               this.editor = new AutoCompleteEditorComponent(combo, caseSensitive);
           * overrides BasicComboBox's getEditorComponent to return custom TextField (AutoCompleteEditorComponent)
          public Component getEditorComponent()
               return editor;
      * AutoCompleteEditorComponent.java
     public class AutoCompleteEditorComponent extends JTextField
          JComboBox combo = null;
          boolean caseSensitive = false;
          public AutoCompleteEditorComponent(JComboBox combo, boolean caseSensitive)
               super();
               this.combo = combo;
               this.caseSensitive = caseSensitive;
           * overwritten to return custom PlainDocument which does the work
          protected Document createDefaultModel()
               return new PlainDocument()
                    public void insertString(int offs, String str, AttributeSet a) throws BadLocationException
                         if (str == null || str.length() == 0)
                              return;
                         int size = combo.getItemCount();
                         String text = getText(0, getLength());
                         for (int i = 0; i < size; i++)
                              String item = combo.getItemAt(i).toString();
                              if (getLength() + str.length() > item.length())
                                   continue;
                              if (!caseSensitive)
                                   if ((text + str).equalsIgnoreCase(item))
                                        combo.setSelectedIndex(i);
                                        if (!combo.isPopupVisible())
                                             combo.setPopupVisible(true);
                                        super.remove(0, getLength());
                                        super.insertString(0, item, a);
                                        return;
                                   else if (item.substring(0, getLength() + str.length()).equalsIgnoreCase(text + str))
                                        combo.setSelectedIndex(i);
                                        if (!combo.isPopupVisible())
                                             combo.setPopupVisible(true);
                                        super.remove(0, getLength());
                                        super.insertString(0, item, a);
                                        return;
                              else if (caseSensitive)
                                   if ((text + str).equals(item))
                                        combo.setSelectedIndex(i);
                                        if (!combo.isPopupVisible())
                                             combo.setPopupVisible(true);
                                        super.remove(0, getLength());
                                        super.insertString(0, item, a);
                                        return;
                                   else if (item.substring(0, getLength() + str.length()).equals(text + str))
                                        combo.setSelectedIndex(i);
                                        if (!combo.isPopupVisible())
                                             combo.setPopupVisible(true);
                                        super.remove(0, getLength());
                                        super.insertString(0, item, a);
                                        return;
}regards,
Tim

Hallo Tim,
I didn't thoroughly go through your code, but remembered a less
complex piece of code which does its job nicely. Although its
approach is somewhat different from yours (it doesn't care for
the Combomodel and has no case-sensitivity implemented), it might
nevertheless be of help.import java.awt.*;
import java.awt.event.*;
import java.util.*;
import javax.swing.*;
import javax.swing.text.*;
public class AutoComplete extends JComboBox
                  implements JComboBox.KeySelectionManager {
  private String searchFor;
  private long lap;
  public class CBDocument extends PlainDocument {
    public void insertString(int offset, String str, AttributeSet a)
                         throws BadLocationException {
      if (str==null) return;
      super.insertString(offset, str, a);
      if(!isPopupVisible() && str.length() != 0) fireActionEvent();
  public AutoComplete(Object[] items) {
    super(items);
    lap = new java.util.Date().getTime();
    setKeySelectionManager(this);
    JTextField tf;
    if(getEditor() != null) {
      tf = (JTextField)getEditor().getEditorComponent();
      if(tf != null) {
        tf.setDocument(new CBDocument());
        addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent evt) {
            JTextField tf = (JTextField)getEditor().getEditorComponent();
            String text = tf.getText();
            ComboBoxModel aModel = getModel();
            String current;
            for(int i = 0; i < aModel.getSize(); i++) {
              current = aModel.getElementAt(i).toString();
              if(current.toLowerCase().startsWith(text.toLowerCase())) {
                tf.setText(current);
                tf.setSelectionStart(text.length());
                tf.setSelectionEnd(current.length());
          break;
  public int selectionForKey(char aKey, ComboBoxModel aModel) {
    long now = new java.util.Date().getTime();
    if (searchFor!=null && aKey==KeyEvent.VK_BACK_SPACE &&
     searchFor.length()>0) {
      searchFor = searchFor.substring(0, searchFor.length() -1);
    else {
//     System.out.println(lap); // Kam nie hier vorbei.
      if(lap + 1000 < now)
        searchFor = "" + aKey;
      else
        searchFor = searchFor + aKey;
    lap = now;
    String current;
    for(int i = 0; i < aModel.getSize(); i++) {
      current = aModel.getElementAt(i).toString().toLowerCase();
      if (current.toLowerCase().startsWith(searchFor.toLowerCase())) return i;
    return -1;
  public void fireActionEvent() {
    super.fireActionEvent();
  public static void main(String arg[]) {
    JFrame f = new JFrame("AutoCompleteComboBox");
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.setSize(200,300);
    Container cp= f.getContentPane();
    cp.setLayout(null);
    String[] names= {"Beate", "Claudia", "Fjodor", "Fred", "Friedrich",
     "Fritz", "Frodo", "Hermann", "Willi"};
    JComboBox cBox= new AutoComplete(names);
//    Locale[] locales = Locale.getAvailableLocales();
//    JComboBox cBox= new AutoComplete(locales);
    cBox.setBounds(50,50,100,21);
    cBox.setEditable(true);
    cp.add(cBox);
    f.setVisible(true);
}Greetings
Joerg

Similar Messages

  • 6.1 Print Templates - auto select items in the print dialog popup

    In the slide deck I have about 6.1 it says the following:
    •Print Templates
    –Print templates can now be used to auto select items in the
    print dialog popup. By default, the out of the box template
    selects the current specification
    Unfortunately I haven't been able to find how to do this in the EP documentation. Could someone point me in the right direction on how to do this?

    Download Extensibility Pack 2.6. It was just released. Take a look at page 11 in the Print Extensibility Guide. It should have the info you need. If not let me know.
    Here is the link for the downloads:
    https://support.oracle.com/CSP/ui/flash.html#tab=PatchHomePage(page=PatchHomePage&id=h1j503ev())

  • How can i change the color of selected item in combo box, the selected item color is same as accent color, i want to change this to custom color

    <Page
    x:Class="App1.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:App1"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
    <Grid Background="White">
    <ComboBox HorizontalAlignment="Left"
    BorderBrush="Black"
    Foreground="Black"
    Margin="80,272,0,0" VerticalAlignment="Top" Width="205" Style="{StaticResource BorderColor}">
    <ComboBoxItem Content="One" IsSelected="True"/>
    <ComboBoxItem Content="Two"/>
    <ComboBoxItem Content="Three"/>
    <ComboBoxItem Content="Four"/>
    <ComboBoxItem Content="Five"/>
    </ComboBox>
    </Grid>
    </Page>

    Hi,
    you can open the project in blend and then select the combobox for get the default style for combobox and for selected item . Please reference the
    set combobox style.
    Or see
    quickstart: Styling controls topic to deep understand it.
    Hope helpful for you.
    --Simon
    True mastery of any skill takes a lifetime.

  • Getting selected item from combobox itemrenderer and storing in object

    Hi Guys,
    Can anyone help me in this regard. Its very urgent.
    I have a combo box itemrenderer in datagrid column. I want to get the user selected item from the dropdown of the row(s) (User may select values from combo box from multiple rows of datagrid) and corressponding values of all other columns of the rows and store it in an object . Then pass this object to database to update only those rows that user has changed.
    I am able to get the selected item from combo box using "event.currentTarget.selectedItem" and corressponding values of all other columns of the rows using "valueSelect.ID", etc where valueSelect is object which contains data for datagrid. But am stuck up with, how to store the selected item value of the combobox  and corressponding values of all other columns of the rows into an Object ?.
    Can anybody help me with sample to store selected item from combobox and its corressponding values of all other columns into an object which i can send to db...?
    Kindly help me in this regard.
    Thanks,
    Anand.

    Hi!
    Are you using a collection of VO or DTO as the dataprovider of the combobox component?
    If so, have you created some attribute there to control the user's selection in the combobox?
    For instance:
    private var selected:Boolean = false;
    If your solution fits this approach, you may create a new collection that contains just the objects that were selected by the user, it means you can loop through the datagrid's dataprovider and only insert in this new collection those objects that have the attribute "selected" set to true.
    For instance:
    private function getSelectedRecords(datagridDataProvider:ArrayCollection):ArrayCollection
        var newCollection:ArrayCollection = new ArrayCollection();
        for each (var item:Object in datagridDataProvider)
            if (item.selected)
                newCollection.addItem(item)
        return newCollection;
    Afterwards, you may serialize this new collection with your back-end.
    Hope it helps you!
    Cheers,
    @Pablo_Souza

  • Remember selected item with ComboBox

    Hey All,
    I was just wondering how other pople solve this issue.
    I have a combobox with a XX number of items in there. Now
    when I re-populate the combobox the selected item get's lost. I
    also would like to remember the selected item during sessions. For
    instance when A user selected item XX on monday. I would like to
    have it automatically set XX again when a user comes back on
    tuesday.
    Is there a meganism in adobe flex that allows me to remember
    a 'state' of a object, or is that custom programming?
    Ideally I would like to have a component that can do teh work
    for me rather then my application handles the logic, some sort of a
    state manager?
    Ries

    Use a SharedObject, and write to it in the ComboBox change
    handler. See SharedObject in FB3 help sys.

  • Auto select new item in tree

    Hi
    I have a tree that i allow user to drag and drop items to it - what is the easiest way so the new item is automatically selected? ie, tree.selectedIndex should point to the new item's index.
    Unfortunately it thought this was easy apparently it was not - like if the nodes in the tree control are collapsed, the selectedIndex is different than when all the nodes are expanded.
    Do note that the way i populate my tree is through a data provider - so i populate a class that would become the tree's data provider, so when the tree refreshes, i simply do this:
    myTree.dataProvider = project.p;   
    I can track where my new item was inserted in my "project" instance - but like i said earlier, the tree itself have different selectedIndex when the nodes are collapsed and when they are not.
    THanks

    Hi,
    I just posted a demo and source code on my blog: Auto select New Item in Tree component
    In above example i use loopAndFind() custom function.
    Hope it helps!
    Mariush T.
    Blog: http://mariusht.com/blog/

  • Selecting from Combobox with only one item

    I'm populating Comboboxes based on selections from other
    comboboxes. I pick up the selection with the 'change' trigger,
    however when you select the top item or if there is only one item,
    the change route doesn't work. So I tried to use the 'click' and
    even the 'close' triggers instead, but they give me an errors when
    I try to access the companion ArrayCollections which hold the IDs
    for the items in the list (as commented in the code). Any ideas how
    to get this to update with just one selection?
    <!-- The first three comboboxes populate the next one in
    the list in a 'drilldown' approach -->
    <mx:ComboBox minWidth="130" maxWidth="130" id="selectSys"
    dataProvider="{sysOps.lastResult.system.data}"
    change="fillComboBox(selectSys, selectSub, 'subsystem',
    subOps, sysIDs, 1)" rowCount="10" />
    <mx:ComboBox minWidth="130" maxWidth="130" id="selectSub"
    dataProvider="{subOps.lastResult.system.data}"
    change="fillComboBox(selectSub, selectDev, 'devices',
    devOps, subIDs, 2)"/>
    <mx:HTTPService id="sysOps" useProxy="false" method="GET"
    result="sysIDs = sysOps.lastResult.system.id as
    ArrayCollection;"
    fault="mx.core.Application.application.handleFault(event);"
    url="
    http://localhost:8080/TomCustodes/rocket"/>
    <mx:HTTPService id="subOps" useProxy="false" method="GET"
    result="subIDs = subOps.lastResult.system.id as
    ArrayCollection;"
    fault="mx.core.Application.application.handleFault(event);"
    url="
    http://localhost:8080/TomCustodes/rocket"/>
    // fill destination combobox based on selection from src
    combobox
    public function fillComboBox(src:ComboBox, dest:ComboBox,
    type:String,
    serv:HTTPService, idArray:ArrayCollection, element:int) :
    void {
    // choose ID from the associated ID array with the same
    selecetedIndex
    // error occurs as the idArray ArrayCollection comes up as
    null
    var selectedID:String = idArray.getItemAt(src.selectedIndex)
    as String;
    var params:Object = {};
    params[type] = type;
    var arg:String = "arg";
    var argList:Array = new Array();
    if (element > 1) {
    var ind:int = selectSys.selectedIndex;
    var sysName:String = sysIDs.getItemAt(ind) as String;
    argList.push(sysName);
    if (element > 2) {
    ind = selectSub.selectedIndex;
    var subName:String = subIDs.getItemAt(ind) as String;
    argList.push(subName);
    argList.push(selectedID);
    params[arg] = argList;
    serv.send(params);
    Thanks!

    I think the way I would go about that is having a result
    function for the HTTPServices and set your array collections how
    you are. Then after they are set I would check to see if the length
    == 1 and if it does then recall your fillComboBox method for the
    next combo box since there isn't a way for the user to change the
    combo box they might as well have the next one already filled out.
    The other approach you could take is after you set your array
    collection to your result add dummy items via
    myAC.addItemAt({label:"Choose one"}, 0); This will ensure the user
    always has an item to change to.

  • Auto select an item in a child node of a TreeView UI control?

    Hi There,
    I'm having some issues with a TreeView control in my UI that I cannot seem to resolve, and thought I would ask if anybody here has done this type of thing.  My TreeView is made up of a collection of nodes, each with some child items.  When the window containing the TreeView displays, I populate it with the nodes.  I want to be able to script the selection within the TreeView, but I want the script to select a child items, not just their parent nodes.  Is this possible?  I know it is possible to selecting the parent nodes in a TreeView, but I cannot seem to get the code for selecting, via scripting, a child item of a node in a TreeView.  Any thoughts on how to acheive this?
    Thanks for your time and help!
    Best,
    Arie
    Here is some of the code I am using for auto-selecting child items of nodes in the TreeView:
                        //Code to populate the TreeView (picker) goes here
                        //Highlight the last selection
                        for (var i=0; i < picker.items.length; i++)
                            if (picker.items[i].title == SAVED_TITLE){
                                picker.selection = picker.items[i];
                                picker.selection.expanded = true;
                                for (var x=0; x < picker.selection.items.length; x++) {
                                    if (picker.selection.items[x].marker == SAVED_MARKER){
                                        picker.selection = picker.selection.items[x];  //turns out the indices are relative to it's parent, not the picker's indices
                                        break;
                                break;

    I had some of the above code wrong:
        // function to filter jsx files------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------ -----------------------//
        function filterJSXFiles(file)
            return ((file.name.match(/.jsx(bin)?$/) != null) && (file.name != (new File($.fileName)).name));
        // Collect files in folder that holds Burrow AFX scripts---------------------------------------------------------------------------------- -----------------------------------------------------------------------------//
        var brws_ScriptFolder = "Z:\\apps\\after_effects\\AFX_Scripts\\"; 
        //print(brws_ScriptFolder)
        if (brws_ScriptFolder != null)
             var fileList = Folder(brws_ScriptFolder).getFiles(filterJSXFiles);
             //print( fileList)
            function myScript(thisObj){
            function myScript_BuildUI(thisObj){
                var myPanel = (thisObj instanceof Panel) ? thisObj : new Window("palette", "AFX SCripts", undefined, {resizeable:true});           
                res = "group{orientation:'row', alignment:['fill', 'fill'] , alignChildren:['fill', 'fill'], \
                    groupOne: Group{orientation:'column', alignment:['fill', 'fill'] , alignChildren:['fill', 'fill'], myMultiTreeView: TreeView{}   }     }     }"; // creating a resource string, controls go here
                myPanel.grp = myPanel.add(res);           
                var brws_ScripIconsDir = "Z:\\apps\\after_effects\\burrowsAFX_Script_Icons\\burrowsIconForAFX\\";   
                var jsxExt = ".jsx";
                //Add Treeview items and icons------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------ -----//
                var brws_TopNode = myPanel.grp.groupOne.myMultiTreeView.add("node", "Burrows AFX Scripts");
                brws_TopNode.image = File( brws_ScripIconsDir + "BurrowsIcon20x20.png" ); 
                //brws_TopNode.helpTip = "This is the help. Is it not THE greatest thing you have seen?"
                var brws_AsciiGenerator_1_2 = brws_TopNode.add("item", "AsciiGenerator_1_2");     // CURRENTLY THROWS RESOURCE ERROR
                brws_AsciiGenerator_1_2.image = File( brws_ScripIconsDir + "AsciiGenerator_1_2.png");
                // EVENTS----------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------ ---------------------------------//
                myPanel.grp.groupOne.myMultiTreeView.addEventListener('change', function (event)
                         if (myPanel.grp.groupOne.myMultiTreeView.selection.text ===  'AsciiGenerator_1_2') { fn_AsciiGenerator_1_2(); }
                   }, false);// End of Event Listener
                function fn_AsciiGenerator_1_2()
                    var asciiGenLoc = (brws_ScriptFolder + "AsciiGenerator_1_2" + jsxExt);
                    var scr_asciiGenLoc =  new File(asciiGenLoc);
                    if (scr_asciiGenLoc.exists) { scr_asciiGenLoc.open("r"); var scriptContent = scr_asciiGenLoc.read(); scr_asciiGenLoc.close(); eval(scriptContent); }
                    myPanel.grp.groupOne.myMultiTreeView.selection = brws_TopNode;
                //Setup panel sizing----------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------ --------------------//
                myPanel.layout.layout(true);
                myPanel.grp.minimumSize = myPanel.grp.size;
                //Make panel resizeable------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------ ------------------//
                myPanel.layout.resize();
                myPanel.onResizing = myPanel.onResize = function(){this.layout.resize()}           
                return myPanel;            
                }// End of myScript_BuildUI------------------------------------------------------------------------- ------------------------------------------------------------------------------------------ -------------------// 
            // Create the UI--------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------ --------------------------//
            var myScriptPal = myScript_BuildUI (thisObj)
            if( (myScriptPal != null) && (myScriptPal instanceof Window) )
                myScriptPal.center();
                myScriptPal.show();
            }// End of if Statement-------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------ ---------------------//
            }// End of myScript function
    myScript(this);
    }// End of script

  • Since upgrading to Firefox 4 I've been unable to select search items from the google drop down box in the toolbar. Instead, I have to retype my search item completely as I also unable to select 'auto-complete' items as they appear.

    Since upgrading to Firefox 4 I've been unable to select search items from the google drop down box in the toolbar. Instead, I have to retype my search item completely as I also unable to select 'auto-complete' items as they appear.

    Known problem with the Google Toolbar extension. <br />
    http://www.google.com/support/toolbar/bin/static.py?page=known_issues.cs

  • Ipod touch acting possessed! Almost like a virus. Auto selects letters, apps, etc. Doesnt let me slide bar until 4th attempt of more.

    My Ipod has been acting funny. First, I have a hard time using the slide bar to get into the first page. After 5 tries it lets me slide and enter. Then the ipod auto selections apps such as 'notes' app and will type random letters without me touching screen. Then if I try typing it will let me type most letters except 'n' and 'o' I have tried resetting and system restore to old backup as well as to new ipod. Nothing working.

    [url="http://web6.streamhoster.com/em2253/ZEN/ZenDeviceManager.wmv]See Movie[/url]?Hi, take a look at the movie... hopefully I answer to your question is there. [b]Let me know if you can NOT see it... [/b]and I will send you a picture. [color="#ff0000"]and if you can see the movie, give me feedback on it. Did it look ok in your computer? (it changes with all computers depending on your setting and player!). [color="#ff0000"]Was the sound ok?I almost wish I had not titled this post as "Happy Conclusion." It was happy but only a day or two... then I started having other problems... unbelievable. So, If I gave the wrong impression, sorry!

  • Combox Box not displaying selected item

    Below is the code I'm using to try to capture and display the
    selected item from a ComboBox:
    private function
    changeProjectTypeSelection(event:Event):void{
    projectTypeChange.text+=event.currentTarget.selectedItem.cboProjectType
    + " " +
    event.currentTarget.selectedIndex + "\n";
    Then the ComboBox:
    <mx:ComboBox fontSize="12" x="93" y="83" width="110"
    id="cboProjectType" dataProvider="{projectTypeArray}"
    labelField="projectTypeName" selectedIndex="0"
    click="changeProjectTypeSelection(event)"></mx:ComboBox>
    Then the TextInput:
    <mx:TextInput id="projectTypeChange" x="248.95" y="84"
    width="121"/>
    I know there's something wrong with the Actionscript code...
    just haven't figured it out. Any suggestions would be greatly
    appreciated!

    I've almost got it...
    private function
    changeProjectTypeSelection(event:Event):void{
    var i:int;
    for(i=0;i<projectTypeArray.length;i++){
    if(projectTypeArray.getItemAt(i).projectTypeName ==
    event.currentTarget.selectedItem.projectTypeName){
    projectTypeChange.text+=projectTypeArray.getItemAt(i).projectTypeName
    + "\n";
    Alert.show(projectTypeArray.getItemAt(i).projectTypeName +
    "FirstAlert");
    //Alert.show(event.currentTarget.selectedItem.projectTypeName +
    "SecondAlert");
    I just can't seem to be able to reset the value in the
    textInput field. I've tried setting it equal to spaces in several
    places, but it won't change after the first selection. Any ideas?
    Thanks for any suggestions!

  • How i can set the selected item of a dropDown component from java code

    Hi
    Thank you for reading my post
    How i can set the slected item of a DropDown component from backing beans java code ?
    it is binded with a database , so one field determine its display and one other field determine its value , I want to set the selected item of this combobox
    In back code i have both value and display values to use them .
    can some one give me some help ?
    Thanks ,

    See code sample 3 at http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/helloweb.html
    See also, the selection components row in the table under http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/helloweb.html
    It says
    One way to preselect items is to call setSelectedValue(Object[]) or setSelectedValue(Object) from the prerender() method. You pass in the return values of the items that you want preselected. Be sure to verify that getSelected() returns null before setting the default options, or you will overwrite the user's selections on a post-back.

  • Selecting item in combo box itemEditor, after passing it's dataprovider from a popup window

    Hi..
    I have a datagrid which has a combo box itemeditor in the first column. When I click on the combobox, there is an item called 'Search'. When this is selected, a pop up window appears where we can search for some contact names. The search results are populated in List component, within the pop up and on double click of any of the names from the list, all of the list content is passed on as dataprovider to the combobox itemeditor of the grid. It works fine till here. Now, how can I highlight the selected name(name on which I double click, in the list of the pop up window), as the 'selectedItem' of the combobox itemeditor? ie., as soon as I double click the name, that name should appear on that combo box. As of now, wehn I double click, the search result names are passed on as dataprovider to the combobox, but a blank entry will be selected in th combobox, instead of the selected name from teh list of the pop up window. Can you please help me out on how to achieve this? I had been cracking my head for 2days now, hasn't worked out yet for me

    Hi...
    there are two events which have been used, one is doubleclick event and the other one is on selecting the item from the list and clicking on OK button(this will be the most frequently used function, i cannot use event target event for this OK button... ) . I have attached the screen shot. Please have a look at it and let me know how can i achieve that...
    I can use custom event, but the main problem is that the inline itemeditor's details are not accessible in the code.... I can access some function from within the inline itemeditor combo box using outerDocument.myFunction() (this is something like GET). Is there a similar way, to SET the data into this itemeditor?

  • How do I stop auto select or hovering with my trackpad?

    How do I stop my track pad / mouse from auto select (Hovering)?

    I've been having this problem on my MacBookPro for some time. I live in China.  In January I took it in to the Genius'  in California and they replaced the trackpad.
    I think it's a software problem. I continue to have this problem in Firefox and Safari. I use a VPN and I also check preroidically for viruses. I have a clean computer with no viruses. I don't open spam, links or attachments from anyone I don't know well or recognize. My computer is clean.
    I use the latest versions of OS and update my software when there are new updates. I'm using 10.8.2. Haven't added 10.8.3 yet but will do so as soon as I see that it is stable.
    This problem is quite frustrating. When reading and scrolling down a page of news a new item is selected or text is selected without a click. Sometimes I will be taken to a new page without having clicked anything.
    It's quite a hassle sometimes.
    Apple hasn't helped at all with this.

  • Auto select not working with tethered shooting

    Hi,
    I'm shooting images in a studio tethered, and up until yesterday it was working like a dream. I take a picture and it shows up on my mac... but now it's stopped working. The images capture ok, but the viewer doesnt show the most current picture.
    I've checked that 'auto select' is ticked/checked on the HUD... and havent changed anything on my set up... so I'm hoping someone has an idea what it might be.
    I'm working with the latest version of Aperture 3 on Lion with a Canon 5D
    Any help greatly welcomed
    Jack

    When I thether It will work fine till the end of the day and I then I have to reboot.  Once I reboot the images are captured and advance properly.  So I suggest rebooting the machine.  If it doesnt work normally at the start Id do the trouble shooting steps in
    Aperture 3: Troubleshooting Basics
    re boot in safe mode then ...
    Start AP  while holding the option key and repair permissions
    delete the user AP preferencs
    use disk utlilties to repair permissions
    use Single user mode to type in th fsck  command  (look it up first)
    Its alot  but it covers alot also

Maybe you are looking for