on 12-24-2014 2:30 PM
Hi folks,
I am trying to bind the HTML component content attribute with data returned from an OData service. I made sure that the OData service returns url encoded content. This fails however whatever I return ...
I changed it even into returning a fixed value:
Lorem ipsum dolor sit amet...
When I define my XML view like this:
<core:HTML id="dvm" content="{ValueMappingError/ContentValue}" preferDOM="false"></core:HTML>
I am getting the following exception thrown ( with our without any of the above extra attributes )
Uncaught Error: Syntax error, unrecognized expression: <div class="content"><h4>Lorem ipsum</h4><div>Lorem ipsum dolor sit amet...</a></div>
sap.ui.core.HTML.onAfterRendering | HTML.js:6 |
When I use the same content and add it as a fixed value in my XML view then this works fine .. and the control is rendered without any issues.
<core:HTML content='<div class="content"><h4>Lorem ipsum</h4><div>Lorem ipsum dolor sit amet...</a></div>'></core:HTML>
There is clearly something going wrong in the event 'onAfterRendering' which makes me kinda believe that the actual content rendering worked ... but somehow it still breaks ...
I am using version 1.22
Any ideas ?
Kind Regards,
Steven
Bump ...
Anyone any suggestions ?
Thanks,
Steven
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sakthivel,
Thanks it works now ... not sure why I started encoding the content ...
My content is actually an HTML document on its own ... so including tags and everything ... ( thus not just simply a bit of text as in the example ).
I thought I initially tried it without encoding and having an issue at that time as well ... anyways ... solved
Kind Regards,
Steven
Just a hint: I tried to output simple HTML like "123<br>1234" and got the same error as mentioned above, after adding a DIV-tag around it, it works like a charm
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.