Working With Links

Overview

m-Power applications support the ability to hyperlink applications to other applications, as well as create hyperlinks that go to non-m-Power sites. After highlighting text or clicking on a field substitution in m-Painter, you have the option of inserting a link. While there are many options for inserting links into your applications, this document will cover the Insert/Edit Link window in m-Painter and some of the things that can be done within this window.

The Insert/Edit Link window from m-Painter

When you first click the ‘Link’ button in the m-Painter in the toolbar, the window shown above is what will be displayed.

Depending on the Link Type selected, the options presented in the Insert/Edit Link window will change. Each of the different link types will be explained in-depth.

Under the Link Info tab, Link Type will typically be ‘URL‘, as shown in the above image. This is the default, and it utilized when wanting to creating a hyperlink to an m-Power application or external website. Some of the options within this window will be discussed.

Target Application Type and Application List options are used together to create a link to any application within the current data dictionary.

If you want to link to an application in a different dictionary, please type the application’s link manually into the URL input.

Alternatively, the Smartlinks option can be used instead to automatically link to any Smartlinked application, which will also pull in the correct URL parameters to pass between the two applications.

Note that a Smartlink needs to be initially be created during the application build process, as outlined here. Once a Smartlink is created during the application build process, it can then be edited from the Insert/Edit Link window.

The final input on this tab is the URL input field. The URL value is where the link will redirect to when clicked and can be any valid URL address. This will get populated automatically if an application is chosen from the aforementioned Application Listing or Smartlink dropdowns. Once the link URL is populated in this box, you can then use the associated buttons below this box to add URL parameters to the link.

  • Add Link Parameter – Using this option will allows you to map application fields to pass as parameters in the link URL that’s being created.
  • Add Common Parameter – Allows you to map a common value, such as the a dynamic date (today, yesterday, this week, etc.) as well as system values (such as username and session ID) to another parameter in the target application.

The other button, Remove Existing Link is simply used to remove the entire link completely from the highlighted text/field in m-Painter.

Select the ‘Email‘ as the Link Type option if wanting the created link to open the end user’s default email application to send an email. With ‘Email‘ selected, you may specify the

  • Recipient email address (E-Mail Address)
  • Email subject (Message Subject)
  • Body of the email (Message Body)

Additionally, if the recipient address is in your dataset, you may use the appropriate field substitution from the application in the E-Mail Address input.

This example will use an application field called ‘EMAIL’ which contains the desired recipient email address.

The Return Data option is utilized in very specific use cases, most notably when you are creating a Lookup Window. More on Lookup Windows can be found here.

Target tab

This tab controls the behavior of the link when clicked in terms of where the linked content will open. At first, the Target dropdown is the only option on this tab. However, once a selection is chosen, there may be several other options to further customize the current link’s behavior such as window size, whether there are scrollbars, or even whether the new window will be resizable.

<not set>

This option is the default selection. When selected, it means the link will open always the link in the end user’s current browser tab.

Popup windows allow the linked content to be displayed in a separate window loaded in front of the current screen. This is useful when you have content you would like to display in a separate window, but have too much content for a Hover Popup window or want more control over this window’s look.

Steps for creating a Popup Window:

  1. Highlight the text, icon, or field substitution in m-Painter where you would like your popup window link to appear.
  2. Click the “Link” button in the toolbar or right-click on the text/field and select “Insert/Edit Link”.
  3. Choose the proper application and parameters as defined in the Link Info Tab heading. If this is a Smartlink, simply choose the correct Smartlink from the dropdown. If it is a different application, select the proper application as well as any needed parameters to load the correct record(s) in the popup window.
  4. Navigate to the Target tab and choose “<popup window>”.
  5. Select any necessary features for this popup window such as whether it can be resized, the location of the popup window, the size of the popup window, etc.
  6. Click OK and save.

At runtime, clicking on this link will open a popup window above the current screen with the options you have selected.

Hover Window

There are numerous functions for links with a hovering capability. However, perhaps the greatest use would be drilling down to detail information on one particular record. With the hover window capability, your user can now drill down to detail information without navigating away from the header information. Thanks to AJAX capabilities, your users will have a more streamlined browsing experience, allowing them to access more data on one screen.

  1. Highlight the text or field substitution where you would like your hover link to appear.
  2. Click the “Link” button in the toolbar or right-click on the text/field and select “Insert/Edit Link”.
  3. Choose the proper application and parameters. If this is a Smartlink, simply choose the correct Smartlink from the dropdown. If it is a different application, select the proper application as well as any needed parameters to load the correct record(s) in the hover window.
  4. Navigate to the Target tab and choose “Hover Popup Window” from the dropdown.
  5. Choose the appropriate size for your height and width. Note: If you are unsure what size to choose or require a dynamic size, type “auto” for the width, height, or both.
  6. Click OK and then save your application.

At runtime, hovering over this link will show a window with your content displayed inside.

While there are numerous uses for a popup dialog, the primary function of such a feature is to call a Maintenance application via a popup, write a Record to the Database, and close the popup window. As the developer, you have the option to redirect the original page if desired.

  1. Highlight the text or field substitution where you would like your popup window link to appear.
  2. Click the “Link” button in the toolbar or right-click on the text/field and select “Insert/Edit Link”.
  3. Choose the proper application and parameters. If this is a Smartlink, simply choose the correct Smartlink from the dropdown. If it is a different application, select the proper application as well as any needed parameters to load the correct record(s) in the popup window.
  4. Navigate to the Target tab and choose “Popup Dialog”.
  5. Choose a name if desired, or a width and height.
  6. If the linked application is a maintainer, you will have the option to redirect the original page upon submitting the record. Enter this URL in the input box.
  7. Click OK and save.

At runtime, clicking on this link will open a modal window with this application. This window can be closed or will be redirected upon record submission if desired.

If the application you are linking too is a maintainer, you have the additional option of specifying what the application should do once the user submits the form. Options include:

  • Do Nothing — The dialog window will remain open
  • Close Dialog/Refesh page — The dialog window will close and the underlying page will be refreshed.
  • Do Nothing — The dialog window will be closed but the underlying page will not reload.
  • Redirect Page — Specifying this option will cause the underlying parent page to be redirected to the URL of your choosing.

Advanced Tab

This tab controls the advanced features of the link such as the link’s ID or class, what relationship this link has, what character set to use with this link, etc. This tab fully allows the link to be fine-tuned to behave and look exactly as needed within your applications.

For the average developer, many of these options will be unnecessary when configuring your link. However an important option here to mention is the Protocol dropdown:

Protocol

For linking to m-Power apps, you will want to use Relative. The other options will add the text to the beginning of the URL input box. (i.e. choosing ‘https://’ in the dropdown will cause a create link to ‘www.google.com’ to actually go to ‘https://www.google.com’).

Links that will take the user to an external site (i.e. any link that is not an m-Power application) must be configured with either ‘http://‘ or ‘https://‘ from the Protocol dropdown.

Updated on October 6, 2021

Was this article helpful?

Related Articles

Need Support?
Can’t find the answer you’re looking for? Don’t worry we’re here to help!
Contact Support