Part 1
Widget Connector | ||||||
---|---|---|---|---|---|---|
|
...
This tutorial will cover the creation of card views and expand upon some of the other features we've seen so far, such as custom actions.
To recap the steps in the video:
Create a Card View
- In the right portion of the
Businesses
dashboard create a new Form calledBusinessNotes
and set:- Auto Size: tick
- Direction: Column
- Justify: Flex Start
- Align: Stretch
- All other Position Settings should be blank.
- Prevent Dragging: tick
- Open the configuration form for the stream
BusinessNotes
, and bring the new dashboard to the front. Drag the stream icon from the configuration form onto the
BusinessNotes
Form, this automatically creates a Card View.Tip The card view is created as a form that already existed. If no form had existed, a grid view would have been created.
- Find the Card View in the repository and set:
- Name:
Notes
- Use Custom Default Filter: tick
- Next to the Default Filter, click on the + button.
- Name:
ByBusinessUID
- Filter Details
BusinessUID
equalsBusinesses.UID
- Click abc to let PhixFlow know this is an expresssionexpression.
- Note that default filters can be removed by the user.
To apply a filter that is not accessible to the user, add a Rule using the Background Filter Rule section.
- Name:
- Create a Default Sort Order.
- Auto Size: tick
- Clear all the Position Settings
- Prevent Dragging: tick
- Name:
- Locate the Card in the repository and set:
- Auto Size: untick
- Direction: Column
- Justify: Flex Start
- Align: Stretch
- CSS Properties:
maxHeight = 300px
minHeight = 50px
- Clear all Position Settings.
Configure the Card View Layout
- Shift+drag an Area onto the Card to embed the area and set:
- Name:
NoteHolder
- Auto Size: untick
- CSS Properties:
padding-left = 5px
padding-right = 5px
padding-bottom = 5px
padding-top = 5px
- Clear all Position Settings.
- Name:
In the Top Portion of the Note
- Drag an Area onto the NoteHolder area and set:
- Name:
NoteContent
- Auto Size: untick
- CSS Properties:
border-bottom = 1px solid #9b9b9b
- Clear all Position Settings except Order and Tab Index.
- Name:
- Drag a Dynamic Text area onto the
NoteContent
area and set:- Name:
Note
- Untick Auto Size: untick
- CSS Properties:
padding-bottom = 5px
- Width:
100%
- Remove all other Position Settings except Order and Tab Index.
- Name:
In the Lower Portion of the Note
- Drag an Area onto the NoteHolder area and set:
- Name:
NoteAudit
- Auto Size: untick
- Direction: Row
- Justify: Space Between
- Align: Center
- Clear all Position Settings except Order and Tab Index.
- Name:
- Drag a Dynamic Text field onto the area and set:
- Name:
NoteByUser
- Name:
- Drag a DateTime field onto the area and set:
- Name:
NoteDate
- Type:
Datetime
- Clear all Position Settings except Height, Order and Tab Index.
- Name:
Setup a Note Editing Dashboard
- Create a new Dashboard called
BusinessNotesEditor
and set:- Always On Top: tick
- Create a new Form called
AddNoteForm
. - Open the configuration form for the stream
BusinessNotes
and bring the new dashboard to the front. - Drag the attribute
Note
onto the dashboard and set:- Width:
100%
- Top:
0px
- Bottom:
45px
- Width:
- Drag the attributes
UID
onto the dashboard and hide the field. - Drag the attribute
BusinessUID
onto the dashboard and hide the field.
This field will be used to associate our notes to a specific business. - Drag an Area onto the dashboard and set:
- Name:
AddNoteFooter
- Background-Colour:
#
9b9b9b
- Direction: Row
- Justify: Flex End
- Align: Center
- Width:
100%
- Height:
45px
- Bottom:
0px
- Prevent Dragging: tick
- Name:
Setup a Custom Insert Action
- Add a button, and set:
- Name:
InsertNote
- Action Type: Insert
- Name:
- Open the stream configuration for
Business Notes
. - Go to the Actions section.
- Click + to add a new action.
- In the action configuration form, set:
- Name:
AddNoteCustomAction
- Display Name: Add Note
- Context Parameters
- Include Previous Context Parameters: tick
- In the Stream Action Rule Items section, set:
- Add a Stream Action Rule using the + button.
- Add a Stream Action using the + button and set:
- Name:
AddNoteAction
- Stream Item Action:
Update
- Filter Type:
Selected Items
- Copy Values By Name: tick
- Attributes to Update:
NoteDate = now()
Automatically sets the time to now.NoteByUser = _user.name
Sets the note author to the current user.BusinessUID = _context.BusinessUID
Sets the UID of theBusiness
with which this note will be associated. We will set this up later.- Save your changes to the attributes.
- Save your changes to the stream.
- Name:
- InIn Action Completion, set: tick
- Close Parent Dashboard
- : tick
- Name:
Tip |
---|
When you add a custom action to update or insert, it is important that you tick Copy Values by Name. When this option is selected, PhixFlow updates a form with values from the underlying stream when the names of the fields match. All standard actions will do this. If you do not select Copy Values by Name, the form will not continue to work as it currently does. You will not be able to add new fields as easily as you have done so far. |
Setup a Custom Open Dashboard Action
- Update the button Label to Insert.
- Drag the action from the stream configuration onto the button
Add
on your form. - Save the changes.
- Open the stream configuration for
BusinessNotes
. - Go to the Actions section.
- Press + to add a new action.
- In the action configuration form, set:
- Name:
OpenAddNote
- Display Name:
+
- Open the Context Parameters section.
- Click the + button.
- Name:
BusinessUID
- Expression:
Businesses.UID
This is constructed using the name of the element holding the information and the attribute name on that element, for example:<<element>>.<<attribute name>>
To show the element name, right-click and select Show Element Details. - Save the changes
- In Action Completion, set:
- Open Post Dashboard: tick
- Select
BusinessNotes
and drag it into the window.
- Name:
- Save your changes.
Building Note Actions
- Drag an Area onto the
BusinessNotes
Form and set: - Name:
NotesFooter
- Style Settings:
- Background-Colour:
#
9b9b9b
- Auto Size: untick
- Direction:
Row
- Justify: Flex End
- Align: Center
- Height:
45px
- Clear all the other Position Settings.
- Background-Colour:
- Drag a Button onto the new area and set:
- Name:
OpenAddNote
- Action Type:
General
- Action:
OpenAddNote
- Width:
35px
- Name:
- Set the Label value to +
Go into App Mode to test the changes and the new dashboard.
Panel |
---|
Next video: 7. Screen Flow |
...