Promote the most important action on a page by adding a floating action button to
your mobile app. For example, you can add a floating action button that starts a case flow
for creating a new expense report in your Expenses mobile app.
You configure a floating action button by adding and modifying the Button control on the main content section of your page. With
the floating action button at the bottom of the page, users can trigger the primary
action on a page with one convenient tap. A page can have only one floating action
button, so only the last one that you add appears in the mobile app at run time.
Note: Avoid using the floating action button for non-constructive actions, such as
deleting or archiving an item. Do not use the floating action button in modals that
are not full-screen.
In the header of App Studio,
click Preview application, and then enter the design mode
by clicking Design.
Expand the Pages pane, and then
select the page that you want to open.
On the page, hover over the main content section that you want to modify, and
then click the Edit icon.
In the live design view editor, add the Button
control to your section:
In the design pane on the right side of the
screen, click the Add icon.
In the Add pane, expand the
Controls section, and then, in the Action category, click the Add to
view icon next to the Button
control.
Close the Add pane.
Set an icon for the Button control:
In the design pane on the right side of the
screen, click the Edit icon next to the Button control.
In the Button pane, on the
General tab, in the Image
source list, select Icon
class.
Next to the Class field, click the
Open the icon class picker icon.
In the Icon class picker window, select the icon
that you want to use for the Button.
For example: For a floating action button that launches a case for creating a
new expense report, select the pi pi-plus icon
that displays a plus sign on the floating action button.
Click Apply.
Configure the Button control as a floating action
button:
In the Button pane, on the
Presentation tab, select the Set
as Floating Action Button (FAB) check box.
Optional: To specify the background and font color of the floating action button,
in the Control format list, select the format
that you want to use.
Click Apply.
Result: The button disappears from the page preview, but appears at the
bottom of the page on the mobile app at run time.
Add an action that users trigger when they tap the floating action button on
the mobile app page:
Note: Set only one action for a floating action button to represent the primary
constructive action for the page.
In the Button pane, click Add
action sets.
In the action set configuration window that opens, click
Create an action set.
Click Add an event > Click.
Note: The floating action button supports only the Click event.
Click Add an action > All actions, and then select an action that you want to use in your
floating action button.
For example: In your mobile app, you have a page that lists all expense reports
that users submit. You want the floating action button on this page to
trigger an important constructive action, for example, the Create Work
action that launches a new expense report flow when users tap the
floating action button. You can use the
Expenses-Work-Report class that references your
expense reporting case. If your case type includes the Create stage, you
can omit entering the flow name that launches a new flow. You can also
choose the out-of-the-box pyCreateCaseSkeleton
skeleton that acts as a transition stage when a new case is created.
During that transition, the mobile app displays the skeleton, while the
server works on rendering and displaying the user interface of the case
in the client.
Click OK.
Click Apply, and then close the Button pane.
In the upper-right corner, click Exit
design mode.
Example:
What to do next: Verify the changes to your mobile app with the Pega Mobile Preview app. For more information, see Previewing mobile apps.