How do you parse variables to the web popup?

With the great release of SDK 1.1, and the new Web Popup, I’m wondering, how do you parse variables to the web popup?

I’m sure the Ansca guys are madly trying to document all the new features!
Cheers,

Marcus [import]uid: 4543 topic_id: 465 reply_id: 300465[/import]

Hi, Marcus. Our idea was to document the WebPopup by example, specifically our Facebook Connect library – but then Facebook turns out to need a lot of added documentation of its own, so that’ll be out ASAP. In the meantime, what are you specifically trying to do with variables and the popup? [import]uid: 3007 topic_id: 465 reply_id: 897[/import]

Hi Evan,

I’m trying to two two things:

  1. Dynamically change content inside a DIV. For example have an app that is the framework for an ebook, and swap out the DIV content as a variable passed by lua.

  2. I’m trying to work with embedded forms within the web popup. The keyboard does not work such forms. Key Presses are not recognised. Any ideas?

Cheers,

Marcus [import]uid: 4543 topic_id: 465 reply_id: 900[/import]

Regarding case (1), currently the only way to pass data TO a WebPopup is in the URL. The idea behind WebPopup is to overlay either external websites or internally-created HTML documents. One thing that might work well in this case is to dynamically rewrite the current “page” each time as a local HTML file, then reload the WebPopup to show the new content. (For an example of loading a local document, see the “Device/WebOverlay” sample project; for an example of local file paths, see “GettingStarted/SimpleImageDownload”.)

If you want communication back FROM the WebPopup into Corona, the usual trick is to make special href links in the web content that you can parse as events (by parsing event.url). For example, on a successful login to Facebook, the server can be made to call the URL “fbconnect://success”, which is not a real URL – it’s a signal that the WebPopup should be closed and other events should happen on the Corona side (the Facebook project will make this clearer).

Regarding (2), web forms should work; for example, we have keyboard entry working here on Facebook’s login form. Is this a form you made manually, or a form on a public site somewhere? [import]uid: 3007 topic_id: 465 reply_id: 903[/import]

Thanks Evan, that has given me some usable ideas :wink:

Keep up the great work!

Cheers,

Marcus [import]uid: 4543 topic_id: 465 reply_id: 930[/import]