Skip to main content

Button Widget

The Button widget creates interactive clickable buttons that can trigger various actions within your interface. This widget provides extensive customization options for appearance, behavior, and functionality.

OverviewDirect link to Overview

The Button widget is a versatile UI component that allows users to trigger actions, submit forms, navigate between pages, or execute custom functions. It supports multiple visual styles, sizes, icons, and positioning options.

The five button types in the builder. The selected button shows its Global and Actions cards in the configuration panel.
The five button types in the builder. The selected button shows its Global and Actions cards in the configuration panel.

Basic ConfigurationDirect link to Basic Configuration

Global SettingsDirect link to Global Settings

NameDirect link to Name

  • Field: Name
  • Description: Display name for the button
  • Type: Text input
  • Usage: This text appears on the button and can be translated

Variable/ModelDirect link to Variable/Model

  • Field: Variable/Model
  • Description: The data model or variable name associated with this button
  • Type: Text input
  • Usage: Used for data binding and referencing the button in scripts

Button PropertiesDirect link to Button Properties

Button TypeDirect link to Button Type

  • Field: Button Type
  • Options:
    • primary - Primary action button (typically blue)
    • success - Success/confirmation button (typically green)
    • info - Informational button (typically grey)
    • warning - Warning button (typically orange/yellow)
    • danger - Destructive action button (typically red)
  • Default: primary
  • Colours: the colours above are those of the historical SoftyFlow look. When your account applies its design to the applications (Settings › Design & colours › Apply to the applications too), the buttons follow the design: primary takes the accent colour of the design, which is your primary brand colour if you set one; success, warning, danger and info take the status and neutral colours of the design. Your client CSS is loaded last and always keeps the last word.

Size OptionsDirect link to Size Options

  • Field: the Medium / Small / Mini buttons of the Global card (size)
  • Options:
    • medium - Standard size button
    • small - Smaller button
    • mini - Minimal size button
  • Default: medium

AlignmentDirect link to Alignment

  • Field: the Left / Center / Right buttons of the Global card (float)
  • Options:
    • left - Align button to the left
    • center - Center the button
    • right - Align button to the right
  • Default: left

Icon ConfigurationDirect link to Icon Configuration

Prefix IconDirect link to Prefix Icon

  • Field: Prefix Icon
  • Description: Icon displayed before the button text
  • Type: Icon selector
  • Usage: Choose from available icon library

Suffix IconDirect link to Suffix Icon

  • Field: Suffixe Icon (as spelled in the builder)
  • Description: Icon displayed after the button text
  • Type: Icon selector
  • Usage: Choose from available icon library
The Global card of a selected button: name, variable, type, icons, alignment and size.
The Global card of a selected button: name, variable, type, icons, alignment and size.

Actions ConfigurationDirect link to Actions Configuration

On Click ActionDirect link to On Click Action

The click of the button is set in the Actions card of the configuration panel:

  • Create on click action: shown while the button has no action. It opens the Actions drawer on a new On Click chain.
  • View attached action: shown once an action chain is attached. It opens the same drawer on the existing chain.
The Actions card of a button that already has an action chain.
The Actions card of a button that already has an action chain.

In the drawer, you build the chain from the action categories (Dom, Collection, Process, Api, SoftyTables, User, Basic) and save it with Save:

The Actions drawer opened from a button: the On Click chain.
The Actions drawer opened from a button: the On Click chain.

The chain can, for example:

  • Script Execution: Execute custom JavaScript code
  • Form Submission: Submit parent form data
  • Navigation: Navigate to other pages or URLs
  • API Calls: Make HTTP requests to external services
  • Variable Updates: Modify interface variables
  • Function Calls: Trigger predefined functions
  • Open a task: open the page of a task from its ID, in the same tab or a new one, with the openTask action. On a Button widget, the Task Id comes from a variable of the page (for example models.taskId), because SF_input only holds SF_currentIndex here; in a loop, read the row at that index (for example models.tasks[SF_input.SF_currentIndex].taskId). SF_input._id is specific to the row buttons of the Table widget, where SF_input is the clicked row

