2 editable combobox questions

1. addKeyListener(..) not working onto editable combobox.
2. how to scroll the editable combobox when user types into it?
(in case of solving 1st problem, this one is solved too). Maybe there are special methods??
Thank you very much.
Boris.

1) you need to add the listener to the editor of the combobox, no the combobox itself.
2) scroll? I thought it already does an auto select if there is a value in the list which starts with what's typed.

Similar Messages

  • Set border color of editable ComboBox on focus

    What I want to do, is set BorderBrush of editable ComboBox. I'm using slightly modified default WPF templates. They are structured like below:
    <ControlTemplate x:Key="ComboBoxEditableTemplate" TargetType="{x:Type ComboBox}">
    <Grid x:Name="templateRoot" ...>
    <ToggleButton x:Name="toggleButton" ... />
    <Border x:Name="border" ...>
    <TextBox x:Name="PART_EditableTextBox" ... />
    <!-- textbox with IsFocused property which should be focus trigger -->
    </Border>
    </Grid>
    </ControlTemplate>
    ToggleButton template:
    <ControlTemplate TargetType="{x:Type ToggleButton}">
    <Border x:Name="templateRoot" ...> <!-- first border brush I want to set on focus -->
    <Border x:Name="innerBorder" ...> <!-- second border brush I want to set on focus -->
    <Border x:Name="splitBorder" ...>
    <Path x:Name="arrow" ... />
    </Border>
    </Border>
    </Border>
    </ControlTemplate>
    And now, what should happen.
    When PART_EditableTextBox.IsFocused is equal to true then set
    templateRoot.BorderBrush and innerBorder.BorderBrush to another color (for example red and blue).
    It would be very simple if there was only one BorderBrush to set, because I could use
    TemplateBinding to bind this property to ToggleButton element.
    For me, the problem are nested templates. I don't know how to refer to inside of another template.
    I hope you can help me.
    It would be very good if I didn't need to use C# code, just XAML.

    >>I don't know how to refer to inside of another template.
    You cannot. But since the PART_EditableTextBox is part of the ControlTemplate of the ComboBox you could add the trigger to this control template and then for example set the BorderBrush property and the Background propery of the ToggleButton and bind these
    to the BorderBrush properties of the Borders in its ControlTemplate:
    <ControlTemplate x:Key="ComboBoxEditableTemplate" TargetType="{x:Type ComboBox}">
    <TextBox x:Name="PART_EditableTextBox" ... />
    <ToggleButton x:Name="toggleButton" ... />
    <ControlTemplate.Triggers>
    <Trigger Property="IsFocused" Value="True" SourceName="PART_EditableTextBox">
    <Setter Property="BorderBrush" TargetName="toggleButton" Value="Red"/>
    <Setter Property="Background" TargetName="toggleButton" Value="Blue" />
    </Trigger>
    </ControlTemplate.Triggers>
    <Style x:Key="ComboBoxToggleButton" TargetType="{x:Type ToggleButton}">
    <Setter Property="OverridesDefaultStyle" Value="true"/>
    <Setter Property="IsTabStop" Value="false"/>
    <Setter Property="Focusable" Value="false"/>
    <Setter Property="ClickMode" Value="Press"/>
    <Setter Property="Template">
    <Setter.Value>
    <ControlTemplate TargetType="{x:Type ToggleButton}">
    <Border x:Name="templateRoot" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="2">
    <Border x:Name="innerBorder" BorderBrush="{TemplateBinding Background}" BorderThickness="2">
    <Border x:Name="splitBorder">
    <Path x:Name="Arrow" Data="{StaticResource DownArrowGeometry}"
    Fill="Black" HorizontalAlignment="Center" Margin="0,1,0,0" VerticalAlignment="Center"/>
    </Border>
    </Border>
    </Border>
    </ControlTemplate>
    </Setter.Value>
    </Setter>
    </Style>
    If you don't want to use the Background property for this, the other option is to create your own custom class that derives from the ToggleButton class and add a dependency property called "InnerBackground" or something to this class and replace
    the ToggleButton with your custom ToggleButton and replace the binding to the Background property with a binding to the new dependency property and set this one in the control template for the ComboBox.
    Hope that helps.
    Please remember to close your threads by marking helpful posts as answer and/or helpful and please start a new thread if you have a new question.

  • Changing the font of a non-editable ComboBox

    Hello everyone,
    I need a small combobox. So I set a font of a specific size to the combo's
    editor. That works nice als long as the combo is editable; but when it becomes
    uneditable, the default bold font is used and some items don't fit in the
    field any more. How to prevent this?
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.plaf.*;
    class ComboEditorFont extends JFrame {
      Font fontM= new Font("Monospaced", Font.PLAIN, 13);
      public ComboEditorFont() {
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        setSize(100,100);
        setLayout(null);
    //  Changing the font in the UIManager doesn't work either
    /*    Font defaultComboBoxFont= UIManager.getFont("ComboBox.font");
        FontUIResource fui= new FontUIResource(fontM);
        UIManager.put("ComboBox.font", fontM);
    //    UIManager.put("ComboBox.font", fui);
        JComboBox cmb = new JComboBox(new String[]{"ABC","DEF","GHI","LMO"});
        cmb.setBounds(20,20, 48,20);
    //    cmb.setEditable(true);
        JTextField editor= (JTextField)(cmb.getEditor().getEditorComponent());
        editor.setFont(fontM);
    //    cmb.setRenderer(new MyCellRenderer());
        add(cmb);
    //    UIManager.put("ComboBox.font", defaultComboBoxFont);
        setVisible(true);
      public static void main(String args[]) {
        EventQueue.invokeLater(new Runnable() {
          public void run() {
         new ComboEditorFont();
      class MyCellRenderer extends JLabel implements ListCellRenderer {
        public MyCellRenderer() {
          setOpaque(true);
        public Component getListCellRendererComponent(JList list,
                                                       Object value,
                                                       int index,
                                                       boolean isSelected,
                                                       boolean cellHasFocus) {
          setFont(fontM);
          setText(value.toString());
          Color background;
          Color foreground;
          JList.DropLocation dropLocation = list.getDropLocation();
          if (dropLocation!=null && !dropLocation.isInsert() &&
           dropLocation.getIndex() == index) {
         background = Color.BLUE;
         foreground = Color.WHITE;
          } else if (isSelected) {
         background = list.getSelectionBackground();
         foreground = list.getSelectionForeground();
          } else {
         background = list.getBackground();
         foreground = list.getForeground();
          setBackground(background);
          setForeground(foreground);
          return this;
    }

    - an offense to the english grammarThe exaggeration was meant to be ironic, not mean. Seriously, if a post is unreadable why bother posting it at all?
    offense/non offense, I'd start to teach this language on 15/oct/2009, untill now ---> MSDN, ASM,I don't know if you refer to the Java or English language...
    Either way, hopefully you have merely started learning it - not teaching it! :o)
    - ranging from slightly to completely off-topic
    always exists the different way, my off-topic "for you hide" declaracion for topic,
    I agreed with some rules, disagre with strict..., Swing = something based on variable interpretations about Java decl., isn't exist stricts borders there, only God can tell us, If is it Swing, or if isn't Swing relevants, not my trully,No, no, I meant "off-topic" with regard to the poster's question: he had tackled the problem for editable comboboxes already, and was specifically talking about non-editable comboboxes, so obviously altering the editor as you suggested was hopeless.
    - giving out "coding advice" without any justification
    be sure that 99pct from "answers" fired these guys find out the "coding advice" on Go..., on another forum(s), and they will not returns back here anymore, for not-acceptable Hot Potato Games (if is or isn't topic relevant for this forum), I'm afraid the grammar prevented me to understand this whole sentence...
    help is by Camickr's company, by German Kommunität (rel. for EU TimeZone), I'm only to learn (somehow) this language, Read - Translate ---> T - Write, An online translation system may help you to read these forums, but really don't post text translated this way!
    with peaceFullFace and takeAnyNoticeOfIt kopik,No personal offense meant, I now think you're well-intended (but really awkward all the same).
    Edited by: jduprez on Nov 6, 2009 4:06 PM - fixed spelling - mind you, I'm not a native english speaker either!

  • How to edit the question that I have asked here

    hello I have asked a question in this webstart forum , that has a sensitive information so I got to chage it immediately ...
    I didn't knew it before I ask, that these questions are visible in google, because now my manager found that question in google search with my project name
    I got to remove those words from that questions
    can any one please help me how to do it ?
    I didnot find any thing that can help me to edit a question that I have asked in the past... but it is very important and urgent please help me
    thank you ...

    Thanks a lot for your help
    ya I have observed that google catche is having it for many days and I have contacted google too to remove the catche
    and here in java forums I have contacted Sun and they have deleted that question
    so thanks a lot and have nice time over ther
    all the best
    babaiii

  • Editable Combobox in a JTable

    Hi All,
    I have a editable combobox in a normal JTable as one of columns.Can any body help me to set the size to the entered text in editable combobox. Means if I set the length to 5 then it should accpet only 5 characters.so how to achive it ??
    Regards
    Suresh

    First get cell editor that should be a combobox. Then get its editor that should be text box and then set its size.

  • Losing focus on editable combobox

    Hi everyone!
    I have created a combobox and setEditable is set to true but it does not react to the focus lost method.But when the setEditable is set to false then the focus lost method is executed. According to the following Sun Developer sites(http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6433257,
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4628933) this is some kind of bug.
    Is there no way that I can have an editable combobox that reacts to the focus lost method I mean that loses focus?

    When you have an editable combo box the editor has focus, not the combox box. So I guess you would need to add the FocusListener to the editor itself and not the combo box directly.

  • Editable Combobox in ADF

    Hi
    is it possible to make the combobox editable ?
    pls advice

    HI Sireesha Pinninti ,
    yaa , Normal combobox is not editable
    is there any alternative for Editable combobox similar to InputComboBoxListofValues
    my requirement is if i have a Country combo box with 2 option India and US , if the enmd user want to opt China , he could type tht
    pls advice
    Regards
    Jeethi George

  • Editable ComboBox in JOptionPane

    Can we have an editable comboBox in JOptionPane. Everything matches my requirements in the JOptionPane except that the comboBox is non editable. Can I make it editable instead of writting my own class which does this purpose...
    ??

    Actually found something similar which resolves the issue..
    Following is the code snippet......
    final JPanel panel = new JPanel();
    String[] choices = new String[] {"choice1", "choice2"};
    final JComboBox combo = new JComboBox(choices);
    combo.setEditable(true);
    panel.add(combo);
    if (JOptionPane.showConfirmDialog (null, panel,"Save As", JOptionPane.OK_CANCEL_OPTION) ==JOptionPane.OK_OPTION) {
    System.out.println("Saving " + combo.getSelectedItem());

  • HT1918 How to edit secury questions.. Coz i forgrot my answers to my previous questions. Now cant purchase any app.

    How to edit secury questions.. Coz i forgrot my answers to my previous questions. Now cant purchase any app.

    Reset Security Questions
    Frequently asked questions about Apple ID
    Manage My Apple ID
    Or you can email iTunes Support at iTunes Store Support.
    If all else fails:
      1. Go to: Apple Express Lane;
      2. Under Product Categories choose iTunes;
      3. Then choose iTunes Store;
      4. Then choose Account Management;
      5. Now choose iTunes Store Security and answer the bullet questions, then click
          Continue;
      6. Sign in with your Apple ID and press Continue;
      7. Under Contact Options fill out the information and advise iTunes that you would
          like your security/challenge questions reset;
      8. Click Send/Continue.
    You should get a response within 24 hours by email.
    In the event you are unsuccessful then contact AppleCare - Contacting Apple for support and service.
    Another user had success doing the following:
    I got some help from an apple assistant on the phone. It is kind of round about way to get in.
    Here is what he said to do and it is working for me...
      a. on the device that is asking you for the security questions go to "settings", > "store" >
          tap the Apple ID and choose view"Apple ID" and sign in.
      b. Tap on payment information and add a credit/debit card of your preference then select
          "done", in the upper right corner
      c. sign out and back into iTunes on the device by going to "settings"> "store" > tap the
          Apple ID and choose "sign-out" > Tap "sign -in" > "use existing Apple ID" and you
          should be asked to verify your security code for the credit /debit card and NOT the
          security questions.
      d. At this time you can remove the card by going back in to edit the payment info and
          selecting "none" as the card type then saving the changes by selecting "done". You
          should now be able to use your iTunes store credit without answering the security
          questions.
    It's working for me ...I just have to put in my 3 digit security pin from the credit card I am using.
    Good Luck friends!

  • How to exit edit mode (editable comboBox)?

    I have an editable comboBox. When a user clicks on the text
    area, he can rename the text and the idea is to click outside the
    comboBox to commit the new value.
    The problem now is when the user clicks outside the comboBox,
    the comboBox remains in edit mode(with the blinking prompt). How do
    I make it get out of that mode?
    thanks in advance

    Hi,
    setting comBox.editable=false in the function where you
    commit the vaules will solve this purpose.
    Also remember to set it in edit mode when click event on the
    combobox happens
    Ex.
    <mx:ComboBox id="comBox" click="setMode()"/>
    public function setMode():void{
    comBox.editable=true;
    I hope I have given you a direction to think upon.
    Take care

  • Editable Combobox component

    I have created a application using combobox wherein the
    combobox loads the names of the persons from an XML file. I have
    created the application using XMLConnector component without
    writing a single line of ActionScript code.
    The editable property of the combobox is set to true. I would
    like the combobox to display the person's names when the user types
    the name directly in the editable combobox.
    For Example: The combobox contains names like Alfred, John,
    Sandy etc
    If user types 'J' or 'Jo' the combobox shoud open up and
    select the names starting with J.

    Use s:DropDownList instead.
    Peter

  • Jquery editable Combobox

    Hello All,
    Did any body implement the jquery editable combobox? like the combobox in
    http://stuff.rajchel.pl/jec/demos/#demo-1
    Can you please tell me how to implement this?
    that will be a great help

    Wanna post it and share with EVERYONE else??
    That's the way this works here, sharing and HELPING everyone as a GROUP!
    Thank you,
    Tony Miller
    Webster, TX

  • Graphical skin for editable ComboBox

    I am using graphical skins to style a ComboBox. They work fine for a normal combobox. When I make it editable, Flex no longer uses the upSkin, overSkin and downSkin for the editable text area. It seems to use the default Flex skin instead. It is using my editableUpSkin, editableOverSkin and editableDownSkin for the arrow area, though. What do I need to change to use my graphical skins for both the editable text area and the arrow area?
    Thanks!

    Maybe you need to specify a custom itemRenderer you have skinned as well.
    If this post answers your question or helps, please mark it as such.
    Greg Lafrance - Flex 2 and 3 ACE certified
    www.ChikaraDev.com
    Flex / AIR Development, Training, and Support Services

  • Issues with WMV HD Editing & Newbie Questions

    Hi,
    I am new to PE7, so apologies if some of these have been asked b4, I searched but couldn't come up with direct solutions.
    I mainly edit HD WMVs, raw HD videos and MPEGs, to be used on PCs and on the internet. Most used output would be HD 1280x720(wmv).
    I am having problems with HD WMVs in PE7, they don't seem to play smoothly for editing, clipping etc(choppy and jumpy are the words that come to mind). At first, I thought this was a memory issue( I have 3 gigs on a Vista computer with a Dual Core processor), but then decided to try editing a couple of  HD MPEGs (same size) and these played smoothly, allowing be to make precise splits etc.
    What would be the best setting for editing WMV HD files(as I said, mainly 1280x720 input and output)? I tried the HD and AVCHD settings(when starting the new project), no joy. Is there some way to tweak PE7, or adjust the settings when editing WMVs, or in general, is it best to import MPEGs?
    Next question  - I am going to be doing quite a lot of editing over the next few months. Do people find Vista or XP more stable to use with PE7 and Premiere Pro and how much memory would be best for optimal perfomance? If I have to get an XP PC for editing, then that's what I'll have to do. Right now, I'm trying out PE7 and I'm sure I'll have to upgrade to Premiere Pro in a few months, so please bear that in mind.
    Any other suggestions, tips and useful links, greatly appreciated.
    Thanks

    PE7 handles HDV MPEG2 natively... so if you look at a clip on the timeline it will have no line above it, if you look at a HD WMV file on the timeline it will have a red line above it. For the HD WMV file to play back smoothly on your computer (depending on how "beefy" your computer is) you will have to hit the Enter key on your keyboard to render the clip. After rendering the clip will play back smoothly and have a green line above it.
    If you are editing 1280x720 HD WMV you could use the HDV 720 30p project preset... however whatever project preset you use you will always have the same need to render the clip.
    PE7 and PPro works well with either WinXP or Vista. For editing high definition video I would go with 4G RAM (well your computer will only be able to access 3.2G+ of the RAM). More important is the processor, especially if you venture into editing AVCHD. A fast Quad core is ideal.

  • Supporting maxChars on editable ComboBox, string validator null out input once max is reached

    I have a ComboBox in a form set to editable, so it acts like a text input but as drop down values as well.
    The data here is required and I want to limit the number of characters that can be entered, normally under a TextInput control you would just set the maxChars.
    I have created a string validator, required is based on seletedLabel so that working as I would expect.
    I set a maximum character limit in the validator which does not limit the text but prevents validation if the count is over, so far so good.
    Now the issue, imagine you set this to 10 characters  maximum, type the 11th character the validator correctly invalidates the control and the standard message pops up and prevent form submission.
    But if the user is still typing as soon as you enter one character over the limit in this example the 12th character the input nulls out to empty string.
    I want to limit the the number of characters that can be typed or the validator to not null out, giving the user a chance to back space instead of clearing the input.
    Any ideas?
    TIA
    flash.

    I am probably missing something with all the scrolling up and down and back and forth, but I can't see how that line can throw an NPE. Or the constructor which it calls.
    What is the exact runtime message?

Maybe you are looking for

  • Nvidia-smi support in 270.41.06

    I have an 8400GS and noticed that nvidia-smi no longer supports my GPU under 270.41.06? $ nvidia-smi NVIDIA System Management Interface -- v2.0 NVSMI provides diagnostic information for Tesla and select Quadro devices. The data is presented in either

  • IWS 6.1 SP6 - problem reloading *vsclassobj.conf files

    Hi, I hope someone can point me in the right direction as this is starting to drive me round the bend :-( In my configuration I require approx 80 virtual servers - one for each of the stores I support. When I am installing/configuring a new web serve

  • Chart horizontal axis show whole year

    Hi All, How to display whole year month as horizontal axis even if no data? for example, currently I have data for FY13 up to Jan 13, no data for Feb 13, Mar 13, Apr 13, May 13 and Jun 13 yet, in the chart it will automatically showing horizontal axi

  • Command R Recovery Not Working

    Dear All, I'm a little stuck.  There's something wrong with my OSX (Mavericks 10.9.5) that is stopping me from booting in the regular way ( I get stuck @ the grey screen), Booting and using Command R does nothing (tried many times for long periods),

  • Is It Possible To Prevent a Stroke's Weight From Scaling with the Rest of an Object?

    I want to animate a person moving off into the distance, but while I want the size of the figure to get smaller, I don't want the weight of the lines that comprise the image to scale down, too. I made this little sample of a person skating (poorly) a