ComboBox without first item

I have a Combobox with 4 items. When it�s closed
you can see the item with index 0. If I open the
ComboBox, I want to see all elements except thatone
with index 0. This should only be seen in the normal
closed Combobox field and not in the opened, too.
Has someone a model or a renderer
for that problem. It�s very urgent.
Thanx and regards
Stephan

I tried it, after des FocusGained Event,
but it doesn�t work that way:
private void jComboBox1FocusGained(java.awt.event.FocusEvent evt) {
jComboBox1.setSelectedItem(null);
regards
Stephan

Similar Messages

  • Windows Phone 8.1 xaml, c# ComboBox does not display selection when first item is selected from full page list.

    I have 3 comboboxes on a xaml page and most of the time when I select the first item on the full page list displayed when the number of items are > 5, the screen returns to the combobox and the box is blank. The combobox.SelectedItem is valued but it
    does not display.  This does not happen every time and I have seen this using the emulator and my windows 8.1 phone.  If I select any other item in the list they always display but when I go back and select the first item the box is blank. 
    Does anyone know what I could be doing that is causing this?

    Thanks for your help.  When I run the code below and the page is displayed, I select an item from the page list and it displays fine and then I select the first item from the page list and I do not see that selected item in the box. 
    If I remove the SelectedIndex=0 it all works fine except I do not have an item selected for the initial display.  Below should show problem and should work copy/paste in universal blank app.
    ScrollViewer x:Name="scrollViewer1">
            <StackPanel x:Name="stackPanel1" Background="Transparent">
                <ComboBox x:Name="comboBoxTestTypes" Margin="20,117.75,0,465.25" SelectedValuePath="ItemDescription" Width="310" Height="Auto" FontSize="17"
           ItemsSource="{Binding}" HorizontalAlignment="Left" VerticalAlignment="Center">
                <ComboBox.ItemTemplate>
                    <DataTemplate>
                        <TextBlock Text="{Binding ItemDescription}" />
                    </DataTemplate>
                </ComboBox.ItemTemplate>
            </ComboBox>
     </StackPanel>
        </ScrollViewer>
    public sealed partial class MainPage : Page
            public ObservableCollection<ItemDetail> itemDetail;
            public MainPage()
                this.InitializeComponent();
                this.NavigationCacheMode = NavigationCacheMode.Required;
                this.itemDetail = new ObservableCollection<ItemDetail>();
            protected override void OnNavigatedTo(NavigationEventArgs e)
                PageLoad();
            public class ItemDetail
                public string ItemDescription { get; set; }
                public string ItemName { get; set; }
            private async void PageLoad()
                await initializeTypes();
                var comboBoxTestTypesItemsSource = await GetTestTypes();
                comboBoxTestTypes.ItemsSource = comboBoxTestTypesItemsSource;
                comboBoxTestTypes.SelectedIndex = 0;
            private async Task initializeTypes()
                await addTestType("Item1");
                await addTestType("Item2");
                await addTestType("Item3");
                await addTestType("Item4");
                await addTestType("Item5");
                await addTestType("Item6");
            private async Task<ObservableCollection<ItemDetail>> GetTestTypes()
                //ObservableCollection<ItemDetail> list = new ObservableCollection<ItemDetail>();
                //Random rnd = new Random();
                //for (int i = 0; i < 50; i++)
                //    list.Add(new ItemDetail() { ItemDescription = "hello" + rnd.Next(0, 1001), ItemName = rnd.Next(0, 101).ToString() });
                await getSaveDataFileDataAsync("get");
                return itemDetail;
            private async Task addTestType(string description)
                int newIdAdd = 0;
                if (itemDetail != null && itemDetail.Count > 0)
                    newIdAdd = itemDetail.Max(mT => Convert.ToInt32(mT.ItemName)) + 1;
                var addTestType = new ItemDetail();
                addTestType.ItemName = newIdAdd.ToString();
                addTestType.ItemDescription = description;
                itemDetail.Add(addTestType);
                await getSaveDataFileDataAsync("save");
            private async Task getSaveDataFileDataAsync(string getSave)
                try
                    DataContractJsonSerializer jsonSerializer1 = null;
                    string dataFileName1 = "testFileName";
                    jsonSerializer1 = new DataContractJsonSerializer(typeof(ObservableCollection<ItemDetail>));
                    if (jsonSerializer1 != null && getSave == "get")
                        using (var stream1 = await ApplicationData.Current.LocalFolder.OpenStreamForReadAsync(dataFileName1))
                            itemDetail = (ObservableCollection<ItemDetail>)jsonSerializer1.ReadObject(stream1);
                    if (jsonSerializer1 != null && getSave == "save")
                        using (var stream1 = await ApplicationData.Current.LocalFolder.OpenStreamForWriteAsync(dataFileName1, CreationCollisionOption.ReplaceExisting))
                                jsonSerializer1.WriteObject(stream1, itemDetail);
                catch

  • How to set first Item in combobox

    Hi all,
    I am struggling to find out how to set the first item of the
    combobox as say "Select" because the fields i display in the
    combobox
    are optional for the user to select.
    I have in the dataprovider of combobox set to an
    arraycollection populated by a call to fill method.
    But these items should be displayed below "Select".
    Can anyone help me on this.
    Thanks,
    Lakshmi

    Hi
    Try
    yourcomboxox.prompt = "Select";
    yourcombobox.selectedIndex = -1;
    http://livedocs.adobe.com/flex/201/langref/index.html?mx/controls/ComboBox.html&mx/control s/class-list.html
    HTH
    John

  • Navigate to the first item in a updatable report

    on my page i have a master/detail form. When a new detail - record is created, the cursor navigate to the first item on the page => it is the first item of the master! What I have to do, that the cursor navigate to the first item in the new detail-record ??
    Thanks
    Robert

    Hi Andy,
    thank you for your answer.
    When the program start, I can not find the cursor. I think, I have a problem to reference the item in the updatable report. I wrote the following lines:
    <script language="JavaScript1.1" type="text/javascript">
    alert('Vor Cursor Navigation');
    first_field('#FKOM_RUFNR#');
    </script>
    (FKOM_RUFNR is a column of the select statement in the report!!)
    A second problem: The cursor navigate to the field - first_field('FIELD_NAME') - every time. But the cursor should navigate to the field in the updatable report, if the button "ADD" in the region of the updatable report was clicked. If the page was displayed without clicking the ADD - button, the cursor should navigate to the first item in the master form ( like => Cursor focus: first item on the page). How can I do that ??
    Thanks
    Robert

  • Hide "more" button in a list view, only works for first item in the list

    I have the following code in a list view that outputs several dozen items in a web app.  The code only works for the first item, how can I make it loop through and execute the test for each item in the list view?  The {tag_hide more button} is a checkmark field that yields a numeric 1" if checked otherwise yields a numeric "0".
    <div id="more-option">
            <p class="right"><a href="{tag_itemurl_nolink}" class="btn btn-small btn-very-subtle">More &rarr;</a></p>
          </div>
          <div class="more-selection" style="display: none;">{tag_hide more button}</div>
          <script>
    if ($(".more-selection").text() == "1") {
        $("#more-option").hide();
    </script>

    What's the URL for the site where you are using this?  Offhand, it looks like it should work with your first example so you are either placing the script before those elements are loaded or you might try wrapping your current javascript inside the:
    $(document).ready(function() {
    --- your existing javascript here
    This make sure the code runs once all the html is loaded on the page.  Without seeing a URL and debugging with the js console in Chrome I can't give you a solid answer.
    But, I do know that you can probably do this with a lot less markup.  Once we figure out what the actual problem is I have a better solution mocked up for you on jsfiddle.
    When looking at my HTML code on jsfiddle, please realize I setup some dummy HTML and removed your tags and added actual values which would be output by your tags.  The main thing I did was remove the whole div.more-selection and instead, added a "data-is-selected" attribute on your div.more-option element.  Then, in my javascript for each div.my-option element on the page, we loop through them, find the value of that data attribute and hide that div if it's less than 1 (or 0).
    Here's the fiddle for you to look at:  http://jsfiddle.net/thetrickster/Mfmdu/
    You'll see in the end result that only two divs show up, both of those divs have data-is-selected="1".
    You can try pasting the javascript code near the closing </body> tag on your page and make sure to wrap my js inside a <script> tag, obviously.  My way is neater on the markup side.  If you can't get it to work it's likely a jquery conflict issue.  My version is using the $(document).ready() method to make sure all the code is loaded before it runs.
    Best,
    Chris

  • How to get first item of hashMap w/out knowing the key

    Hi
    can someone tell me if there is a way to get first item from a hashMap when you dont know what the key is. as the get method expects a defined 'key'
    reason I am asking this:
    I am using struts 2 UI <s:radio> tag. this tag takes a hashmap and creates radio maps. it has a 'value' attribute and if something is passed to this attribute then that radio button is checked by default. the list that contains radio buttons is created dynamically so i dont know what is actually in the hashMap key's. but i do know that key's are string.
    so just wondering if there is a way to get first item from a hashmap without knowing the key...

    thanks for the quick reply.
    posted in java forums because thought it was a java API/workaround question. gave a little history because i didnt want people to start questioning my use of HashMap for this purpose..
    anywhose..i've found a workaround.
    If someone has a similar problem:
    as the hashmap is being populated dynamically....set a String member of class to contain the first key thats being put in the hashmap. then have struts tag pick up that value.
    also, through your post and reading hashMap api...its usefull to know that hasMaps do not gurantee the order of elements in it. So now I am using a TreeMap.
    Thanks

  • Select first item in table

    I have a spry:region that feeds data to another spry:region
    and spry:detailregion. The setup works fine, but the first
    dsJobCategories TD doesn't appear selected via CSS. It pipes in the
    data to the subsequent spry:region and :detailregion without
    showing up as selected. The code is below. Can anyone tell me what
    I'm doing wrong?
    <div id="Jobs_DIV">
    <span spry:region="dsJobCategories">
    <h2>2: Choose a Subcategory</h2>
    <table width="200">
    <tr spry:repeat="dsJobCategories">
    <td spry:if="{jobcount} == 0" class="disabled"
    spry:setrow="dsJobCategories">{name}</td>
    <td spry:if="{jobcount} &gt; 0" spry:select="select"
    spry:hover="hover" spry:selectgroup="jobs"
    spry:setrow="dsJobCategories">{name}</td>
    </tr>
    </table>
    </span>
    </div>
    <div id="Job_List_DIV">
    <span spry:region="dsJobList">
    <h2 spry:if="{ds_RowCount} == 0"> </h2>
    <p spry:if="{ds_RowCount} == 0">Please choose a
    category at the left. Categories with no jobs are greyed
    out.</p>
    <span spry:if="{ds_RowCount} != 0">
    <h2>Job List:</h2>
    <table width="200">
    <tr spry:repeat="dsJobList">
    <td spry:select="select" spry:hover="hover"
    spry:selectgroup="jobs"
    spry:setrow="dsJobList">{title}</td>
    </tr>
    </table>
    </span>
    </span>
    </div>
    <div id="Jobs_Detail_DIV" spry:detailregion="dsJobList"
    spry:if="{ds_RowCount} &gt; 0">
    <h2>Job Detail:</h2>
    <p><b>title:</b> {title}<br />
    <b>description:</b> {description}<br />
    <b>facility:</b> {facility}<br />
    <b>referencenumber:</b> {referencenumber}
    </div>

    Originally posted by: daniel.rohe.stud.tu-ilmenau.de
    ven schrieb:
    > Hi,
    >
    > I am using a multipage editor with a master details block. The master
    > block has a table viewer. I am trying to select the first item in the
    > table programmatically and fire the event associated with the selection.
    > TEven though i select the item in the table using setSelection() on the
    > table viewer, the details block doesn't show up. It shows up when
    > explicitly clicked upon. Does anybody know any solution to this problem.
    > I want the details black to be shown as soon as the editor is loaded and
    > the user swtiches to this page.
    > thanks,
    > ven
    >
    In your master part use managedForm.selectionChanged(this,
    viewer.getSelection()) to notify other parts in the managed form that
    the selection has changed.
    Kind regards,
    Daniel

  • Prompt not displayed in first item of loop

    Hello,
    I use a cursor to access some info of fields I fill with a dynamic select, in the cursor I get the field_name (for the select) and the prompt I need to show on the item.
    When I loop through the loop for the first time to place the prompts on the fields, the first prompt isn't shown, when I perform the same action to do it again, it works fine. It's just the first time and the first item it doesn't do it properly on.
    I use a basic cursor-for-loop and the set_item_property to place the prompts, when I place a piece of code, any peice of code that jsut does something, in the loop before the set_item_property it does everything right from the first time...
    Any one have any idea on how I can solve this without having useless messages or something pop-up?

    oh, I forgot to mention, I use Designer 6i

  • Always first item from the punchout catalog will get missed in SRM cart

    Hi All,
    Recently we have configured the vendor punch-out catalog in our SRM system. We are able to get in to their catalog and able to select the items. However we have observed the following.
    1) When we select 3 items from the list we get only 2 items in to our cart.
    2) When we select 4 items we get only 3 items to our cart
    It is noted that always the first item selected will be missing when comes to SRM shopping cart.
    We have debugged the Badi BBP_CATALOG_TRANSFER and observed in that only 2 items are entering in to SRM server in the first case and 3 items are entering in to SRM server in the second case.
    One more thing observed that when we select only one item in the catalog, that comes to our shopping cart without any issues.
    Can any body help me in this, is this issue with vendor side or can there be an issue at our SRM server.
    Thnaks
    psamp1

    I take it that you checked the CATALLOG_CONTENT table? Does the table CATALOG_CONTENT_ERRORS have any errors posted?
    Checking if the error is at the vendor site:
    Check the source code of the vendor just before the shopping cart is returned to SRM. Sometimes it's easy, just right-click in your browser and click 'show source'. This opens the source html of the page. Search for "NEW_ITEM" and see if all products are there.
    The difficult thing is that sometimes the vendor catalog uses a self-posting form. Timing is important then. Right after you click press the escape key, this stops your browser from continuing. Now do the above again.
    Things you can bump into: you're too quick, there is no form with the NEW_ITEM lines. You're too slow: you're back in SRM already. So if it doesn't work at the first try, try again.
    Check all the NEW_ITEM lines and see if the first item is missing there.

  • Get the first item value of previous record in a multi record block

    Hai,
    I have a multi record block with four items.I should get the first item value of the previous record so that I can increment its value in the current record.
    Thanks.........

    If you want a distinct value in each row or to be able to retrieve the records in the same order they were written then you should use a sequence.
    If you want to retrieve the records in the same order they were created in the block then you will need a diffferent solution to the one you outline here since a user could enter a new record between two others.
    I posted this a while back in response to someone who was using a sort_key item and resetting it for each row when a new record was inserted:
    If you make the sort_key bigger then you have much more room to insert new rows in between existing rows without having to reset all the sort_keys.
    Eg. you have rows with sort_keys of 129282000000000000 and 129283000000000000 (you can have more zeros if you want) and you want to insert a row in between. if you're using oracle forms then the user would have to click on the first of these rows and then do 'insert'. in your insert process you would store the sort keys of the current record and the one below, create a blank record in between and set the sort_key of that record to the average of the other two. you will be able to insert many new rows in between the original 2 before running out of space in the sort_key field.
    the method above is not sufficient, there are some other cases to consider:
    1) when the user is on the last record of the block then you will just create a new record with sort_key set to a greater number than the row before. you can have the sort_key defined as number(38) and to safely allow you to enter 1000 rows each new row would normally be 10E33 greater than the previous one.
    2) when the user is entering the first record then just set the sort_key to 10E33.
    3) on the off-chance that you do insert a great number of records and cannot insert another in between then you would need to alert the user, process the records so that the sort_keys are evenly spaced and requery the block. this processing could be scheduled nightly to make this eventuality even less likely.
    4) make sure the user cannot run the default 'clear_record' procedure. this would break my method as well as yours!
    James.

  • Update ComboBox model / change items

    Hi, ive hit a wall here can someone give me a leg up?
    I have two JComboBoxes
    I want selections in the first to change the items in the second.
    i.e
    I want to register the firsts ItemListener to change the seconds ComboBoxModel
    im trying to use
    myCombo2.setModel( X )
    is there anyway to convert an String[] to a ComboBoxModel so i can fit it in X?
    I origionally drew my ComboBoxes by passing String[] arrays to the constructors.
    If i make a new ComboBox when the items change i have to re add it to the panel and draw the whole frame again, is that right?
    thanks all
    :)

    Thanks for the guidance!
    It seems understanding the API docs is really usefull... DUH
    well im getting better
    in the end i solved this by
    class whatever(){
    private DefaultComboBoxModel model;
    private void createProdTypeCombo()
    model = new DefaultComboBoxModel();
    prodTypeCombo.setModel(model);
    private void createProductCombo()
    productCombo = new JComboBox((events.doQuery(
         "SELECT item FROM Products Group By item ", 1)).toArray(new String[0]));
    productCombo.addActionListener(
    new ActionListener()
    @Override
         public void actionPerformed(ActionEvent e) {
         //updates the model for the second combo box
         prodTypeCombo.removeAllItems();
         ArrayList<String> results = new ArrayList<String>();
         String selectedItem = (String)productCombo.getSelectedItem();
         results = events.doQuery("SELECT type FROM Products where " +
              "item= '" + selectedItem + "' group by type", 1);
         Object[] resultsOK = results.toArray();
         or (int i=0; i<results.size(); i++ )
              model.addElement(resultsOK);
    Thanks all!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Grid without first row

    Hi,
    Is it possible to do a grid without first row? The row that contains de titles. If it is possible, how?
    Thanks
    Carles

    You cannot hide the first row, but you can hide the text in these rows with
    oGrid.Columns.Item(1).TitleObject.Caption = ""

  • I have a question regarding my txt/alert tones. I recently updated my iPhone 5's software without first backing it up on iCloud or my computer (oops). After my phone finished updating, i lost the new ringtones and txt/alert tones i had bought.

    I have a question regarding my txt/alert tones. I recently updated my iPhone 5's software without first backing it up on iCloud or my computer (oops). After my phone finished updating, i lost the new ringtones and txt/alert tones i had bought. I connected my iPhone to my computer and sync'd it hoping that it could download my purchases from the itunes store and then put them back on to my phone but no such luck. When i look at my iphone on my computer and look at tones, they do not show up at all. However, if i click on the "On This iPhone" tab and click on "Tones" the deleted ringtones and altert tones show up...they are just grey'd out and have a dotted circle to the left of them. I also tried to go to the iTunes store on my phone and redownload them and it tells me that i have already purchased this ringtone and asks me if i want to buy it again. I press Cancel. I know when i do that with music it would usually let me redownload the song without buying it again but it wont let me with the ringtones...so how do i get them back? any help would be greatly appreicated

    Greetings,
    I've never seen this issue, and I handle many iPads, of all versions. WiFi issues are generally local to the WiFi router - they are not all of the same quality, range, immunity to interference, etc. You have distance, building construction, and the biggie - interference.
    At home, I use Apple routers, and have no issues with any of my WiFi enabled devices, computers, mobile devices, etc - even the lowly PeeCees. I have locations where I have Juniper Networks, as well as Aruba, and a few Netgears - all of them work as they should.
    The cheaper routers, Linksys, D-Link, Seimens home units, and many other no name devices have caused issues of various kinds, and even connectivity.
    I have no idea what Starbucks uses, but I always have a good connection, and I go there nearly every morning and get some work done, as well as play.
    You could try changing channels, 2.4 to 5 Gigs, changing locations of the router. I have had to do all of these at one time or another over the many years that I have been a Network Engineer.
    Good Luck - Cheers,
    M.

  • I created an Apple ID for my daughter with her own gmail address, but I want her Apple ID and primary email address to be an iCloud email address. How can I do this? I can't set up an icould email address for her without first creating an Apple ID?

    I have created an Apple ID for my daughter with her own gmail address as the primary email address, but I want her Apple ID and primary email address to be an iCloud email address. How can I do this? I can't set up an icould email address for her without first creating an Apple ID right?
    I'm not good with computers so please explain in simple way...:)
    I also wonder what the best way is to set up accounts for children in a family. I dont want them to be able to purchase apps etc through the parents accounts, also some things we like to share as a family and others we don't want to share. Is there any good. clear, simple explanation from Apple Support about these issues? Or best to go to Apple store and go to genius bar or one to one advise?
    thanks

    You can set up an iCloud account which makes the iCloud email address you choose the Apple ID and thus the login for it:
    https://discussions.apple.com/message/22283348#22283348
    though I have to say I think it's more sensible if the ID is another address, both for security reasons (so people don't know what the login is) and as a contact address from Apple if the account were to stop working and they needed to contact you. So personally I would to to System Preferences, enter the GMail address which is an ID, and then choose a nerw @icloud.com address.
    If she has her own iCloud account she will need either her own computer or her own user account on your Mac to be able to make use of it. You should note that under Apple's terms of use Apple IDs are only available to children of 13 and over.
    As to purchasing apps, this is nothing to do with iCloud: it's iTunes, and the login can be different. So you can all sign into the same iTunes account but have different iCloud accounts. Or she can have her own iTunes account if she is of suitable age (credit card needed for purchasing apps).
    If you have other children you should be aware that any one Mac or device can create only three iCloud accounts - this is tied to the serial number, not the user account, and once reached cannot be bypassed. You can of course sign into an iCloud account created on another device.

  • How do I view a message in the reading pane without first having to open the message?

    On my previous e-mail system, I was able to read the text of an incoming message in the reading pane below the selection of incoming messages without first having to open the incoming message about which I was curious. This had the advantage of allowing me to review and delete messages that appeared to be suspicious to me without first opening them and exposing my computer to the danger of an incoming & unwanted virus, etc. I am not able to do this with the new e-mail system and I an unable to find instructions on how to do this with your "Help" inquiry. Does Firefox have this capability? If so, how do I access it?

    Firefox has no email features, it is just a web browser.
    If you are using a web based email service such as Gmail or Hotmail, you will need to contact the support for the email service to see if they offer the feature that you want. Any email features will be part of the web based email service.

Maybe you are looking for