I have a problem where I need your help again.
I get a long String from my java Servlet and split, the String into an Stringarray.
It looks like this:
Stringarray = [2015-09-01][ 2015-09-02][2015-09-03]….
Now I’m trying to create a selection menu, where I can select a date.
Does anyone have a tip on how I could make it.
The details of what you are trying to do are not clear.
I assume you have servlet that is being called from a rule. The data is parsed into an array of Strings and you want to choose between them on your sitemap.
What happens when you select the item on the sitemap?
Regardless, I’m not sure there is an easy way to do this. The closest I could find was using the Selection or Switch elements with a mappings but there is no way to programmatically update the mappings. The best I can come up with is to have your rule edit your sitemap file to add or remove the items from the mappings. OH will automatically reload the file when you change it. Of course, writing the code for this will be tricky and all this reloading of the sitemap may impact performance.
Thank you for your quick response
But maybe it is possible to generate items as much of the size of the Array and transfer the content one by one. Like a fake SELETION.
An Item is just one thing. There is no Array type item so this approach wouldn’t work. You would still have to edit the config files from your rules, in this case by adding or removing Items as opposed to editing the mappings on the sitemap. So its the same problem, just somewhere else.
Perhaps if you described why you want to do this there is some other approach to accomplish the same thing without the array. I find a lot of these sorts of problems can be solved by stepping back and changing the overall approach.