1 Context:
There are different types of buttons to perform actions on a screen in Build.One. In this example, we will include a ribbon bar to save input in a grid.
2 Result:
3 Step by step guide:
3.1 Create an action
- 👋 Navigate to the section “Logicalize” -> “Actions” and select “+ Create”
- 👋 Fill in the following information and name it
- Function Name -> “RibbonSaveFunction”
- Function Type -> “Akioma.Swat.Studio.Menu.Action”
- 💡 Shows which SCL class will be used in the background
- Function Code -> “GeneralSaveRibbon”
- 💡 This is the internal identifier for this action
- Icons at magnify glass -> “fad fa-save”
- Module -> “MyAppModule”
- 👋 Select “Confirm” and a second configuration tab appears
- 👋 In the panel “Properties” fill in the following attributes
- Action Type -> “PUBLISH”
- 💡 We use PUBLISH if this action writes into DSOs
- Action Parameter -> “recordSave”
- 💡through this changed records will be saved. We could also add here a function or other parameter
- Action Target -> TABLEIO
- 💡 The connection type for our action
- Toggle the checkbox “Is Big”
- 💡 This controls the size of the button in the ribbon
- 👋 Select “Save”
RibbonSaveFunction
3. 2 Create the menu function
- 👋 Now navigate to “Design” -> “Menus”
- 👋 Filter for "Show root menus" by ticking the checkbox and selecting "BuildOneApplication".
- 👋 Click on the menu structure node “BuildOne Application” and mark it
- 👋 Make sure in the section “New Entry” the category “Menu” is selected and click on “Add as sublevel”
- 👋 Fill in the following information:
- MenuName → MyOrderApplication
- Menu Structure Code → MyOrderApplication
- 👋 Select your new group “MyOrderApplication”
- 👋 Now select the item type “Ribbon”, in the “New entry” block of the ribbon in the dropdown, and click on “Add as sublevel” and call it:
- “MenuName” -> “MyRibbons”
- “Menu Structure Code” ->” MyRibbons” and select “Save”
- 👋 Select now your newly created “MyRibbons” group and add a “Block” by also selecting it in the dropdown, then clicking the button “Add as sublevel” and name it “CRUD-Operations”
- 👋 Now select your newly created “Block” group and add an “Item” by also selecting it in the dropdown and clicking the button “Add as sublevel”
- 👋 Fill in the following information and Save it
- Label → Save
- Related Function → RibbonSaveFunction
- 👋 Now go back to the Screen Designer of your OrderOverview screen.
3.3 Integrate the ribbon in the screen
- 👋 Search for the “SimpleSwatRibbon” in the panel “Library of Objects” and drag and drop it on the “OrderGrid_<yourName>”
- 👋 Navigate to the Flow Designer and link the “SimpleSwatRibbon” to the object “OrderForm_<yourName>” and choose the “Link type” -> “TableIO”
- 👋 Click on the “SimpleSwatRibbon” and search in the panel “Attributes” for the attribute “ToolbarKey” and insert the following value “#MyRibbons” (Menu structure code of your ribbon group)
💡Now launch your screen and test the new save function, by changing a value in the the order form, e.g. in the “Term” column. Once you changed a value, you see unsaved changes. Now, click on your new save function. Violá, your changes are saved!
💡There are various actions that are already defined in the standard. We can look at these in the SWAT framework and use them as needed
4 Explanation:
We added the ability to edit records in a predefined screen. With this ribbon bar, you can make these changes directly in the screen.