开发者

smartgwt remove duplicate values from selectitem

Does anybody know how to hide duplicate values (course names) from SelectItem?

My code:

SelectItem  courseOfferingItem = new SelectItem ("courseOffering.id", "Course Offering");
courseOfferingItem.setOptionDataSource(CoursesOfferingDS.getInstance());
courseOfferingItem.setDisplayField("courseOffering.courseName");
c开发者_StackOverflowourseOfferingItem.setShowDisabled(false);

SelectItem is showing courses CBNST, FIT, FIT, DS but I don't want to show FIT two times.


you must use LinkedHashMap to populate your ComboBox items. it will be easy to set and manage and duplicate values will be removed. it can be done by.... SelectItem courseOfferingItem = new SelectItem(); courseOfferingItem.setValueMap(linedHashMap);

and linkedHashMap will contain your item id and item value...hope it will be useful to you...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