Controls: WEBVIEW

WEBVIEW control is used to display any html content within the app.

HTML data source can be either of the following attributes

Essential attributes

  • type=”WEBVIEW”
  • javascript=”true” or “false”. javascript=”true” enables javascript in HTML code (recommended for remote data source).

Note

  • The screen with WEBVIEW control should have scroll=”NONE”. WEBVIEW has its own scroll bar.
  • appearance is based on html not on appearance_name.

HTML data sources

default_value

Example: HTML data source - default_value attribute

<screen name="webview_defaultvalue" menuOrder="0" menuName="Static" tab_group_name="tabgroup1" width="100" height="100"  >
     <controls>
             <control type="WEBVIEW" x="0" y="0" width="100" height="100"  appearance_name="black"
                     default_value="&lt;html>&lt;body>&lt;font style=&apos;text-align:center;&apos;>Static webview coming from default_value attribute&lt;/font>&lt;/body>&lt;/html>"/>
     </controls>
</screen>
../_images/webview_default_small.png

local_data_source

Example: HTML data source - local_data_source attribute

<screen name="webview_local" menuOrder="2" menuName="Local" tab_group_name="tabgroup1" width="100" height="100"  >
     <controls>
             <control type="WEBVIEW" x="0" y="0" width="100" height="100"  appearance_name="black" field_name="content"
                     local_data_source="select id as _id, content from webviewcontent where id=1"/>
     </controls>
</screen>

Data table webviewcontent was created for this example in project/assets/appemble-content.sqlite in Android, OR project/Resources/assets/appemble-content.sqlite in iOS and one row of data created.

CREATE TABLE [webviewcontent] (
       [id] INT,
       [content] VARCHAR);
../_images/webview_local_small.png

remote_data_source

Example: HTML data source - remote_data_source attribute

<screen name="webview_remote" menuOrder="3" menuName="Remote" tab_group_name="tabgroup1" width="100" height="100" >
     <controls>
             <control type="WEBVIEW" x="0" y="0" width="100" height="100"  appearance_name="black"
                     remote_data_source="http://www.appemble.com/"
                     remote_request_type="GET" javascript="true"/>
     </controls>
</screen>
../_images/webview_remote_small.png