Web Pop Up Additional Features

webpopup:getUrl() - Returns the current URL displayed by browser

webpopup:setUrl( urlString ) - Sets the current URL displayed by browser

webpopup:timeOut( seconds ) - Number of seconds before the browser assumes a timeout

onComplete Event - Calls a handler when loading is complete

onError Event - Calls a handler with HTTP error code if loading failed, or timeout occurs

[import]uid: 11393 topic_id: 5562 reply_id: 305562[/import]

I’d also like to add:

Hide Activity Param - Hide the activity indicator when loading (for example when loading local files).

Scroll Lock Param - Lock the webpopup into a fixed position so it can’t be scrolled vertically/horizontally. [import]uid: 11393 topic_id: 5562 reply_id: 18954[/import]

+1 Currently working on an app with many local html-content and webviews [import]uid: 12870 topic_id: 5562 reply_id: 18987[/import]

bedhouin: add this javascript to your local file

[javascript]
document.documentElement.addEventListener(‘touchmove’,function(e) {e.preventDefault();});
[/javascript]

It will prevent you from being able to scroll. And if you need a small portion of the screen to scroll, use iScroll:
http://cubiq.org/iscroll

But definitely +1000 for hide activity param! [import]uid: 10942 topic_id: 5562 reply_id: 20724[/import]

@building429: Thanks! Nice tip. [import]uid: 11393 topic_id: 5562 reply_id: 20733[/import]

No problem! I like to use local html-content in my apps, so I’ve had to learn a lot of little tricks like that to try and make everything appear as native as possible (otherwise people just make fun of you for using web programming instead of mobile app programming, lol). [import]uid: 10942 topic_id: 5562 reply_id: 20735[/import]

+1 for setURL, especially if we can call setURL(“javascript:doSomething()”)

also ability to communicate back with corona other than form action.

eg window.location = “corona:doSomething()” or similar

[import]uid: 6645 topic_id: 5562 reply_id: 20756[/import]

Since Web Pop Ups are the best (and only) reliable method of presenting formatted content, these features would be a great addition Ansca. Thank you for giving us the native control, but now we need to do more with it… [import]uid: 11393 topic_id: 5562 reply_id: 20765[/import]

+1000 [import]uid: 9158 topic_id: 5562 reply_id: 21029[/import]

+1 So there is for now no way to tell something from Webpop to Lua script? Only click events?
[import]uid: 29594 topic_id: 5562 reply_id: 26131[/import]

This works great as long as you don’t have a text area in the HTML.
Any idea how to make the text area play well here, as well? [import]uid: 11046 topic_id: 5562 reply_id: 29168[/import]

I’ve actually just come across the same problem and am still trying to figure out a solution. I’ll keep trying to figure it out and if I do, I’ll post the answer on here. [import]uid: 10942 topic_id: 5562 reply_id: 29170[/import]

my bad. you can talk from web popup to corona, (just not the other way round once the popup is open)

eg
[lua]function listener(event)
local shoudLoad=true

if event.errorMessage == nil then
if(event.url==“corona:closeOrWhateverYouLike”) then
shouldLoad=false – this closes the browser
elseif(event.url==“corona:loadedOrWhateverYouLike”) then
myText.text=“web page loaded”
end if
end if
return shoudLoad
end[/lua]

then html:
[html]

Close the window
[/html] [import]uid: 6645 topic_id: 5562 reply_id: 30052[/import]

Hm…
Couldn’t it be done with HTML5 socket connections, so your web-popup is talking to a socket connection that was opened in Lua?
Or what about starting a http daemon in Lua and you are polling with JavaScript from within your web popup?

more info here:
http://ezinearticles.com/?HTML5-Web-Sockets-Example
Example (works on iPad / iPhone): http://html5demos.com/web-socket
[import]uid: 5893 topic_id: 5562 reply_id: 30497[/import]