Lesson 5: Adding Table to the Component and Component to Sidebar of Application Template

588 views

 

Welcome to Lesson 5 of our SmartUX Demo Application series. This guide will walk you through
  1. Adding a Table and Column mapping to the Data Model to the Members List Component in SmartUX.
  2. Incorporating a Component into the Sidebar Navigation using Magic xpa.
Follow the engaging instructions to complete the process and enhance your training functionalities to achieve the below screen.

 

1. Adding the Members List Table

  • In the last lesson, you performed steps till the Create Button.
  • Now drag and drop the Table Body widget inside the second Container below the Row widget.
  • Click on the “Div” widget on the canvas.
  • In the Properties Sheet of the “Div” widget input “ScrollableSection” in the Class property.

Adding the Members Table

 

2. Mapping Table body

  • Select the Table on the Canvas.
  • Click on the Data Mapping gear icon in the Properties Sheet of Table.
  • This will open the “Select Data Model” window.

Mapping Table body

 

3. Select the Data Model for Table

  • Select the Data Model “Table_Member_List” Table control.
  • Click on the “Save” button to save the Data Mapping.

Select Data Model for Table

 

4. Add Member ID Column to the Member List Table

***Note***
> The Columns may not be displayed on in the Table.
> You have to drag and drop the all the columns inside the Table.
> Map all the Table Columns with respective Column Data Models.
> After Mapping all the Table Columns you need to enter in Live Preview mode and select the Member List menu                     from the sidebar.
> This will display all the columns without any records.
> Exit the Live Preview and now the Columns will be visible on Canvas as well.
> This is needed to record the Mock data for the Table to display columns for the First Time only.
  • Now let’s start dropping Table Columns widgets inside the Table.
  • Drag and Drop the First Table Column inside the Table on the Canvas.
  • In the Properties Sheet pane of the Table Column widget click on the gear icon of “Column Mapping”.

Add Member ID Column to the Member List Table

 

5. Column Mapping with Data Model “Column Member ID”

  • Select the “Column_Member_ID” Column control Data Model.
  • Click on the Save button to map the Column.

Column Mapping with Data Model 'Column Member ID'

 

6. Changing the Column Title Property

  • Once you do the Column Mapping, the Column Title property will get assigned a function to get the actual Table Column name from the Magic xpa form.
  • You can also input the desired Column title as per your requirement.
  • To input desired text as Title click on the gear icon on the Column Title property.
  • This will open a window for “Select Mg* Function”.

Changing the Column Title Property

 

7. Switch to Set Static HTML

  • In the “Select Mg* Function” window, you will see two radio buttons “Data Mapping” and “Set Static HTML”.
  • Select the “Set Static HTML” radio button.

Switch to Set Static HTML

 

8. Clear Set Static HTML

  • In the Set Static HTML section remove the existing text.
  • Here you can input the desired text for the Column.

Clear Set Static HTML

 

9. Fill in the Column Title as “#”

  • Here enter “#” in the provided field.
  • Click Save to assign the desired text to the Table Column Title.
  • Similarly, you can drag and drop the remaining six columns inside the Table and do the Column mapping.

Fill '#'

 

10. Drag and Drop the second Column for Title Column

  • Drag and Drop the second Column for “Column_Title” inside the Table.
  • Perform the Column Mapping with “Column_Title” Data Model column control.

Drag and Drop the second Column for Title Column

 

11. Column Mapping “Column_Title”

  • Select the “Column_Title” Column control from the Select Data Model List.
  • Click on the Save button.

Column Mapping 'Column_Title'

 

12. Drag and Drop the Third Column for “Column_First_Name”

  • Drag and Drop the Third Column for “Column_First_Name” inside the Table.
  • Perform the Column Mapping with “Column_First_Name” Data Model column control.

Drag and Drop the Third Column for 'Column_First_Name'

 

13. Column Mapping “Column_First_Name”

  • Select the “Column_First_Name” Column control from the Select Data Model List.
  • Click on the Save button.

Column Mapping 'Column_First_Name'

 

14. Drag and Drop the Fourth Column for “Column_Last_Name”

  • Drag and Drop the Fourth Column for “Column_Last_Name” inside the Table.
  • Perform the Column Mapping with “Column_Last_Name” Data Model column control.

Drag and Drop the Fourth Column for 'Column_Last_Name'

 

15. Column Mapping “Column_Last_Name”

  • Select the “Column_Last_Name” Column control from the Select Data Model List.
  • Click on the Save button.

Column Mapping 'Column_Last_Name'

 

16. Drag and Drop the Fifth Column for “Column_Birth_Date”

  • Drag and Drop the Fifth Column for “Column_Birth_Date” inside the Table.
  • Perform the Column Mapping with “Column_Birth_Date” Data Model column control.

Drag and Drop the Fifth Column for 'Column_Birth_Date'

 

17. Column Mapping “Column_Birth_Date”

  • Select the “Column_Birth_Date” Column control from the Select Data Model List.
  • Click on the Save button.

Column Mapping 'Column_Birth_Date'

 

18. Drag and Drop the Sixth Column for “Column_Gender”

  • Drag and Drop the Sixth Column for “Column_Gender” inside the Table.
  • Perform the Column Mapping with “Column_Gender” Data Model column control.

Drag and Drop the Sixth Column for 'Column_Gender'

 

19. Column Mapping “Column_Gender”

  • Select the “Column_Gender” Column control from the Select Data Model List.
  • Click on the Save button.

