PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → HTML Control - Android - WM19
HTML Control - Android - WM19
Débuté par Piotr J, 20 nov. 2014 17:44 - Aucune réponse
Posté le 20 novembre 2014 - 17:44
Hi,

I've got a really strange problem with an HTML control in Android.

I've got some html/js code that has an accordion effect, basically it reads in some news stories and then displays them, one at a time, in a small window on a browser page, scrolling each news story after a few seconds.

The whole of the web page gets read into a variable using HTTPRequest/HTTPGetResult. No problem there, it works as it should.

My problem is where, if I assign the variable holding the web data to the HTML control, (for example HTM_News=sHtmlString), the web page will display in the HTML control, but the accordion effect doesn't work. I can see the news stories and scroll manually up and down them, but that's it.

HOWEVER, if I take the actual contents of the variable,(by stopping the code in Debug, copying the variable contents), in this case sHtmlString, and manually assign it to the HTML control further on in my code, it works.

For example:

HTM_News=[
<html style="background-color: #171D49;">
<head>
<title>NewsScroller</title>
</head>
<body>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="<a class="ExternalLink" rel="nofollow" target="_blank" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js">http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js</a>"></script>
<script type="text/javascript"
etc, etc, etc,,,,,,,,,,,,,
]

Obviously, I can't do this in my app, I need to load the content dynamically, as the stories can change every 30 minutes. Does anyone have an idea as to why, if the variable contains the correct information, it doesn't work if I assign it to the control? Or alternatively, another way I could 'point' the HTML control to the information in the variable?

I've checked that 'Allow script execution' is set on the HTML control. The strings I am using are UNICODE, but it doesn't matter if I just have them as normal strings.

Some help would be gratefully received !

Many thanks
Piotr