{"action":"created","issue":{"url":"https://api.github.com/repos/bonprix/vaadin-combobox-multiselect/issues/17","repository_url":"https://api.github.com/repos/bonprix/vaadin-combobox-multiselect","labels_url":"https://api.github.com/repos/bonprix/vaadin-combobox-multiselect/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/bonprix/vaadin-combobox-multiselect/issues/17/comments","events_url":"https://api.github.com/repos/bonprix/vaadin-combobox-multiselect/issues/17/events","html_url":"https://github.com/bonprix/vaadin-combobox-multiselect/issues/17","id":171014022,"number":17,"title":"Problem with caption","user":{"login":"MajewskiKrzysztof","id":17272805,"avatar_url":"https://avatars.githubusercontent.com/u/17272805?v=3","gravatar_id":"","url":"https://api.github.com/users/MajewskiKrzysztof","html_url":"https://github.com/MajewskiKrzysztof","followers_url":"https://api.github.com/users/MajewskiKrzysztof/followers","following_url":"https://api.github.com/users/MajewskiKrzysztof/following{/other_user}","gists_url":"https://api.github.com/users/MajewskiKrzysztof/gists{/gist_id}","starred_url":"https://api.github.com/users/MajewskiKrzysztof/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MajewskiKrzysztof/subscriptions","organizations_url":"https://api.github.com/users/MajewskiKrzysztof/orgs","repos_url":"https://api.github.com/users/MajewskiKrzysztof/repos","events_url":"https://api.github.com/users/MajewskiKrzysztof/events{/privacy}","received_events_url":"https://api.github.com/users/MajewskiKrzysztof/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-08-13T15:38:36Z","updated_at":"2016-08-13T17:22:19Z","closed_at":null,"body":"Hello,\r\nI am using your comopnent as a filter in a grid column\r\n\r\n```\r\nfinal ComboBoxMultiselect selectionBox = new ComboBoxMultiselect(new ComboBoxMultiselectCaptions(\"nothing selected\", \"multiple selection\"));\r\nselectionBox.setClearButtonCaption(\"clear\");\r\nselectionBox.addItems(currencyCodes);\r\nselectionBox.select(currencyCodes);\r\nselectionBox.setWidth(100, Sizeable.Unit.PIXELS);\r\n\r\nGrid.HeaderCell statusHeaderCell = mainGrid.getHeaderRow(1).getCell(COLUMN_3);\r\nstatusHeaderCell.setComponent(selectionBox);\r\n```\r\nI've added a blur listener to filter my grid:\r\n\r\n```\r\nselectionBox.addBlurListener(new FieldEvents.BlurListener() {\r\n    @Override\r\n    public void blur(FieldEvents.BlurEvent event) {\r\n          filterMyGrid(myGrid, (Set) selectionBox.getValue());\r\n});\r\n\r\n```\r\nThe problem is when I select multiple items caption doesn't change to \"multiple selections\". Instead it looks like that: \"(count) item1, item2, item3, ...\"\r\n![combomultibadcaption](https://cloud.githubusercontent.com/assets/17272805/17643983/d1d82c1a-617a-11e6-904e-f4aa3918ea08.png)\r\n\r\nI've managed to change it by adding setInputPrompt() in blur listener:\r\n\r\n```\r\npublic void blur(FieldEvents.BlurEvent event) {\r\n        if (((Set) selectionBox.getValue()).size() == 0)\r\n            selectionBox.setInputPrompt(\"nothing selected\");\r\n        else if (((Set) selectionBox.getValue()).size() > 1)\r\n            selectionBox.setInputPrompt(\"multiple selection\");\r\n        else\r\n            selectionBox.setInputPrompt(selectionBox.getCaption());\r\n\r\n       filterMyGrid(myGrid, (Set) selectionBox.getValue());\r\n}\r\n```\r\n\r\nAlthough it doesn't work 100% right. After the component loses focus caption still displays as \"(count) item1, item2, item3, ...\" and changes to correct one after the grid is refreshed.\r\n\r\nI've also noticed that when I put a breakpoint in my blurlistener and click somewhere else in my app the caption changes to \"(count) item1, item2, item3, ...\", so it it works like a focus listener. \r\n\r\nI've looked everywhere in your code and I don't think that your component makes that problem. Do you have any idea what is causing this?\r\n"},"comment":{"url":"https://api.github.com/repos/bonprix/vaadin-combobox-multiselect/issues/comments/239631920","html_url":"https://github.com/bonprix/vaadin-combobox-multiselect/issues/17#issuecomment-239631920","issue_url":"https://api.github.com/repos/bonprix/vaadin-combobox-multiselect/issues/17","id":239631920,"user":{"login":"thorbenvh8","id":5954736,"avatar_url":"https://avatars.githubusercontent.com/u/5954736?v=3","gravatar_id":"","url":"https://api.github.com/users/thorbenvh8","html_url":"https://github.com/thorbenvh8","followers_url":"https://api.github.com/users/thorbenvh8/followers","following_url":"https://api.github.com/users/thorbenvh8/following{/other_user}","gists_url":"https://api.github.com/users/thorbenvh8/gists{/gist_id}","starred_url":"https://api.github.com/users/thorbenvh8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thorbenvh8/subscriptions","organizations_url":"https://api.github.com/users/thorbenvh8/orgs","repos_url":"https://api.github.com/users/thorbenvh8/repos","events_url":"https://api.github.com/users/thorbenvh8/events{/privacy}","received_events_url":"https://api.github.com/users/thorbenvh8/received_events","type":"User","site_admin":false},"created_at":"2016-08-13T17:22:19Z","updated_at":"2016-08-13T17:22:19Z","body":"<img width=\"709\" alt=\"screenshot 2016-08-13 19 20 33\" src=\"https://cloud.githubusercontent.com/assets/5954736/17644586/199741c0-618b-11e6-8aa8-e182d498bbc3.png\">\r\ndid you do mvn clean install on the parent project? and did you try closing the widget project and forcing maven to update the dependencies?"}}
{"actor":{"display_login":"thorbenvh8"}}