Problem with ComboBox when selected an item

  1. #1

    Problem with ComboBox when selected an item

    Hi team,

    I have some problems with combobox when i'm using this line for example

    #{ddlConexPuertoSalida}.setValue(record.data.SLI_INT_IDPUERTOSALIDA);
    the majority of times appear the description (That's correct) but sometimes appear the code and it results very confused

    Which is the best way for select an item in an combobox?

    Thank You
    Attached Thumbnails Click image for larger version. 

Name:	WRONG.png 
Views:	50 
Size:	18.0 KB 
ID:	24197  
  2. #2
    Hi @rcfabian90,

    My guess would be - your Store loads the data remotely and a .setValue() call sometimes occurs before the Store is loaded. I would try this:
    var comboBox = #{ddlConexPuertoSalida},
        store = comboBox.getStore();
            
    if (store.isLoaded()) {
        comboBox.setValue(record.data.SLI_INT_IDPUERTOSALIDA);
    } else {
        store.on("load", function() {
            comboBox.setValue(record.data.SLI_INT_IDPUERTOSALIDA);
        }, null, { single: true });
    }

Similar Threads

  1. Replies: 17
    Last Post: Dec 17, 2012, 11:58 AM
  2. ComboBox selected item
    By rookie in forum 1.x Help
    Replies: 0
    Last Post: Dec 15, 2012, 5:25 PM
  3. [CLOSED] Always selected Item is nothing for combobox as menu item
    By rnachman in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Sep 04, 2011, 4:51 PM
  4. Replies: 9
    Last Post: May 26, 2009, 12:20 AM
  5. Get ComboBox Selected Item
    By speedstepmem3 in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Nov 18, 2008, 9:50 AM

Posting Permissions