A form is one of the basic needs for almost every organization. We might need to create simple or complex forms based on requirement. Sometimes it becomes time-consuming to create complex/multi-part forms. With the new iteration of Liferay DXP, we can create different types of forms using DXP Forms feature. It comes with advanced features which allow us to create basic to complex/multi-part forms without any knowledge of coding whatsoever. It is much like adding content to the page.
Prerequisite:
Basic knowledge of Liferay and DXP Forms.
It’s really easy to create simple forms with the Forms Application. You can reach this in the Menu by using the site selector to choose the site you want to work in and clicking Forms under the site. Once you are in the Forms App, click the Add button. You are taken to a screen where you can create a form. To meet your form-building needs, Liferay Forms provide useful and highly configurable field types.
Liferay’s built-in Forms application supports most basic form building needs (something like a one question survey), and also most advanced (like a mortgage application, or conference sign-up form) which are listed below.
Populating a Select field with a REST Data Provider
Multi-Page Forms
Wizard Mode for easier navigation
Enabling workflow for the form
Placeholder text and predefined values in form input fields
Validating fields using a number of different criteria
Configuring form permissions
Field Visibility Control
CAPTCHA in Form
Redirecting to a different URL after a successful form submission
Sending an email notification whenever a form entry is submitted
I’ll be explaining how we can use the “Populating a select field with a REST data provider” feature.
Populating Select Fields With REST Data Providers
Adding and Configuring a Data Provider
Before using a Data Provider in your select fields, you need to configure one which you can use in your forms. Navigate to the Forms application in Site Administration ? Content ? Forms, and click the Option button.
Click on Data Providers, the data providers window opens, and you can see any existing data providers or add a new one. Click the Add button.
Fill out the Data Providers form, passing in the following values:
Password: user_password (replace with user password)
Using a Data Provider in a Select Field
To use data provider in selection field, edit select field and select “From Data Provider” under Create List option. Choose your data provider from the list.
Your Data Provider is now being used to populate your select fields. You can use your data provider in form’s selection field as rest provider.
You may also want to configure permission for data provider as per your business needs.
That's It. Your Data Provider is now being used to populate your select fields.
We use cookies to deliver personalized content, analyze trends, administer the site, track user movements on the site, and collect demographic information about our user base as a whole. Accept all cookies for the best possible experience on our website or manage your preferences.
What For?