Setting the Viewport

Setting the viewport for each fluid component ensures that your fluid applications operate properly across all device types, particularly on small form factor devices such as smartphones.

The viewport meta tag in HTML is a crucial element of delivering responsive web applications. Without it, text and other page elements are not rendered at the correct size across all device types. To ensure that your fluid applications are rendered correctly across all device types, you must set the viewport. The recommended methodology is to use the SetDefaultViewport method in the component PostBuild event or the page Activate event:

import PT_PAGE_UTILS:*;
(create PT_PAGE_UTILS:Utils()).SetDefaultViewport();

Note:

You can use the SetCustomViewport method as an alternative to SetDefaultViewport.

Note:

Similar to fluid components, you must also set the viewport for each modal secondary window to ensure that they also operate properly across all device types. See Working with Secondary Pages.