GenLayoutHTML method: IntBroker class

Syntax

GenLayoutHTML(MAP_layout, URI_index, &doc [, element_ID] [, gen_JSON])

Description

Use this method to generate all or a portion of the HTML for a specified Mobile Application Platform (MAP) application. Use this method when you want to invoke another MAP application as an external page from the calling MAP application

Parameters

Parameter Description

MAP_layout

Specifies the name of the MAP application (layout) as a String.

URI_index

Specifies the URI index as an Integer.

&doc

Specifies the document for the MAP application to be invoked as a Document object.

element_ID

Specifies the ID for a specific element as a String, if only the HTML for that element is to be generated. Valid element types include containers, sidebars, headers, and footers. You can use either the system-generated ID or the developer-defined alternate ID for the element.

gen_JSON

Specifies a Boolean value indicating whether to also return the document data as a JSON string.

Returns

The return data type depends on the gen_JSON parameter:

  • When gen_JSON is False or is omitted, the method returns a String that is the HTML.

  • When gen_JSON is True, the method returns a two-dimensional Array of String:

    • The first element is the HTML.

    • The second element is the document data as a JSON string of attribute-value pairs.

Example

In the following example, the external MAP application is to be called from page 4 of the invoking MAP application. A Document object is created and populated with data from the current MAP application. Then, the GenLayoutHTML method is executed to return the portion of HTML corresponding to a specific container in the invoked MAP application. Finally, this returned HTML is assigned to a primitive that has been associated with an HTML area element in the invoking MAP application.

If &URICOM.GetPropertyByName("PAGE_ID").Value = 4 Then
   &Doc1 = CreateDocument("MAP_LAYOUT", "FLIGHTCARD1_MAP", "v1");
   &COM2 = &Doc1.DocumentElement;
   &COM2.GetPropertyByName("PAGE_ID").Value = "INIT";
   &COM2.GetPropertyByName("LAYOUT_ID").Value = - 1;
   &COM2.GetPropertyByName("Pilot").Value = &URICOM.GetPropertyByName("Pilot").Value;
   &COM2.GetPropertyByName("CardNbr").Value = &URICOM.GetPropertyByName("CardNbr").Value;
   &temp = %IntBroker.GenLayoutHTML("FLIGHTCARD", 2, &Doc1, "mapcont_start_1");
   &COM.GetPropertyByName("prim_text").Value = &temp;
end-if;