Column Mapping 'Column_Gender'

 

20. Drag and Drop the Seventh Column for “Column_Action”

  • Drag and Drop the Seventh Column for “Column_Action” inside the Table.
  • Perform the Column Mapping with “Column_Action” Data Model column control.

Drag and Drop the Seventh Column for 'Column_Action'

 

21. Column Mapping “Column_Action”

  • Select the “Column_Action” Column control from the Select Data Model List.
  • Click on the Save button.

Column Mapping 'Column_Action'

 

22. Add the Paginator to the Table

  • Drag and Drop the Paginator widget below the “Div” of the Table inside the second Container.
  • Click on the Save button on the top right corner of the browser window of SmartUX Studio.

Add the Paginator to the Table

 

23. Add a Card for Subform to open Create/Modify Member by hiding Member List

  • You need to have a form for the Create New Member or to modify the existing Member from the Member List table.
  • Drag and Drop the Subform widget below the “MainGroup” Card, inside the very first Container.
  • Perform the Data Mapping with the “SFMCard” Data Model Subform control.
  • Click on the gear icon from the Properties Sheet of the Subform widget.

Click here

 

24. Subform Mapping “SFMCard”

  • Select the “SFMCard” Subform control from the Select Data Model List.
  • Click on the Save button.

Subform Mapping 'SFMCard'

 

25. Add Route for the Member List Component (MList)

  • Now switch to the Components Pane.
  • Click on the Configure Routes this will open the Router Editor.

Add Route for the Member List Component (MList)

 

26. Select Program

  • Select the Program “MList” from the Select Route Program.
  • Click on the Save button to save the configuration.

Select Program

 

27. Route Editor

  • In the Route Editor click on the Add Route.

Route Editor

 

28. Configure the Route and Select the Program

  • The Add Route will open a window to Configure Route.
  • Input the Path as “MList” which is the Route name for the MList component.
  • Now Click on the Select Program button.

Configure Route and Select Program

 

29. Click “Save Route”

  • Once Route Configuration is saved click on the “Save Route”.

Click 'Save Route'

 

30. Check the added Route

  • Expand the list on the Route Editor window to see the added Route.
  • Click on close to exit the Route Editor.

Check added Route

 

31. Switch to Magic xpa studio for the sidebar navigation menu

  • Now you need to switch to Magic xpa to add “Member List” to the sidebar navigation of the Full Menu Application Template.
  • Enter into the Start Program in Magic xpa studio.

Switch to Magic xpa studio for sidebar navigation menu

 

32. Switch to Magic xpa studio for the sidebar navigation menu

  • Once you enter the Start Program switch to the subtask “BuildMenuData” from Navigator.
  • Switch to the Data View of the “BuildMenuData”.

Switch to Magic xpa studio for sidebar navigation menu

 

33. Create a Virtual variable for Sidebar Menu

  • Create a new Virtual variable “M-Members” below the “M-Wlcome” with Alpha and picture 2000.
  • The Virtual variable name can be anything but it must have the prefix “M-“.
  • Now initialize the virtual variable with the expression “n=Members~u=/base~i=cil-star”.
  • Open the expression editor on Init, create a new line in it, and provide the mentioned expression.

Create Virtual variable for Sidebar Menu

 

34. Switch to Magic xpa studio for the sidebar navigation menu

  • Now create another Virtual variable under the “C-MemberList” with Alpha and picture 2000.
  • The Virtual variable name can be anything but it must have the prefix “C-“.
  • Now initialize the virtual variable with the expression “n=Members List~u=/MList”.
  • Open the expression editor on Init, create a new line in it, and provide the mentioned expression.
  • Now, we have configured the sidebar navigation menu entry.
  • Escape from the Start Program and Save all the changes performed.
  • The Members List menu will be automatically added to the sidebar on the SmartUX side.
  • Switch to the SmartUX Studio now.

Switch to Magic xpa studio for sidebar navigation menu

 

35. Enter In Live Preview

  • Once you are back in the SmartUX Studio, exit the Expanded View and View Code.
  • You will see a Create Member button, one column and the Table Paginator only.
  • This is because no mock data is recorded for the “MList” component.
  • Now click on the Live Preview on the top right beside the Save button to enter Live Preview mode.

Enter In Live Preview

 

36. Click “Members List”

  • Here you will see the Members Menu in the sidebar.
  • Click on the Members this will open a child menu as “Member List”.
  • Click on the “Members List” Menu, this will show the “MList” component.

Click 'Members List'

 

37. Tabled Body with Column Headers

  • Now you will see the Table Column Titles, basically a Table Body with no records.
  • To see the records you need to add the respective widgets inside the columns depending on your requirements.
  • Also, you need to map them to respective control from the Data Model.
  • Let’s move forward and exit the Live Preview to continue with designing the Table.
  • To exit the Live Preview Click on the Component under Live Component. OR
  • You can also exit Live Preview by clicking on Component from Components Pane.

Exit the Live Preview

 

This guide covered the process of adding the Members List Table to the component in SmartUX. It also covered drag and drop of Table Column inside the Table including Column mapping with respective Data Models from Magic xpa. Further, you have performed modifications to the Start Program in Magic xpa to have the Members List in the sidebar of the Application Template. By following the engaging instructions provided, you can efficiently set up the necessary components for training. Please continue with the next Lesson to achieve showing record in the Table.

Share this Article

Lesson 5: Adding Table to the Component and Component to Sidebar of Application Template

Or copy link

CONTENTS