0

how to get selected item ?

asked 2015-01-30 09:43:19 +0800

jwasky gravatar image jwasky
11 3

updated 2015-01-30 09:49:20 +0800

chillworld gravatar image chillworld flag of Belgium
5357 4 9
https://github.com/chillw...

i want to make condition :

if(combobox...=="HARIAN TETAP"){

}

how to write these conditions if I choose one of the contents of the combobox? I have made the contents of a combobox with this code

List lst_combo = null;
ViewKaryawan2Manager _vKar = ServiceLocatorViewKaryawan2.getRefrensiManager();
lst_combo = _vKar.getViewByQuery("WHERE v.nama_jenis LIKE '" + "Harian" + "%'AND v.blacklist =" + 0 + "AND v.is_aktif=" + 1 + " GROUP BY nama_jenis");
for (Iterator it = lst_combo.iterator(); it.hasNext();) {
    ViewKaryawan2 select2 = (ViewKaryawan2) it.next();
    cmb_tipe_karyawan_proses.appendItem(select2.getNama_jenis()).setContext(String.valueOf((select2.getNama_jenis())));
}
cmb_tipe_karyawan_proses.appendItem("semua");
delete flag offensive retag edit

Comments

and what do you want to do with your condition? be more exhaustive

Alecs ( 2015-01-30 10:41:30 +0800 )edit

3 Answers

Sort by ยป oldest newest most voted
0

answered 2015-01-30 13:25:38 +0800

cyiannoulis gravatar image cyiannoulis
1201 10

Looking your code i assume you are using MVC so somthing like this should do the trick:

cmb_tipe_karyawan_proses.getSelectedItem()

or

cmb_tipe_karyawan_proses.getSelectedIndex()

Costas

link publish delete flag offensive edit
0

answered 2015-02-01 11:30:59 +0800

Darksu gravatar image Darksu
1991 1 4

Hello jwasky,

Please refer to the following url:

http://books.zkoss.org/wiki/ZKDeveloper'sReference/MVVM/DataBinding/Collectionand_Selection

Specifically check out the section: Selection in Collection

Best Regards,

Darksu

link publish delete flag offensive edit
0

answered 2015-02-02 12:54:20 +0800

kanse gravatar image kanse
1
http://www.jakoszczedzac....

thanks for help :)

link publish delete flag offensive edit

Comments

don't forget to accept the answer as correct if some answer lead you to the solution.

chillworld ( 2015-02-02 13:12:02 +0800 )edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2015-01-30 09:43:19 +0800

Seen: 29 times

Last updated: Feb 02 '15

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More