0

I tested Polymer yesterday. Its quite cool, but I wonder how I can read a Map with <template is="dom-repeat" items="{{binding}}">. Is this possible?

I created an ajax-call to a read url where I get a Map<String,List<String>> as response. I want to render the keys as radio-button-group and the value-list-items as members of this radio-button group. Atm I don't know how to archieve this. Does anyone have a hint how I could solve this issue with polymer and iron/paper elements?

Thnx

Alex
  • 21
  • 4
  • I'd recommend you to redesign your Objects. Even though it should be possible to achieve what you want but it will not be dynamically generated. `dom-repeat` requires `key` to be same for all the objects, but in your case you are going to have unique key. So as a result you will have to write each `radio-group` in your HTML rather then depending upon dynamic generation. – a1626 Jul 31 '16 at 07:08
  • I see, then is it possible to create an ajax get-request with given key-parameter and use the ajax-response in a dom-repeat template? If so, I could loop over a "radio-group-keys-array" and call this ajax request and use the response to render the radio-buttons for this group. – Alex Jul 31 '16 at 16:07
  • Not clear on what you are saying, but if you are saying that you'll use your `dom-repeat` over `List` only(doesn't matter what you get from `ajax` request) then yes it is possible. – a1626 Jul 31 '16 at 16:27

0 Answers0