Combobox ItemLebelGenerator

Please see my .png file and help me out how can i set just team id?

Any expert? thanks in advance
17593873.png
17593876.png
17593879.png
17593882.png
17593885.png

Hi Kamrul

If you don’t set any ItemLabelGenerator, the default will be toString() - in your case Team.toString(), this is why you see Team(teamId=India, playerSet=.......

You can change that to display only the team id with this line:

team1.setItemLabelGenerator(Team::getTeamId);

Kaspar Scherrer:
Hi Kamrul

If you don’t set any ItemLabelGenerator, the default will be toString() - in your case Team.toString(), this is why you see Team(teamId=India, playerSet=.......

You can change that to display only the team id with this line:

team1.setItemLabelGenerator(Team::getTeamId);

Its’s give me an error when i try to binding data.
nb: TeamId is an EnumType

Then you need to further define what value of the Country enum you want to display. Let’s assume your Country enum has the country name in a String called name, with a getter for it called getName():

team1.setItemLabelGenerator(team -> team.getTeamId().getName());