{"action":"created","issue":{"url":"https://api.github.com/repos/sojamo/controlp5/issues/12","labels_url":"https://api.github.com/repos/sojamo/controlp5/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/sojamo/controlp5/issues/12/comments","events_url":"https://api.github.com/repos/sojamo/controlp5/issues/12/events","html_url":"https://github.com/sojamo/controlp5/issues/12","id":97886706,"number":12,"title":"Save/Load properties of ScrollableList - Bug","user":{"login":"b3nson","id":1008399,"avatar_url":"https://avatars.githubusercontent.com/u/1008399?v=3","gravatar_id":"","url":"https://api.github.com/users/b3nson","html_url":"https://github.com/b3nson","followers_url":"https://api.github.com/users/b3nson/followers","following_url":"https://api.github.com/users/b3nson/following{/other_user}","gists_url":"https://api.github.com/users/b3nson/gists{/gist_id}","starred_url":"https://api.github.com/users/b3nson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/b3nson/subscriptions","organizations_url":"https://api.github.com/users/b3nson/orgs","repos_url":"https://api.github.com/users/b3nson/repos","events_url":"https://api.github.com/users/b3nson/events{/privacy}","received_events_url":"https://api.github.com/users/b3nson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-29T08:37:02Z","updated_at":"2015-07-30T09:15:02Z","closed_at":null,"body":"Trying to save and load properties of a ScrollableList results in \"java.lang.NoSuchMethodException\" (caught ones = no program-termination)\r\n\r\n**Saving** ScrollableList-Properties (to json) actually works, but following debug-message appears:\r\n```java\r\nSEVERE: java.lang.NoSuchMethodException: controlP5.ScrollableList.getListBoxItems()\r\n```\r\n**Loading** back this property won`t either set the (internal) value of the ScrollableList, nor change the corresponding item visually. Following debug-message appears:\r\n```java\r\njava.lang.NoSuchMethodException: controlP5.ScrollableList.setValue(float)\r\n```\r\n\r\n#### Code Example\r\nPress <kbd>1</kbd> to print current value, <kbd>2</kbd> to save properties, <kbd>3</kbd> to load back saved properties.\r\n```java\r\nimport controlP5.*;\r\nimport java.util.*;\r\n\r\nControlP5 cp5;\r\n\r\nvoid setup() {\r\n  size(400, 400);\r\n  cp5 = new ControlP5(this);\r\n  List l = Arrays.asList(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\");\r\n\r\n  cp5.addScrollableList(\"dropdown\")\r\n     .setPosition(100, 100)\r\n     .setSize(200, 100)\r\n     .setBarHeight(20)\r\n     .setItemHeight(20)\r\n     .addItems(l)\r\n     .setType(ScrollableList.LIST) // or DROPDOWN\r\n     ;\r\n}\r\n\r\nvoid draw() {\r\n  background(240);\r\n}\r\n\r\nvoid keyPressed() {\r\n  switch(key) {\r\n    case('1'):\r\n        println(\"currentValue: \" +cp5.get(ScrollableList.class, \"dropdown\").getValue());\r\n    break;\r\n    case('2'):\r\n        cp5.saveProperties(\"hello.json\");\r\n    break;\r\n    case('3'):\r\n        cp5.loadProperties(\"hello.json\");\r\n    break;\r\n  }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/sojamo/controlp5/issues/comments/126236583","html_url":"https://github.com/sojamo/controlp5/issues/12#issuecomment-126236583","issue_url":"https://api.github.com/repos/sojamo/controlp5/issues/12","id":126236583,"user":{"login":"b3nson","id":1008399,"avatar_url":"https://avatars.githubusercontent.com/u/1008399?v=3","gravatar_id":"","url":"https://api.github.com/users/b3nson","html_url":"https://github.com/b3nson","followers_url":"https://api.github.com/users/b3nson/followers","following_url":"https://api.github.com/users/b3nson/following{/other_user}","gists_url":"https://api.github.com/users/b3nson/gists{/gist_id}","starred_url":"https://api.github.com/users/b3nson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/b3nson/subscriptions","organizations_url":"https://api.github.com/users/b3nson/orgs","repos_url":"https://api.github.com/users/b3nson/repos","events_url":"https://api.github.com/users/b3nson/events{/privacy}","received_events_url":"https://api.github.com/users/b3nson/received_events","type":"User","site_admin":false},"created_at":"2015-07-30T09:15:02Z","updated_at":"2015-07-30T09:15:02Z","body":"Hey Andreas,\r\nthanks for the quick update!\r\nBut the issue is not yet fixed completely...\r\n\r\n**Loading** from saved Properties **works**, but saving results in an empty entry (\"{}\") in the JSON-File.\r\nI think the following should fix the issue:\r\n\r\n[ControlP5Legacy.java | Line 297](http://github.com/sojamo/controlp5/blob/master/src/controlP5/ControlP5Legacy.java#L297)\r\n```diff\r\n- myController.registerProperty( \"items\" ).registerProperty( \"value\" );\r\n+ myController.registerProperty( \"value\" );\r\n```\r\n\r\nThanks for your efforts,\r\nbest,\r\nbenjamin.\r\n\r\n"}}