In this section: |
Responsive web design is an approach to webpage creation where content automatically realigns to fit a variety of different window sizes and screen sizes. This allows the content from one HTML file to automatically adapt to multiple footprints such as a desktop, laptop, tablet, or smartphone.
Unlike a generic HTML page, the containers in a responsive page reorder automatically as the screen size changes. Where a generic page shows partial content with a horizontal scroll bar, the responsive page shows full content, re-ordered, with no horizontal scroll bar.
How to: |
The behavior that makes a page responsive is called “folding.” This section details the way responsive containers fold, or re-arrange, as screen size changes. The order in which responsive containers fold is illustrated in the following image.
Figure A illustrates a responsive layout with a row-based 4-2 format, meaning there are four containers on row one and two containers on row two.
Figure A also illustrates the filter row, containing four controls. At run time, the filter row can either be hidden or displayed.
Figure B illustrates the way containers fold responsively when the screen width decreases. The content in each container resizes accordingly, as the screen width changes.
Note: Objects within a responsive container are positioned absolutely. That is, they do not fold. Responsive containers fold in relation to one another, but the objects inside the containers remain fixed.
Objects inside responsive containers can scale to defined limits, as detailed in How to Set Minimum and Maximum Panel Sizes. However, the objects within a container will not fold.
You can control the column/row orientation by which responsive containers re-arrange themselves.
Note: The Flow Direction property does not display for a responsive container that contains an element that is not responsive. For example, a button contained in a responsive panel will disable (hide) the Flow Direction property for the panel. To prevent this, right-click the button and click Add selected to new container from the context menu. Then, when you click the original panel, the Flow Direction property is available again.
There are two ways to create responsive pages in App Studio: using a Responsive Template, and using the HTML Canvas in Responsive Mode. The following diagram shows the high-level decision tree that lets you quickly find the best way to create your responsive page:
Key Characteristics
The Output Widget container, shown in the following image, is the key characteristic of a Responsive Template.
The Output Widget container has the following features:
If you want to create a responsive page with one or more Output Widget containers, the Responsive Template method is the most efficient approach. This method is used only for creating new responsive HTML files. For more information, see Creating Content with a Responsive Template.
This method can also be used to convert an existing HTML file to responsive. For more information, see Creating Content with the Responsive Mode.
There are six pre-defined responsive templates available through the HTML/Document Wizard. These represent the most commonly used page layouts. You can use the layout from a template as-is, or modify the layout further after initiating it with a template.
As an alternative to using a pre-defined template, the HTML/Document Wizard allows you to create a custom page layout at design time. You can specify the number of rows and columns, and whether the page has a row- or column-based orientation. These and other page options are detailed in the following sections.
When you select a responsive template from the HTML/Document Wizard, it generates a responsive layout with the specified number of rows (or columns) and widget containers. The parts of the responsive layout are highlighted in the following image, which was generated using the 2-2 responsive template. The image is annotated numerically with corresponding properties and explanations appearing below.
Document. Although not enumerated in the previous image, a responsive template generates an HTML document that includes the following responsive properties, editable in the Properties panel.
The following properties are available in the Responsive design section of the Properties panel when the DOCUMENT object is selected:
At run time, the layout populates the full browser.
The following properties are available in the Miscellaneous section of the Properties panel when the DOCUMENT object is selected:
1. Main Widget. Defined as windowPanel1 <DIV> in the Properties panel, the default title is Output widgets container.
The following properties are available in the Responsive design section of the Properties panel when the main widget object is selected:
The following properties are available in the Output Widget section of the Properties panel when the main widget object is selected:
2. Widget display buttons. The page, and each widget within it, has two buttons in the upper-right corner: an arrow and a box. Toggle the arrow to display or hide the row of controls. Toggle the box to expand a widget to full screen or return it to original size.
3. Vertical design boundary. This is a visual indicator on the far right side of the canvas that shows the responsive maximum width set in the Properties panel for the document. The default is 1500 pixels.
4. Widget Title. Defined as windowPanel2 <DIV> in the Properties panel (for the first widget), the default widget title is Output Widget Title. You can delete the default and type the desired widget title in the Properties panel. At design time, a red box appears around the widget title and contents to indicate a responsive container.
5. Widget contents. Defined as iframe1 <IFRAME> in the Properties panel (for the first widget), you can right-click to add content to the widget through the following shortcut menu:
The content in pages derived from a responsive template loads in the following order at run time: left to right - top to bottom.
To add a header to your responsive page, right-click in the title bar and select Add page header from the shortcut menu. Alternatively, you could use the Add page header option in the HTML/Document Wizard, as detailed in the following procedure.
Select a responsive template from the HTML/Document Wizard as follows:
The HTML/Document Wizard opens. If you used option a. above, the HTML/Document Wizard contains a navigation window that you can use to specify the folder where you want to save the new file.
The Templates, Settings, and Themes page opens, containing the Responsive Templates section, as shown in the following image.
For purposes of this procedure, do not select None or Custom.
The HTML canvas opens with the automatically generated responsive layout corresponding to the selected template.
Note: It is a best practice to expand App Studio to full screen when working with a responsive layout. This lets you access the greatest number of widgets without having to scroll.
A layout generated by a responsive template contains blank widgets in responsive containers. This section contains guidelines for editing and adding objects to widgets.
To increase the height of a page header, click the Title Bar and drag it down to expose more room above it. Click the header area to highlight the responsive red box. Drag the lower border of the red box down to increase the height of the header.
Note: When using a layout generated by a responsive template, you cannot add objects to the canvas outside the layout.
Note: All of the objects in a responsive container must be responsive. You cannot include responsive and non-responsive objects in the same responsive container.
You can change the layout of your responsive page at design time by adding or removing a widget, as detailed below.
The new widget is added.
Change the numeric configuration to include the new widget. For example, to add a new widget to the second row, change the value to 3-3.
The new widget is added.
The widget is removed.
Change the numeric configuration to reduce the number of widgets. For example, to remove a widget from the first row, change the value to 2-2.
The widget is removed.
You can put more than one object (such as a report or chart) in an output widget, as detailed in this procedure.
Note: A widget that contains a map will not accept an additional object.
Open the Properties panel to verify that the IFRAME is selected.
The widget can be divided vertically (with the two objects, side by side) or horizontally (with the two objects one above the other). Move your cursor to the right or left side, or the top or bottom of the widget.
The existing content automatically moves to the opposite side of your cursor.
The widget is automatically divided into two equal columns or rows. The side you selected contains the report or chart icon in an iframe.
Note: If you change your mind after you add the new iframe, you may right-click and delete it. However, the original iframe will not automatically expand to fill the original space in the widget. At run time, the content of the original iframe does fill the original space. But at design time it remains partial. You can click the original iframe and manually drag its border to fill the widget space, if you want the appearance of the page at design time to more closely reflect the appearance at run time.
Run the page to preview widgets that have multiple objects to be sure the content remains legible.
You may often have a responsive page that contains multiple reports that use the same controls. For example, if users can select region and month, they may want to show the same region and month selection for multiple reports in the page. In this case, you can apply common controls at the page level.
Your page can also include one or more reports that use controls that differ from the common ones. In this case you can apply additional controls at the widget level, as defined in How to Apply Widget-Level Controls in a Responsive Page.
This procedure details how you apply controls at the page level.
When you add a report with controls to a widget, the New Parameters dialog box opens. You can use this dialog to chain controls together. Chaining lets you filter control values based on the selected value from the prior control in the chain. For example, if State and City controls are chained, the City values will be filtered to show only cities in the selected state.
For more information see Chaining in the HTML Canvas.
Close the HTML output and return to the HTML canvas.
The properties for windowPanel1 <DIV> are displayed.
If you do not set the Control panel value to Yes, the controls will automatically expand to the right to use the full width as the page size increases.
The selections that the user makes in the controls input panel are automatically applied to all the reports on the page that share the controls.
You may often have a responsive page that contains multiple reports that use the same controls. For example, if users can select region and month, they may want to show the same region and month selection for multiple reports in the page. In this case you can apply common controls at the page level, as defined in How to Apply Page-Level Controls in a Responsive Page.
Your page can also include one or more reports that use controls that differ from the common ones. In this case you can apply additional controls at the widget level.
This procedure details how you apply controls at the widget level when different controls are used at the page level.
Add a new widget to a row as detailed in How to Add or Remove a Widget.
When you add a report with controls to a widget, the New Parameters dialog box opens. By default, this dialog is set to create a control. Click OK.
The New Parameters dialog box opens.
The New Parameters dialog box closes. The input panel is hidden.
The selections that the user makes in the controls input panel at the page level are automatically applied to all the widgets on the page that share controls. Additionally, the user can make a selection in the independent widget that does not share controls.
Creating a page with a responsive template enables you to add animation that appears when a user opens or closes a controls input panel at run time. This consists of creating and naming an animation, then applying it to the window panel that corresponds with the input controls, as detailed below.
The system gives the new animation a default name. For example, Animation1. If you wish to rename the animation, click the default name and type the new name.
Note: It is not necessary to specify a selected target for the animation. Leave this field blank.
The animation is ready to be applied to the window panel.
Responsive panels automatically resize as the viewing window changes, but panels do not have a default minimum or maximum size. You can set minimum or maximum size, in pixels or percentages, to best suit the panel contents, as follows.
Note: Panels in a responsive page resize within the context of the minimum and maximum page width. To view or edit these values, open the Properties panel and select DOCUMENT from the drop-down menu at the top of the panel. For Responsive: min width, the default is 320px. For Responsive: max width, the default is Full screen.
The Properties panel for the panel <DIV> includes the following properties: Min-width, Max-width, Min-height, and Max-height. These values are blank by default.
Alternatively, you can use the shortcut menu as follows:
The Update Sizes shortcut menu displays.
Select Update minimum size to populate the Min-width and Min-height properties with the number of pixels or percentages used by the selected container. In other words, the container will not scale smaller than the size shown in the responsive layout.
Note: Update minimum size does not change the object size in design time, but it does change the size in run time.
Select Use Current to use sizes from the selected container as follows:
In some cases, the content you add to a widget might not load at run time, leaving the widget blank. This could occur if you did not select the Run requests on load option from the HTML/Document wizard, or if you added a new widget to a layout.
To cause widget content to load at run time:
The shortcut menu is displayed.
The iframe is added to the Requests/Actions field and is highlighted.
The content loads at run time.
In the HTML/Documents Wizard, the Templates, Settings, and Themes page includes six responsive templates that represent the most commonly used layouts. You can use these layouts as-is, or use them as a point of departure for a modified layout that contains more or fewer widgets. For more information, see How to Add or Remove a Widget.
Instead of using a template, you can create a custom layout, as detailed in this procedure.
or
The HTML/Document Wizard opens. If you used option a. above, the HTML/Document Wizard contains a navigation window that you can use to specify the folder where you want to save the new file.
The Templates, Settings, and Themes page opens, containing the Responsive Templates section.
The layout opens and the Template configuration dialog is activated.
Note: Use the drop down list. Do not type in the field.
Close the Template configuration dialog.
How to: |
This “free form” method lets you create a responsive page with no pre-defined layout. This manual approach is perhaps not as fast as using a template, but may be preferable if you want to create a responsive page with containers of many different types. You can also use this method to convert an existing HTML file to responsive.
The following containers are responsive, by default:
You can create new responsive content using the HTML canvas in responsive mode, as defined in this procedure.
The HTML/Document Wizard opens.
The Templates, Settings, and Themes page opens, containing the Page Settings section, as shown in the following image.
The HTML canvas opens. In the Properties panel, in the DOCUMENT properties, the Responsive design value is set to Yes.
As an alternative to using the HTML/Document Wizard, you can open a file in the HTML canvas and manually change the Responsive design property value to Yes.
You can add content to the HTML canvas before turning Responsive Design on. However, there are advantages to turning Responsive Design on before adding content. Design time benefits include:
The HTML file is open in the HTML canvas.
The Document properties are displayed.
A message appears asking of you want to group control elements into responsive containers.
Note there are three containers within the fourth, larger container. The containers are red, indicating that they are responsive.
You can add additional containers at a later time:
The HTML canvas is now in responsive mode. The frames and controls on your HTML canvas are each enclosed in a responsive container, indicated by a red box.
Note: if the HTML file had the Autosize Children option enabled, it will be superseded by the new responsive behavior, which automatically controls sizing.
The following properties appear in the Properties panel for the DOCUMENT object, whose values you may edit:
If you select a responsive container, the following properties appear in the Responsive design section of the Properties panel:
If you select an iframe object, such as a report or chart component, in the canvas, the following properties appear in the Responsive design section of the Properties panel:
A black vertical line appears on the right side of the HTML canvas in responsive mode, as a visual indicator of the responsive maximum width. You may need to scroll right to see this line.
When you create a page with a responsive template, the first row of the page is automatically restricted to input controls (when applicable). Content such as reports or charts will not fold up to populate the first row, regardless of how wide the browser may stretch at run time.
When you create a page using the HTML canvas in responsive mode, this restriction is not automatic. Therefore a report or chart could fold up to populate the first row, if the browser width is increased. This behavior may be considered undesirable.
Ensure that the first row contains controls only, as follows:
and
Note that a box appears that contains all the selected controls. The box is red, indicating it is responsive.
If you do not set the Control panel value to Yes, the controls will automatically expand to the right to use the full width as the page size increases.
The WebFOCUS BI Portal gives users access to BI content, including dashboards, visualizations, reports, charts, graphs, maps, and interactive InfoApps. The BI Portal allows users to analyze vital information quickly, link content and reports together, and easily tailor information to their needs.
This procedure is comprised of two parts: creating a report for use in the responsive portal and creating a responsive HTML page using the HTML canvas.
The Templates, Settings, and Themes page opens.
The HTML canvas opens. In the Properties panel, in the DOCUMENT properties, verify that the Responsive design object property is set to Yes and the Load in iFrame object property is set to No.
The Load in iFrame object property is used to enable objects in a BI Portal to overlap the edges of a container. For example, when you have a pop-up calendar that populates a date field, the calendar can overlap the control container to allow the user to select a date.
Note: The Load in iFrame object property creates a <DIV> for the page instead of an <iFrame> tag. A BI Portal is limited to only one HTML Canvas page that is enclosed in a <DIV> tag.
Note that the Responsive: min width is set to 320px and the Responsive: max width is set to Full screen. These default values can be edited in pixels or percentages.
The Open File dialog box opens.
The New Parameters dialog opens.
The New Parameters dialog closes and the HTML canvas is opened, showing the controls in containers. The red boxes indicate that responsive design is activated.
The following are some best practices in working with Responsive Design to create responsive HTML pages:
To use these commands:
Click the down arrow to display the following property values:
The alignment in the HTML canvas does not change after you specify a content alignment property value. Click Run on the Quick Access Toolbar to see the specified alignment in the browser.