The following sections describe application types, binding attributes of applications, and WebApp application methods.
Defining the application type instructs JIA how to handle new pages and how to automatically assign the pages to the correct WebApp instance. The following application types can be defined:
•Single Tab Application: Operates within a single tab without spawning new physical windows outside the tab scope. When an application is defined as Single Tab, each tab that is opened with a page of the application is treated as another instance of the WebApp.
•Multi Tab Application: Comprises several pages in separate tabs. When an application is defined as Multi Tab, any new page defined for the application is assigned to the same instance of the WebApp (unless a matcher is defined). Similarly, if the same page of a Multi Tab application is open in two different tabs, only one instance of the application is retrieved by the FindApplication method.
A WebAppMatcher is a function that controls assignment of a WebPage instance to a WebApp instance. The matcher code is executed for every new page created, and returns a specific matcher identifier. When two matcher executions for two pages return the same identifier, the pages belong to the same WebApp instance.
You can define several matchers for a WebApp. When a matcher cannot identify the WebApp instance, it returns null and another matcher will execute until one of the matchers returns a value. If no matcher returns an identifier, the page is assigned to the default WebApp instance.
Note: The Single Tab application is the default type. Unless an application is designed to be displayed in multiple tabs, it is recommended to use the Single Tab type. |
The application type configuration (Single tab or Multi tab) is set in the Repository.
Binding attributes of a web application are listed and described in the following table.
Attribute Name |
Description |
Required |
Default Value |
---|---|---|---|
ProgId |
Type of application generated |
Yes |
|
Type |
SingleTab or MultiTab |
No |
SingleTab |
For example:
<WebApplication ProgId="SalesForce" Type="Single"> |
WebApp members are listed and described in the following table.
Member Name |
Type |
Description |
Default Value |
---|---|---|---|
CurrentPage |
WebPage |
A reference to the main page of the application. The value is set to the first page opened by the application. If the CurrentPage is closed, another page will be set as current. |
|
Exists |
Boolean |
Indicates whether the application instance exists on the desktop (i.e., at least one page of the application is available). |
|
WebApp methods are listed and described in the following table.
Method |
Description |
Parameters |
---|---|---|
Navigate |
Navigates a page of the application to a new URL. The method returns after changing the URL. There is no indication whether the new page is available. |
•String URL: The URL to navigate to. •WebPage Page: The page of the application that should perform the navigation (must be an existing page). The default value is CurrentPage. |
static AddWebAppMatcher |
A static method to add a matcher to the WebApp. This matcher will run the delegate function and pass it the WebPage created. The matcher function should return a string identifier. If the identifier cannot be extracted, the functions returns null. |
•Delegate MatcherFunction: A reference to a delegate function that will get the WebPage as an attribute and return a matcher identifier. •Type Web Page Type: The specific web page type for which to use the predicate. |
WebApp events are listed and described in the following table.
Event Name |
Arguments |
Description/Notes |
---|---|---|
PageLoaded |
WebPage Page: The loaded page that triggered the event. |
This event will fire for each new page loaded for the specific application instance. |
PageUnloaded |
WebPage Page: The unloaded page that triggered the event. |
This event will fire for each new page unloading from the specific application instance. Note: When the event fires, a reference to the unloaded page is returned. However, as the page is no longer available, attempting to access components of the page will result in an exception. |
Application |
|
This event will fire when a web application closes. An application is considered closed when a webpage is closed, and no new page within the application is reloaded within a defined period of time. You can adjust this time period by updating the Application Close Event Time value in the JIA configuration settings. |