Load field into mobile browser control

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
yeldarb
Posts: 43
Joined: Thu Dec 14, 2017 5:39 pm

Load field into mobile browser control

Post by yeldarb » Thu Dec 21, 2017 7:54 pm

Is there any way to load a field's content into a mobile browser control? (short of writing it out as a file and loading that)?

quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm
Location: McKenna, WA

Re: Load field into mobile browser control

Post by quailcreek » Fri Dec 22, 2017 12:22 am

What's in the field and why do you need to load it into a browser?
Tom
MacBook Pro OS Mojave 10.14

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Load field into mobile browser control

Post by Klaus » Fri Dec 22, 2017 12:38 pm

Hi yeldarb,

if you use a browser widget, you can set its "htmltext" property to the htmltext of your field.
No idea if this is supported with "mobilecontrolset..."


Best

Klaus

yeldarb
Posts: 43
Joined: Thu Dec 14, 2017 5:39 pm

Re: Load field into mobile browser control

Post by yeldarb » Fri Dec 22, 2017 2:43 pm

The field contains the raw html, which includes (among other things) a styled bar chart that requires the mobile browser control to render (I tried just the field but it doesn't read and render CSS). If there's a way to render the CSS in a field that might work (though it wouldn't have the nice native "bounce" effect).

yeldarb
Posts: 43
Joined: Thu Dec 14, 2017 5:39 pm

Re: Load field into mobile browser control

Post by yeldarb » Fri Dec 22, 2017 2:58 pm

Wow, great! I wasn't even aware of the browser widget.

So I just tested on iOS, simulator and device, and it looks great but internal hyperlinks don't seem to be working.

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Load field into mobile browser control

Post by Klaus » Fri Dec 22, 2017 3:18 pm

The LC "htmltext" property does unfortunatley not support CSS and only a very limited subset of HTML.

yeldarb
Posts: 43
Joined: Thu Dec 14, 2017 5:39 pm

Re: Load field into mobile browser control

Post by yeldarb » Fri Dec 22, 2017 9:18 pm

Klaus wrote:
Fri Dec 22, 2017 3:18 pm
The LC "htmltext" property does unfortunatley not support CSS and only a very limited subset of HTML.
Using the browser widget and a stylesheet in the html document I'm able to get a nicely styled bar graph:
Screen Shot 2017-12-22 at 3.16.40 PM.png
However, I'm running into two other issues:

1. I get an error "cannot export char U+0000 in nul-terminated string buffer" It doesn't seem to be related to the actual text in the field, I've removed all the text and just used some dummy text.

2. Links to anchors in the page don't work (they work in the mobile widget).

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Load field into mobile browser control

Post by Klaus » Fri Dec 22, 2017 9:37 pm

Maybe I was not clear enough, the internal htmltext property (of fields!) does not support all the good stuff. The browser widget is another beast, of course. :-D

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”