Action PropertiesDirect link to Action Properties

  • SF_input: The input of the chain. On a Button widget, it only holds SF_currentIndex
  • SF_currentIndex: Current index in loop contexts
  • Loading State: Automatic loading indicator during action execution
  • Error Handling: Built-in error management: whatever happens in the chain, the button is given back at the end (see Loading States)

Validation and VisibilityDirect link to Validation and Visibility

Screen-Based ValidationDirect link to Screen-Based Validation

Configure button behavior across different screens/contexts:

AvailableDirect link to Available

  • Description: Controls if the button exists in the interface
  • Type: Boolean (a simple switch; it takes no condition)
  • Default: true

VisibleDirect link to Visible

  • Description: Controls button visibility
  • Type: Boolean or conditional expression
  • Options:
    • Simple toggle (true/false)
    • Advanced conditional expression using variables

RequiredDirect link to Required

  • Description: Validation requirement (if part of form)
  • Type: Boolean or conditional expression
  • Context: Only applicable when button is part of form validation

DisabledDirect link to Disabled

  • Description: Controls if button is interactive
  • Type: Boolean or conditional expression
  • Effect: Button appears grayed out and non-clickable when disabled
The Validation card: one row per screen of the page, with the Available, Visible, Required and Disable switches.
The Validation card: one row per screen of the page, with the Available, Visible, Required and Disable switches.

Advanced Conditional LogicDirect link to Advanced Conditional Logic

Use conditional expressions with interface variables:

  1. With All Screens selected in the canvas, click Advanced Setting in the Validation card: the Visible, Required and Disable switches become pencil icons. Available stays a simple switch.
  2. Click the pencil of a screen and a property: the Advanced Setting Condition dialog opens.
  3. Write the condition, with the variables of the interface in {{ }} (for example {{montant}} > 1000).
  4. Click Apply for this screen only, or Apply to All screens.

Easy Setting brings the switches back, except for a property that holds a condition: it keeps its pencil. To give it its switch back, replace the condition with true or false, then click Easy Setting.

With one screen selected in the All Screens selector of the canvas, the card only shows that screen: one row each for Visible, Required and Disable, with a switch and a pencil side by side, and no Available column. You do not need Advanced Setting there (the link stays visible on the first screen, where it has no effect).

Advanced Setting: the switches become pencils, and each condition is written in the Advanced Setting Condition dialog.
Advanced Setting: the switches become pencils, and each condition is written in the Advanced Setting Condition dialog.

Styling and AppearanceDirect link to Styling and Appearance

CSS ClassesDirect link to CSS Classes

  • Field: Class, in the Style card
  • Description: Custom CSS classes for styling, added to the button
  • Type: Text input (class names separated by spaces; commas are removed, so do not use them as separators)
  • Usage: Apply custom styles or framework classes

Dynamic ClassesDirect link to Dynamic Classes

The brush button next to Class (Dynamic classes) opens an editor where you write a JSON object: each key is a class name, each value a condition with the variables of the interface in {{ }}. The class is added to the button while its condition is true, for example { "btn-urgent": {{montant}} > 1000 }.

Layout OptionsDirect link to Layout Options

The Style card of a button only holds Class and Dynamic classes: the size and the alignment are set in the Global card. The rest of the appearance comes from the portal design when it applies, from your client CSS, or from the style sheet of the page (Page settings › Appearance › Stylesheet (CSS)), which replaces the client CSS for this page.

The Style card of a button: the Class field and the Dynamic classes button.
The Style card of a button: the Class field and the Dynamic classes button.

Usage ExamplesDirect link to Usage Examples

Basic ButtonDirect link to Basic Button

A Submit button selected in the builder: type success, centred, medium size.
A Submit button selected in the builder: type success, centred, medium size.

Button with IconsDirect link to Button with Icons

