Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-11310] Android: Fix parity issues in WebView.html

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2012-11-06T19:19:30.000+0000
Affected Version/sRelease 3.0.0
Fix Version/sRelease 3.0.0, Release 3.1.0
ComponentsAndroid
Labelsapi, parity
ReporterArthur Evans
AssigneeHieu Pham
Created2012-10-09T05:45:42.000+0000
Updated2012-12-10T21:53:48.000+0000

Description

Currently, the WebView.html property is writable on Android, but may not work in some circumstances (such as before the load event is fired). This should work as it does on other platforms. Note: this is documented as an issue in WebView.yml. Any fix should *update* this comment so that it says:
On Android prior to <fixVersion>, directly modifying the html property before the 'load' event has no effect. Use the setHtml method to avoid this limitation.

Comments

  1. Hieu Pham 2012-10-29

    'html' should work fine in Android. I will modify the doc to address this.
  2. Olga Romero 2012-12-10

    Closing per Arthur. The link for references: http://docs.appcelerator.com/titanium/2.1/#!/api/Titanium.UI.WebView-property-html The following info should be displayed: Titanium.UI.WebView html : String HTML content of this web view. On Android, This property is read-only. On other platforms, it is read-write and can be used to set the web view's content. On all platforms the web view's content can be set using the data or url properties. For iOS, see setHtml for additional parameters that can be specified when setting HTML content. For Mobile Web, setting new content will reset the url and the WebView's history. The WebView's "onload" event will have already fired prior to the data being set inside the WebView. When querying this value, mobile web will pass in a formatted version of the html. The tag is stripped of, along with comments outside of the tag. Some default attributes may be added as well. For example, a web page with the code hello returns "hello" in Safari.

JSON Source