K2BTools Tutorial - Exercise 1.3: Advanced Features

You can now insert data using the interfaces generated by the EntityServices pattern. In this exercise we will review some of the other features provided by this pattern.

Feedback messages

  1. Run "WWProduct" Web Panel.
  2. Select a product, and click on the update action.
  3. Update the product’s price, and confirm the transaction.
  4. A message similar to the following will be shown.
    FeedbackMessagesRT1
    Feedback Message

Note: The contents of these messages can be customized in the Transaction Node, in the “After (insert|update|delete) Message” properties.

FeedbackMessagesDefinition
Feedback Message Configuration

Grid Settings

Visible Columns

  1. Go to the “Products” option in the application’s menu.
  2. Open the “Grid Settings” menu. Inside it, uncheck the “Type” option.
    RuntimeColumnSelectionMenu1
    Grid Settings Menu

  3. Click on the “Apply” action.
  4. You can now see how the “Type” column is no longer visible.
    RuntimeColumnSelectionEffect1
    After Saving Grid Settings

Note: Visible columns are stored in the Web Session by default. The developer may extend this behavior to persist this behaviour in the database, using the “K2BPersistGridColumns” procedure.

Page Size

  1. Open the “Grid Settings” menu.
  2. Change the “Rows Per Page” option to “10”.
    GridSettingsRowsPerPage1
    Grid Settings Rows Per Page Option

  3. Click on the “Save” action and see the result in the grid.

Order By

You can order the grid by clicking on the column title of an attribute having an associated SimpleOrder in K2BEntityServices instance.

  1. Click on the "Description" column. See how the order of the elements in the grid changes.
    OrderByGridColumn1
    Oder by Grid Column

Excel and PDF Reports

  1. Click on the “PDF Report” and “Export” actions and see their behavior.
    ExcelPDFReport1
    Excel and PDF Report Actions

Note: Reports are generated for WorkWith and SubWorkWith interfaces. Yo can disable this generation in the Standard Actions node.

Allow Runtime Column Reorder

With this property, you can reorder your columns in runtime.

  1. Go to your WorkWith and click on "GridColumns" node inside "Work With" node.
  2. Change "Allow Runtime Column Reorder" to "Yes".
    AllowRuntimeColumnReorder
    Allow Runtime Column Reorder

  3. Build your aplication (F5) and reorder your columns in runtime.

Import/Export from CSV

Import

The import from CSV action allows the end user to select and upload a CSV file containing records that should be imported in the application's database.

For the following step you will have to download this file.

  1. Open Warehouse transaction and go to pattern section.
  2. Inside EntityServices, click on "Standard actions" node and change "Import from CSV enabled" to "True.
    ImportCSV
    Import from CSV

  3. Build your application and go to ""WWWarehouse" panel.
  4. Click on download icon and select "Import from CSV" option
    ImportCSV2
    Import from CSV

  5. Click on "Add files" and select the csv file you downloaded before.
  6. Confirm in order to add data.

Export

It is also possible to export all the data of your table to a CSV file.

In order to do so, follow these steps:

  1. Open Warehouse transaction and go to pattern section.
  2. Inside EntityServices, click on "Standard actions" node and change "Export to CSV" to "True.
    ExportCSV
    Export to CSV

  3. Build your application and go to ""WWWarehouse" panel.
  4. Click on download icon and select "Export to CSV" option
    ExportCSV2
    Export to CSV

  5. Check the file you just downloaded.