Menu

SetSelectedIndex() for ComboBoxControl

Help
Swing007
2007-08-09
2012-12-13
  • Swing007

    Swing007 - 2007-08-09

    Hi,

       I have a very basic question here.
      
       How do I select any random index in ComboBoxControl? The setSelectedIndex(int index) method of JComboBox seems to be missing from ComboBoxControl class. I tried hunting in Domain class if it was possible to do it but could not get any hint.

       Please let me know how this can be done.

    Cheers

     
    • H4NZ0

      H4NZ0 - 2007-08-13

      there is getComboBox method in comboboxcontrol. you can call getComboBox().setSelectedIndex()

       
    • mcarniel

      mcarniel - 2007-08-20

      There is a reason why setSelectedIndex is absent: the ComboBoxControl does not contain a simple list of items,
      it contains a list of couples <code,item description> and the better way to set in the combo a specific item description is to set the related code. The order of codes in list could be changed in the time, so referring an item description by index is not the better way: use ComboBoxControl.setValue(...) method to specify the code to use to select an item!

      Anyway, you could use getComboBox() method to access the embedded combo box, as suggested above...

       
    • Swing007

      Swing007 - 2007-08-23

      This seems to sovle my problem.

      Thanks & Cheers

       

Log in to post a comment.