The HTML Point can be used in conjunction with the Javascript Point to display HTML markup inside a session. As demonstrated in the Javascript point tutorials , javascript can be used to populate the values for points, including HTML Points. This enables being able to display common HTML elements such as headings, tables, hyperlinks and much more.
This point is dependant on other points to populate its value and therefore does not have many properties to customise in the designer. The Display Size option allows you to customise the display size of the HTML Point which offers sizes of 1 to 20 lines of height. Below is an example of the properties window for a Html point, in the Mobile Data Anywhere Designer.
The following samples demonstrate how the HTML point can be used in conjunction with the Javascript point and Sub Project point to provide advanced functionality to your projects. It is highly recommended that you read through the tutorials for the Javascript point and the Sub Project point before proceeding. To get started, please start by downloading the project files and the javascript files that are used in these samples.
This sample demonstrates several key features of using the HTML point with the Javascript point. On page On page three of the javascript_sample.ppc project, there are three sections which will be discussed below:
The first section contains a javascript point JavascriptPoint1 which updates the html point HtmlPoint1 . The javascript code that was used for this section can be seen in javascript_sample_3_part_1.js . A key feature shown in this sample is the use of URL Schemes to create links that can process actions on installed projects and sessions.
This particular example creates a URL Scheme to delete a project named javascript_sample_blank_project.ppc:
var blankProjectName = 'javascript_sample_blank_project.ppc';
...
var urlToDeleteProject = app_prefix + "://device/delete/project?project=" + blankProjectName;
The second section of this sample demonstrates how the Javascript and Html point can be used to interact with a separate project.In this case the project is a sub project, however it does not need to be a sub project in order for this to work.
The javascript code that was used for this section can be seen in javascript_sample_3_part_2.js . This section demonstrates several more URL Schemes:
This will copy the point values of edit1, edit2 and parent from the open session, into the new duplicated session.
// Link to create a session
var valuesToCopy = encodeURIComponent(JSON.stringify({"edit1":"edit1", "edit2":"edit2", "parent":parentGUID}));
var urlToCreateSession = app_prefix + "://device/new/session?project=" + subProjectName + "&values=" + valuesToCopy;
// Link to Open session
var urlToOpenSession = app_prefix + ":///open/session?project=" + subProjectName + "&session=" + childSession.guid;
// Link to Send session
var encodedJSONForSend = encodeURIComponent(JSON.stringify([{"project":subProjectName, "sessions":[childSession.guid] }]));
var urlToSendSession = app_prefix + ":///send/sessions?sessions=" + encodedJSONForSend;
// Link to Duplicate session
var duplicateJSON = {
"duplicate" : [
{
"project":subProjectName,
"sessions":[childSession.guid],
"values":{"edit1": childSession.values['edit1'], "edit2": childSession.values['edit2'], "parent": parentGUID},
}
]
};
var encodedJSONForDuplicate = encodeURIComponent(JSON.stringify(duplicateJSON));
var urlToDuplicateSession = app_prefix + ":///duplicate/sessions?params=" + encodedJSONForDuplicate;