Announcement Announcement Module
Collapse
No announcement yet.
directly populating a JCombobox with an IBATIS resultmap Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • directly populating a JCombobox with an IBATIS resultmap

    hi,

    this topic is between Ibatis and RCP. but i choose to post it there.

    i'm trying to populate a Jcombobox directly with the result of an Ibatis statment.
    the Jcombobox accept only a vector or an array of objects as argument
    not Map or HashMap.
    on the other side , Ibatis accept only bean or map

    is somebody have an idea ?

    thanks


    David

  • #2
    This is entirely doable. You can create a iBatis based DAO object which returns a List (which is a super-interface of a Collection, which a vector can be initialized with)

    Code:
    public class MyDAOSqlMapClient extends SqlMapClientDaoSupport {
    	List getComboList(final String param) {
    		return getSqlMapClientTemplate().queryForList("mystatement", param);
    	}
    }
    And you initialize the JComboBox like so:

    Code:
    JComboBox combo = new JComboBox(new Vector(dao.getComboList("comboName")));

    Comment


    • #3
      thanks a lot

      Comment

      Working...
      X