A button with a prefix icon and a suffix icon, chosen in the Global card.
A button with a prefix icon and a suffix icon, chosen in the Global card.

Action Button with Start ProcessDirect link to Action Button with Start Process

A Start Process button with an action chain attached: View attached action opens the Actions drawer, where the chain runs the startProcess action.
A Start Process button with an action chain attached: View attached action opens the Actions drawer, where the chain runs the startProcess action.

Conditional ButtonDirect link to Conditional Button

A Delete button shown only when the page variable canDelete is true: the condition of its Visible property, in the Advanced Setting Condition dialog.
A Delete button shown only when the page variable canDelete is true: the condition of its Visible property, in the Advanced Setting Condition dialog.

EventsDirect link to Events

onClickDirect link to onClick

  • Trigger: When button is clicked
  • Context: Provides access to current data and form state
  • Parameters:
    • SF_input: Input context object ({ SF_currentIndex } on a Button widget)
    • SF_currentIndex: Current loop index (if applicable)

Loading StatesDirect link to Loading States

  • Automatic Loading: Button shows loading spinner during async operations
  • Disabled During Loading: Button becomes non-interactive during action execution
  • Always Given Back: when the chain ends, the spinner is removed and the button is enabled again, even when an action of the chain fails
  • No Action, No Effect: a button without any action attached does nothing when clicked (no spinner, no disabling)
Changed in version 8.6

Up to version 8.5, only a button without any action, or a button whose <id>_action method written by hand in the page code threw an error, stayed disabled with its spinner until the page was reloaded: the chains built in the Actions drawer already caught their errors. Since version 8.6, a button without actions ignores the click, and a button with actions is always given back at the end, whether its chain or its method succeeded or failed.

Best PracticesDirect link to Best Practices

Action DesignDirect link to Action Design

  1. Clear Labels: Use descriptive button text
  2. Appropriate Types: Match button type to action severity
  3. Loading Feedback: Ensure async actions show loading states
  4. Error Handling: Implement proper error management

Visual DesignDirect link to Visual Design

  1. Consistent Sizing: Use consistent sizes within form groups
  2. Logical Positioning: Place primary actions prominently
  3. Icon Usage: Use icons to enhance, not replace, clear text
  4. Color Coding: Follow standard color conventions

AccessibilityDirect link to Accessibility

  1. Keyboard Navigation: Ensure buttons are keyboard accessible
  2. Screen Reader Support: Use meaningful button names
  3. Focus Management: Proper focus handling in forms
  4. Contrast: Ensure sufficient color contrast

Form IntegrationDirect link to Form Integration

  1. Validation Context: Consider button role in form validation
  2. Submit Behavior: Configure appropriate form submission
  3. Field Dependencies: Set up proper field relationships

Advanced FeaturesDirect link to Advanced Features

Form IntegrationDirect link to Form Integration

  • Submit Forms: Automatically submit parent forms
  • Validation Triggers: Trigger form validation
  • Field Dependencies: React to other form field changes

Loop ContextDirect link to Loop Context

  • Loop Integration: Special handling within data loops
  • Index Access: Access to current loop iteration
  • Dynamic Properties: Properties that change per loop item

Custom StylingDirect link to Custom Styling

  • Theme Integration: Integrates with interface theme settings and, when your account applies its design to the applications, with the design and your brand colours (see Button Type)
  • Responsive Design: Adapts to different screen sizes
  • Custom CSS: Support for custom styling

TroubleshootingDirect link to Troubleshooting

Common IssuesDirect link to Common Issues

  1. Button Not Responding: Check if disabled or validation conditions, and that an action chain is attached (Actions card: View attached action); a button without actions does nothing
  2. Actions Not Executing: Verify action configuration and permissions
  3. Styling Issues: Check CSS class conflicts
  4. Loading States: Ensure async actions are properly handled

DebuggingDirect link to Debugging

  • Browser Console: Check for JavaScript errors
  • Network Tab: Monitor API calls during button actions
  • State Inspection: Verify variable states and conditions