• Ratings are the customer’s feedback or measurement based on the quality of the products/services.
  • They can be provided based on different criteria. In most cases, ratings are given by the customers in the form of stars
  • Stars-based ratings are the most commonly used and standard rating system that you can use for your application.
  • If you want to review any product or service, rating stars can be one of the smart ways to style and demonstrate ratings on your website.

Steps to Create a Rating Stars

1. Create Binary Files:

  • Create–>Technical–>Binary File
NameSample Values
LabelStar_BW
App NameWebwb
File Typejpg
  • Select Black & white Rating Star and save
  • Save as this rule and create for Color Star binary file
NameSample Values
LabelStar_Color
App NameWebwb
File Typejpg

Images used for Rating Star:

https://drive.google.com/drive/folders/1mm9O5AROu14uN2zAejvaALrPbBzIv8Vh

2. Create Rating Star section:

Section-Star 1:

  • Create–>User Interface–>Section
NameSample Values
LabelStar1
Apply toO4zyqc-Sample-Work
Add to RulesetSample
  • Click “Convert to full section editor”
  • Add two dynamic layouts
  • Drag and drop image fields for both layouts
  • In Image field Include Image Property
In Top Field Include B&W Image propertywebwb/ Star_BW.jpg
In bottom field Include Color Image propertywebwb/ Star_Color.jpg
  • Add visibility condition for both layouts
In Top layout.pyTempInteger<1
In bottom layout.pyTempInteger>=1
  • Add Action-Set for both layouts
  • Event–>Click ; Action–>Set Value
In Top layout.pyTempInteger=1
In bottom layout.pyTempInteger=0
  • Save & review this section (Action–>Preview)
  • Save as this section and create all other sections

Section-Star 2:

In Image fieldIn Top Fieldwebwb/ Star_BW.jpg
In bottom fieldwebwb/ Star_Color.jpg
visibility conditionIn Top layout.pyTempInteger<2
In bottom layout.pyTempInteger>=2
Action-SetIn Top layout.pyTempInteger=2
In bottom layout.pyTempInteger=1

Section-Star 3:

In Image fieldIn Top Fieldwebwb/ Star_BW.jpg
In bottom fieldwebwb/ Star_Color.jpg
visibility conditionIn Top layout.pyTempInteger<3
In bottom layout.pyTempInteger>=3
Action-SetIn Top layout.pyTempInteger=3
In bottom layout.pyTempInteger=2

Section-Star 4:

In Image fieldIn Top Fieldwebwb/ Star_BW.jpg
In bottom fieldwebwb/ Star_Color.jpg
visibility conditionIn Top layout.pyTempInteger<4
In bottom layout.pyTempInteger>=4
Action-SetIn Top layout.pyTempInteger=4
In bottom layout.pyTempInteger=3

Section-Star 5:

In Image fieldIn Top Fieldwebwb/ Star_BW.jpg
In bottom fieldwebwb/ Star_Color.jpg
visibility conditionIn Top layout.pyTempInteger<5
In bottom layout.pyTempInteger>=5
Action-SetIn Top layout.pyTempInteger=5
In bottom layout.pyTempInteger=4

3. Create Main Section:

  • Create–>User Interface–>Section
NameSample Values
LabelRating Star
Apply toO4zyqc-Sample-Work
Add to RulesetSample
  • Click “Create and Open”
  • Click “convert to full section editor”
  • Open “pzRatingStar” Section
  • Configure–>User Interface–>Gallery–>UI elements–>Available components–>Ratings–>View design time configuration–>Dynamic layout 2–>Rating–>pzRatingStar
  • Copy & paste both layout into the main section
  • Layout 1: Change Hidden content property into .pyTempInteger
  • Layout 2: In the source field, Select the Rating Star section for all layout

4. Configure Casetype UI:

  • App explorer–>Casetype–>User Interface–>Section–>Select your section you want to add Rating Star
  • Drag & drop embed layout and select the main section
  • Save and Run the Case in the user portal
  • Open Your case in Devstudio & Check .pyTempInteger value in Clipboard

Youtube Video: