Documentation

Trace:

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
visionx:data_modeling_and_representation [2020/06/08 11:53]
cduncan [Create an input screen with table and subtable]
visionx:data_modeling_and_representation [2020/06/08 12:21]
cduncan [Specify a BETWEEN filter]
Line 179: Line 179:
 Let's dive into another feature of VisionX: we can easily relate data entities, regardless of their cardinality. Let me explain what I mean with the following example: each of the employees may have fix assets assigned, such as a notebook, a mobile phone, or a coffee maker. How can we list the employee'​s assets in the Employees screen? Let's dive into another feature of VisionX: we can easily relate data entities, regardless of their cardinality. Let me explain what I mean with the following example: each of the employees may have fix assets assigned, such as a notebook, a mobile phone, or a coffee maker. How can we list the employee'​s assets in the Employees screen?
  
-===== Create a one-to-many relation ​=====+===== Create a One-to-Many Relation ​=====
  
-From a technical point of view, the relation between an employee and its assets is a one-to-many relationEach employee can have multiple assets assigned, but each asset is assigned to one employee (at a time) only. In VisionX, this concept is called "​Subtable"​. Let's create ASSETS as a subtable of EMPLOYEES.+From a technical point of view, the relation between an employee and its assets is a one-to-many relationEach employee can have multiple assets assigned, but each asset is assigned to one employee (at a time) only. In VisionX, this concept is called "​Subtable"​. Let's create ASSETS as a subtable of EMPLOYEES.
  
-Open the designer of your Employee screen and edit the data-object "​Employees"​ (1). In the wizard toggle "​Database changes"​ (2) and add a new column by pressing the (+) button (3). Name the new column "​Assets"​ (4) and press "Make Subtable"​ (5).+Open the designer of your Employee screen and edit the data-object "​Employees"​ (1). In the wizardtoggle "​Database changes"​ (2) and add a new column by pressing the (+) button (3). Name the new column "​Assets"​ (4) and press "Make Subtable"​ (5).
  
 > **Note**: You have to add a new column and choose "Make Subtable"​ in one step to create a one-to-many-relation! > **Note**: You have to add a new column and choose "Make Subtable"​ in one step to create a one-to-many-relation!
Line 189: Line 189:
 {{:​visionx:​data_modeling_and_representation:​subtable_step1.png?​nolink|Subtable one-to-many:​ Define Information}} {{:​visionx:​data_modeling_and_representation:​subtable_step1.png?​nolink|Subtable one-to-many:​ Define Information}}
  
-We can now specify the details of the new table. Let's rename the column "​Assets"​ to "​Asset"​ (1) and add additional columns "Issue Date" and "​Type"​ (2). VisionX automatically creates a drop-down ​list for the employeethat is currently holding the asset. Press "​Finish"​ to apply your changes.+We can now specify the details of the new table. Let's rename the column "​Assets"​ to "​Asset"​ (1) and add additional columns "Issue Date" and "​Type"​ (2). VisionX automatically creates a dropdown ​list for the employee that is currently holding the asset. Press "​Finish"​ to apply your changes.
  
 {{:​visionx:​data_modeling_and_representation:​subtable_step2.png?​nolink|Subtable one-to-many:​ Table Details}} {{:​visionx:​data_modeling_and_representation:​subtable_step2.png?​nolink|Subtable one-to-many:​ Table Details}}
Line 201: Line 201:
 {{:​visionx:​data_modeling_and_representation:​subtable_step4.png?​nolink|Subtable one-to-many:​ Data model}} {{:​visionx:​data_modeling_and_representation:​subtable_step4.png?​nolink|Subtable one-to-many:​ Data model}}
  
-But a clean one-to-many relation in the data model does not fully do the trick. We want each record of EMPLOYEES to be linked to its records in ASSETS, so that whenever we select an employee (only) the assets assigned to that employee are shown. In JVX, this kind of link between table and subtable is called "​Master Reference": ​The subtable only shows records linked to the currently selected record in the master table. When we created the subtable via VisionX, the "​Master Reference"​ was set automatically. In the data-object wizard of the subtable ASSETS, the table EMPLOYEES is specified as master table:+But a clean one-to-many relation in the data model does not fully do the trick. We want each record of EMPLOYEES to be linked to its records in ASSETS, so that whenever we select an employee (only) the assets assigned to that employee are shown. In JVX, this kind of link between table and subtable is called "​Master Reference": ​the subtable only shows records linked to the currently selected record in the master table. When we created the subtable via VisionX, the "​Master Reference"​ was set automatically. In the data-object wizard of the subtable ASSETS, the table EMPLOYEES is specified as master table:
  
 {{:​visionx:​data_modeling_and_representation:​subtable_step4_master.png?​nolink|Subtable one-to-many:​ Master reference}} {{:​visionx:​data_modeling_and_representation:​subtable_step4_master.png?​nolink|Subtable one-to-many:​ Master reference}}
Line 233: Line 233:
 > **See**: More information on the [[http://​www.sibvisions.com/​files/​jvx/​current/​api/​index.html?​javax/​rad/​model/​reference/​ReferenceDefinition.html|ReferenceDefinition of a Master Reference]] is available in the documentation of the JVX API. > **See**: More information on the [[http://​www.sibvisions.com/​files/​jvx/​current/​api/​index.html?​javax/​rad/​model/​reference/​ReferenceDefinition.html|ReferenceDefinition of a Master Reference]] is available in the documentation of the JVX API.
  
-After populating the ASSETS table using the script [[https://​doc.sibvisions.com/​_media/​visionx/​data_modeling_and_representation/​hr_popul_4.sql|hr_popul_4.sql]] your extended web application may now look like this now:+After populating the ASSETS table using the script [[https://​doc.sibvisions.com/​_media/​visionx/​data_modeling_and_representation/​hr_popul_4.sql|hr_popul_4.sql]]your extended web application may now look like this now:
  
 {{:​visionx:​data_modeling_and_representation:​subtable_step5.png?​nolink|Subtable one-to-many:​ Result web}} {{:​visionx:​data_modeling_and_representation:​subtable_step5.png?​nolink|Subtable one-to-many:​ Result web}}
  
-===== Create a many-to-many relation ​=====+===== Create a Many-to-Many Relation ​=====
  
-What about many-to-many relations? There are plenty of real-like scenarios for that, e.g. we may want to select the asset'​s type from a predefined list of types. Assets from each type may be assigned to multiple employees and each employee can have assets of multiple types assigned.+What about many-to-many relations? There are plenty of real-life scenarios for that, e.g.we may want to select the asset'​s type from a predefined list of types. Assets from each type may be assigned to multiple employeesand each employee can have assets of multiple types assigned.
  
 As VisionX is an easy-to-use low-code-platform,​ it does not bother you with the cardinality nor the required relation. Instead of analyzing the data model, you visually design what you need. As VisionX is an easy-to-use low-code-platform,​ it does not bother you with the cardinality nor the required relation. Instead of analyzing the data model, you visually design what you need.
  
-From the employee screen as starting point, we simply want a drop-down ​list for asset'​s type instead a textfield editor. Not a big deal with VisionX.+From the employee screen as starting point, we simply want a dropdown ​list for asset'​s type instead ​of a textfield editor. Not a big deal with VisionX.
  
 Let's define the table ASSET_TYPES by opening the wizard for the data-object "​Assets"​. In order to create a foreign-key relation between the tables ASSETS and ASSET_TYPES,​ we have to recreate the column "​Type"​ (remember that foreign-key relations are only created for new columns, whereas existing columns are linked via an Automatic Link Reference only, as explained in [[#​create_foreign-key_relation_in_an_existing_data_model|Create foreign-key relation in an existing data model]]). Let's define the table ASSET_TYPES by opening the wizard for the data-object "​Assets"​. In order to create a foreign-key relation between the tables ASSETS and ASSET_TYPES,​ we have to recreate the column "​Type"​ (remember that foreign-key relations are only created for new columns, whereas existing columns are linked via an Automatic Link Reference only, as explained in [[#​create_foreign-key_relation_in_an_existing_data_model|Create foreign-key relation in an existing data model]]).
  
-In the wizard, toggle "​Database changes"​ (1), press the (+) Button to create a new column "​Type"​ (2) and finally press "Make Combobox"​ (3).+In the wizard, toggle "​Database changes"​ (1), press the (+) Button to create a new column "​Type"​ (2)andfinallypress "Make Combobox"​ (3).
  
 {{:​visionx:​data_modeling_and_representation:​subtable_step6.png?​nolink|Subtable many-to-many:​ Edit data-object}} {{:​visionx:​data_modeling_and_representation:​subtable_step6.png?​nolink|Subtable many-to-many:​ Edit data-object}}
Line 255: Line 255:
 {{:​visionx:​data_modeling_and_representation:​subtable_step7.png?​nolink|Subtable many-to-many:​ Define ComboBox Details}} {{:​visionx:​data_modeling_and_representation:​subtable_step7.png?​nolink|Subtable many-to-many:​ Define ComboBox Details}}
  
-And that's it! As you can see in the screenshot of the desktop application,​ the asset'​s type is now selectable via a drop-down ​list. You may use the script [[https://​doc.sibvisions.com/​_media/​visionx/​data_modeling_and_representation/​hr_popul_5.sql|hr_popul_5.sql]] to update the test data.+That's it! As you can see in the screenshot of the desktop application,​ the asset'​s type is now selectable via a dropdown ​list. You may use the script [[https://​doc.sibvisions.com/​_media/​visionx/​data_modeling_and_representation/​hr_popul_5.sql|hr_popul_5.sql]] to update the test data.
  
-The many-to-many relation between the tables EMPLOYEES and ASSET_TYPES is graphically represented as two linked tables (EMPLOYEES and ASSETS) with a drop-down ​list for the ASSET_TYPES.+The many-to-many relation between the tables EMPLOYEES and ASSET_TYPES is graphically represented as two linked tables (EMPLOYEES and ASSETS) with a dropdown ​list for the ASSET_TYPES.
  
 {{:​visionx:​data_modeling_and_representation:​subtable_step8.png?​nolink|Subtable many-to-many:​ Define ComboBox Details}} {{:​visionx:​data_modeling_and_representation:​subtable_step8.png?​nolink|Subtable many-to-many:​ Define ComboBox Details}}
  
-Of course, VisionX updated the data model for uswith the new table and the appropriate foreign-key relation:+Of course, VisionX updated the data model for us with the new table and the appropriate foreign-key relation:
  
 {{:​visionx:​data_modeling_and_representation:​subtable_step9.png?​nolink|Subtable many-to-many:​ Data model}} {{:​visionx:​data_modeling_and_representation:​subtable_step9.png?​nolink|Subtable many-to-many:​ Data model}}
  
-===== Specify a table-subtable relation ​in an existing data model =====+===== Specify a Table-Subtable Relation ​in an Existing Data Model =====
  
-And what about defining a table-subtable relation for an existing data model? Let's update our data model with a new table LOCATIONS and link it to DEPARTMENTS with a foreign-key relation using a [[https://​doc.sibvisions.com/​_media/​visionx/​data_modeling_and_representation/​hr_locations.sql|PostgreSQL-Script]].+What about defining a table-subtable relation for an existing data model? Let's update our data model with a new table LOCATIONS and link it to DEPARTMENTS with a foreign-key relation using a [[https://​doc.sibvisions.com/​_media/​visionx/​data_modeling_and_representation/​hr_locations.sql|PostgreSQL-Script]].
  
 The data model looks like this now: The data model looks like this now:
Line 273: Line 273:
 {{:​visionx:​data_modeling_and_representation:​subtable_step10.png?​nolink|Subtable existing model: Data model}} {{:​visionx:​data_modeling_and_representation:​subtable_step10.png?​nolink|Subtable existing model: Data model}}
  
-Let's extend the departments screen by adding a data-object "​Locations"​ for the table LOCATIONS and dragging some of its editors. On the left, I have the list of departments, on the right, the department'​s details and its location.+Let's extend the departments screen by adding a data-object "​Locations"​ for the table LOCATIONS and dragging some of its editors. On the left, I have the list of departments. On the right, the department'​s details and its location.
  
 {{:​visionx:​data_modeling_and_representation:​subtable_step11.png?​nolink|Subtable existing model: Web application}} {{:​visionx:​data_modeling_and_representation:​subtable_step11.png?​nolink|Subtable existing model: Web application}}
  
-Looks nice, but when selecting through the departments,​ the location'​s details do not change. ​How comes? Well, as we created the data model outside VisionX, we have to specify the Master Table manually with just a view mouse clicks.+Looks nice, but when selecting through the departments,​ the location'​s details do not change. ​Why is that? Well, as we created the data model outside VisionX, we have to specify the master table manually with just a few mouse clicks.
  
 ==== Set the Master Reference ==== ==== Set the Master Reference ====
  
-To link the DEPARTMENTS and the LOCATIONS recordsso that the current department'​s location is automatically selected, we have to specify that DEPARTMENTS is the "​Master Table" ​of LOCATIONS (or, with other words, that LOCATIONS is a subtable of DEPARTMENTS).+To link the DEPARTMENTS and the LOCATIONS records so that the current department'​s location is automatically selected, we have to specify that DEPARTMENTS is the master table of LOCATIONS (or, in other words, that LOCATIONS is a subtable of DEPARTMENTS).
  
-Let's open the data-object wizard of "​Locations",​ press "​More.."​ (1), select "​Departments"​ as the "​Master Table" (2) and confirm with "​Finish"​ (3).+Let's open the data-object wizard of "​Locations",​ press "​More.."​ (1), select "​Departments"​ as the "​Master Table" (2)and confirm with "​Finish"​ (3).
  
 {{:​visionx:​data_modeling_and_representation:​subtable_step12.png?​nolink|Subtable existing model: Web application}} {{:​visionx:​data_modeling_and_representation:​subtable_step12.png?​nolink|Subtable existing model: Web application}}
Line 289: Line 289:
 We are done! We are done!
  
-And for the sake of completeness: ​Creating ​a data model that gives a correct reflection of the relationships among the entities is the preferable way to ensure consistent and coherent data. Anyway, under some circumstances you cannot (or may not want to) create a foreign-key relation between table and subtable. In this case, simply create ​"​Automatic Link Reference"​ as described in [[#​create_drop-down_without_foreign-key_relation|Create drop-down without foreign-key relation]] and VisionX will offer the referenced table as Master Table.+For the sake of completeness: ​creating ​a data model that gives a correct reflection of the relationships among the entities is the preferable way to ensure consistent and coherent data. However, under some circumstances you cannot (or may not want to) create a foreign-key relation between table and subtable. In this case, simply create ​an "​Automatic Link Reference"​ as described in [[#​create_drop-down_without_foreign-key_relation|Create drop-down without foreign-key relation]] and VisionX will offer the referenced table as the master table.
  
-To give an example, I added a column LOCA_ID to the assets table (you may use my [[https://​doc.sibvisions.com/​_media/​visionx/​data_modeling_and_representation/​hr_popul_6.sql|script]]) and created an Automatic Link Reference ​between ASSETS and LOCATIONS in the Assets ​screen - check it out!+To give an example, I added a column LOCA_ID to the assets table (you may use my [[https://​doc.sibvisions.com/​_media/​visionx/​data_modeling_and_representation/​hr_popul_6.sql|script]]) and created an automatic link reference ​between ASSETS and LOCATIONS in the assets ​screen - check it out!
  
 ====== Views and Storages ====== ====== Views and Storages ======
  
-Until now, to keep it simple, we have been working with database tables. Of course we are in no way limited to tables as data sources! We can use database views and queries of any complexity. We will investigate some of that more advanced features with the help of a concrete example:+Until now, to keep it simple, we have been working with database tables. Of coursewe are in no way limited to tables as datasources! We can use database views and queries of any complexity. We will investigate some of that more advanced features with the help of a concrete example:
  
-Let's create a screen "​Assets"​ that shows all available assets by their locations. In my mental concept, the location information of my assets is redundant: ​The asset is assigned to a location (after acquisition) and optionally to an employee (when it becomes issued). But what if the employee changes ​its department or the employee'​s department changes its location? Let's assume that the employee (and the department) take their stuff along. That meansthe employee'​s location overrides the asset'​s location. I need a data source ​that provides me the current location of all assets according to that rule.+Let's create a screen "​Assets"​ that shows all available assets by their locations. In my mental concept, the location information of my assets is redundant: ​the asset is assigned to a location (after acquisition) and optionally to an employee (when it becomes issued). But what if the employee changes ​their department or the employee'​s department changes its location? Let's assume that the employee (and the department) take their stuff along. That means the employee'​s location overrides the asset'​s location. I need a datasource ​that provides me the current location of all assets according to that rule.
  
-===== Manipulate the server-side storage ​of your datasource ​=====+===== Manipulate the Server-Side Storage ​of Your Datasource ​=====
  
-Adapting the data provided by a table is straightforward with VisionX. Rememberthat for every data object, a server-side storage is created. We can manipulate that storage to contain the required information.+Adapting the data provided by a table is straightforward with VisionX. Remember that for every data object, a server-side storage is created. We can manipulate that storage to contain the required information.
  
-Open the editor for the server-side storagethat VisionX created for the data objectby pressing the "Edit storages"​ icon on the right side of the lower pane:+Open the editor for the server-side storage that VisionX created for the data object by pressing the "Edit storages"​ icon on the right side of the lower pane:
  
 {{:​visionx:​data_modeling_and_representation:​views_storages_step0.png?​nolink|View as datasource: Edit storage}} {{:​visionx:​data_modeling_and_representation:​views_storages_step0.png?​nolink|View as datasource: Edit storage}}
  
-On the left, we have the list of available storages for the screen. We select the storage "​assets"​ (1) and specify the query that shall be used for the storage:+On the left, we have list of available storages for the screen. We select the storage "​assets"​ (1) and specify the query that shall be used for the storage:
  
 The <query columns> (2) are: The <query columns> (2) are:
Line 336: Line 336:
 {{:​visionx:​data_modeling_and_representation:​views_storages_step4.png?​nolink|Storage as datasource: Create Storage}} {{:​visionx:​data_modeling_and_representation:​views_storages_step4.png?​nolink|Storage as datasource: Create Storage}}
  
-As a foreign-key-relation exists between the table ASSETS and EMPLOYEES, the Automatic Link Reference ​between the corresponding data objects is created automatically. In case of ASSETS and LOCATIONS we have to create the Automatic Link Reference ​manually (as described in [[#​create_drop-down_without_foreign-key_relation|Create ​drop-down without foreign-key relation]]). The generated code for this server-side looks like this:+As a foreign-key-relation exists between the table ASSETS and EMPLOYEES, the automatic link reference ​between the corresponding data objects is created automatically. In the case of ASSETS and LOCATIONSwe have to create the automatic link reference ​manually (as described in [[#​create_drop-down_without_foreign-key_relation|Create ​Dropdown Without Foreign-Key Relation]]). The generated code for this server-side looks like this:
  
 <code java> <code java>
Line 380: Line 380:
 That's it. The data object "​assets"​ will now reference the department'​s location instead of the asset'​s location. That's it. The data object "​assets"​ will now reference the department'​s location instead of the asset'​s location.
  
-===== Use a view as data source ​=====+===== Use a View as Datasource ​=====
  
-If necessary, we could alternatively ​have created a database view like this:+If necessary, we could have alternatively ​created a database view like this:
  
 <code sql> <code sql>
Line 410: Line 410:
 We can use a view in the VisionX data object wizard just like any table. We can use a view in the VisionX data object wizard just like any table.
  
-In the VisionX lower pane, select the "NEW table" tab and press the (+) button to open the wizard. In the wizard, select "Use existing data from database tables"​ and confirm with "Next >", keep the selection "Use Application Database User" and, again, confirm with "Next >". You can now select the view as datasource, note that views have a different icon:+In the VisionX lower pane, select the "NEW table" tab and press the (+) button to open the wizard. In the wizard, select "Use existing data from database tables"​ and confirm with "Next >", keep the selection "Use Application Database User" and, again, confirm with "Next >". You can now select the view as datasource. Note that views have a different icon:
  
 {{:​visionx:​data_modeling_and_representation:​views_storages_step1.png?​nolink|View as datasource: Select view}} {{:​visionx:​data_modeling_and_representation:​views_storages_step1.png?​nolink|View as datasource: Select view}}
  
-Let's verify the server-side storagethat VisionX created for the data objectby pressing the "Edit storages"​ icon on the right side of the lower pane:+Let's verify the server-side storage that VisionX created for the data object by pressing the "Edit storages"​ icon on the right side of the lower pane:
  
 {{:​visionx:​data_modeling_and_representation:​views_storages_step2.png?​nolink|View as datasource: Edit storage}} {{:​visionx:​data_modeling_and_representation:​views_storages_step2.png?​nolink|View as datasource: Edit storage}}
  
-On the left, we have the list of available storages for the screen. Rememberthat for every data object, a server-side storage is created. We select the storage "​vAssetsLocalized",​ which is the storage of our currently created view, to review its settings.+On the left, we have the list of available storages for the screen. Remember that for every data object, a server-side storage is created. We select the storage "​vAssetsLocalized",​ which is the storage of our currently created view, to review its settings.
  
 Per default, the view is set as "​Writeback Table"​. This means, that the application will try to save changes on the data object'​s data in the view itself (which works fine for updateable views or views using INSTEAD OF triggers). Per default, the view is set as "​Writeback Table"​. This means, that the application will try to save changes on the data object'​s data in the view itself (which works fine for updateable views or views using INSTEAD OF triggers).
  
-==== Define the writeback table ====+==== Define the Writeback Table ====
  
-Of course we can name another table or view as the target relation for an INSERT, UPDATE, or DELETE. Let's choose the table "​assets"​. Change the "​Writeback Table" to "​assets"​ (1) and the "​from"​ clause to "​v_assets_localized"​ (2) and confirm your changes with "​Finish"​..+Of coursewe can name another table or view as the target relation for an INSERT, UPDATE, or DELETE. Let's choose the table "​assets"​. Change the "​Writeback Table" to "​assets"​ (1)the "​from"​ clause to "​v_assets_localized"​ (2)and confirm your changes with "​Finish"​.
  
 {{:​visionx:​data_modeling_and_representation:​views_storages_step3.png?​nolink|View as datasource: Edit writeback table}} {{:​visionx:​data_modeling_and_representation:​views_storages_step3.png?​nolink|View as datasource: Edit writeback table}}
  
-Whenever we execute an insert or delete on the data object now, the row will actually ​become ​inserted into or deleted from the table ASSETS. Given that the columns of the view and the writeback table are named equally, any UPDATES on that columns will also target the ASSETS table.+Whenever we execute an insert or delete on the data object now, the row will actually ​be inserted into or deleted from the table ASSETS. Given that the columns of the view and the writeback table are named equally, any UPDATES on that columns will also target the ASSETS table.
  
 This is the generated code for the views server-side storage (after [[#​creating_an_additional_automatic_link_reference|creating an additional Automatic Link Reference]] between V_ASSETS_LOCALIZED and LOCATIONS): This is the generated code for the views server-side storage (after [[#​creating_an_additional_automatic_link_reference|creating an additional Automatic Link Reference]] between V_ASSETS_LOCALIZED and LOCATIONS):
Line 457: Line 457:
     }     }
 </​code>​ </​code>​
-We can use any of the upper data storages ("​Assets"​ or "​VAssetsLocalized"​) for our data object "​Assets"​. I designed this screento contain all relevant information about the asset, the employee currently holding the asset and that employee'​s department. Therefore I created data objects for the tables LOCATIONS and EMPLOYEES and linked ​it to the "​Assets"​ data object by setting [[#​master_references|Master References]]. Moreover I created a data object for the table DEPARTMENTS and made "​EMPLOYEES"​ the Master Table for it. The resulting assets screen looks like this:+We can use any of the upper data storages ("​Assets"​ or "​VAssetsLocalized"​) for our data object "​Assets"​. I designed this screen to contain all relevant information about the asset, the employee currently holding the assetand that employee'​s department. ThereforeI created data objects for the tables LOCATIONS and EMPLOYEES and linked ​them to the "​Assets"​ data object by setting [[#​master_references|Master References]]. MoreoverI created a data object for the table DEPARTMENTS and made "​EMPLOYEES"​ the master table for it. The resulting assets screen looks like this:
  
 {{:​visionx:​data_modeling_and_representation:​views_storages_step7.png?​nolink|Storage as data source: Desktop app Assets}} {{:​visionx:​data_modeling_and_representation:​views_storages_step7.png?​nolink|Storage as data source: Desktop app Assets}}
  
-Anyway, I do not want all that information to be editable in this screen. Let's set some of the data read-only.+However, I do not want all that information to be editable in this screen. Let's set some of the data as read-only.
  
-===== Set data read-only =====+===== Set Data as Read-Only =====
  
-Select the assets screen in designer mode and press the "​Customize"​ button (1) at the top left corner. In the lower part of the popup, VisionX suggest some of the events provided by the currently selected control. We want that the data is set read-only in this screen immediately after the screen is createdlet's therefore click on "​Create On Load" (2).+Select the assets screen in designer mode and press the "​Customize"​ button (1) at the top left corner. In the lower part of the popup, VisionX ​will suggest some of the events provided by the currently selected control. We want that the data is set to read-only in this screen immediately after the screen is createdlet'sthereforeclick on "​Create On Load" (2).
  
 {{:​visionx:​data_modeling_and_representation:​views_storages_step5.png?​nolink|Set data read-only: On Load}} {{:​visionx:​data_modeling_and_representation:​views_storages_step5.png?​nolink|Set data read-only: On Load}}
  
-The "Edit Action"​ window opens. The text in the tab page "​Description"​ will be copied to the documentation of the source code. Let's select the tab page "​Action"​ (1) to specify what shall be done whenever the screen is loaded. Press the drop down list button (2) to see all predefined commands. To avoid scrolling through the list I filter the list by entering "​disable"​ in the editor (3) and press the drop down list button again. Select "​Disable Edit in table" (3).+The "Edit Action"​ window opens. The text in the tab page "​Description"​ will be copied to the documentation of the source code. Let's select the tab page "​Action"​ (1) to specify what shall be done whenever the screen is loaded. Press the dropdown ​list button (2) to see all predefined commands. To avoid scrolling through the listI filter the list by entering "​disable"​ in the editor (3) and press the drop down list button again. Select "​Disable Edit in table" (3).
  
 > **See**: For detailed information on all available VisionX Actions and how to use them, check out the [[:​visionx:​actions|documentation]]. > **See**: For detailed information on all available VisionX Actions and how to use them, check out the [[:​visionx:​actions|documentation]].
Line 475: Line 475:
 {{:​visionx:​data_modeling_and_representation:​views_storages_step6.png?​nolink|Set data read-only: Select command}} {{:​visionx:​data_modeling_and_representation:​views_storages_step6.png?​nolink|Set data read-only: Select command}}
  
-Next we have to specify the data objectthat shall not be editable; we choose "​[Table:​ Departments]"​. To add another action for the same event, drag and drop a command from the right pane to the action table. Let's select "​Disable Edit in table" again, this time for "​[Table:​ Employees]"​.+Nextwe have to specify the data object that shall not be editable; we choose "​[Table:​ Departments]"​. To add another action for the same event, drag and drop a command from the right pane to the action table. Let's select "​Disable Edit in table" again, this time for "​[Table:​ Employees]"​.
  
-I still want to be able to change the employeethat is the current holder of the asset. Therefore I bind the editor "Last Name" to the column "Last Name" of the "​Localized Assets"​ storage (which is editable). In designer mode, select the editor and press the "​Customize"​ icon (1). Open the Binding ​drop-down ​list (2) and choose "​[Localized Assets.Last Name]" (3) as binding for that editor.+I still want to be able to change the employee that is the current holder of the asset. ThereforeI bind the editor "Last Name" to the column "Last Name" of the "​Localized Assets"​ storage (which is editable). In designer mode, select the editor and press the "​Customize"​ icon (1). Open the Binding ​dropdown ​list (2) and choose "​[Localized Assets.Last Name]" (3) as binding for that editor.
  
 {{:​visionx:​data_modeling_and_representation:​views_storages_step8.png?​nolink|Set data read-only: Change editor binding}} {{:​visionx:​data_modeling_and_representation:​views_storages_step8.png?​nolink|Set data read-only: Change editor binding}}
  
-Done! My asset screen is ready to usewithout writing even one line of Java code:+Done! My asset screen is ready to use without writing even one line of Java code:
  
 {{:​visionx:​data_modeling_and_representation:​views_storages_step9.png?​nolink|Set data read-only: result web}} {{:​visionx:​data_modeling_and_representation:​views_storages_step9.png?​nolink|Set data read-only: result web}}
Line 487: Line 487:
 ====== Filters ====== ====== Filters ======
  
-To be honest, showing the location table in the departments screen is dispensable. As my use-case is to show all available assets by their locations, I could have done easier ​by creating a filter editor for the asset'​s location. Let's give a try:+To be honest, showing the location table in the departments screen is dispensable. As my use-case is to show all available assets by their locations, I could have done so more easily ​by creating a filter editor for the asset'​s location. Let's give that a try:
  
 Open the "​Assets with Filter"​ screen in designer view and drag and drop the "​Search"​ editor (1) to the screen (2). Open the "​Assets with Filter"​ screen in designer view and drag and drop the "​Search"​ editor (1) to the screen (2).
Line 493: Line 493:
 {{:​visionx:​data_modeling_and_representation:​filters_step1.png?​nolink|Filters:​ add filter}} {{:​visionx:​data_modeling_and_representation:​filters_step1.png?​nolink|Filters:​ add filter}}
  
-Select the editor, press the "​Customize"​ icon (1) and specify the Search Mode in the lower part of the popup. Let's select "​Like"​ as search mode (2) and "​[Localized Assets.Location]"​ as column (3) to search in.+Select the editor, press the "​Customize"​ icon (1)and specify the search mode in the lower part of the popup. Let's select "​Like"​ as search mode (2) and "​[Localized Assets.Location]"​ as column (3) to search in.
  
 {{:​visionx:​data_modeling_and_representation:​filters_step2.png?​nolink|Filters:​ specify filter}} {{:​visionx:​data_modeling_and_representation:​filters_step2.png?​nolink|Filters:​ specify filter}}
  
-VisionX automatically creates a drop-down ​list for the location filter editor due to the Automatic Link Reference ​between the storage [Localized Assets.Location] and the table LOCATIONS. But the "​Like"​ filter does more than simple text matching. You can use the wildcard character ? as placeholder for any single character and * or % as placeholders for any number of characters.+VisionX automatically creates a dropdown ​list for the location filter editor due to the automatic link reference ​between the storage [Localized Assets.Location] and the table LOCATIONS. But the "​Like"​ filter does more than simple text matching. You can use the wildcard character ? as placeholder for any single character and * or % as placeholders for any number of characters.
  
 For example, you may want to filter for assets at locations starting with "​South"​ (such as **South**lake,​ **South** San Francisco or **South** Brunswick) by entering "​South*"​ (or "​South%"​) into the location filter editor. Or you enter "​*en*"​ (or "​%en%"​) to get all assets at locations containing "​en"​ (such as "UK C**en**tral"​ or "​V**en**ice"​). For example, you may want to filter for assets at locations starting with "​South"​ (such as **South**lake,​ **South** San Francisco or **South** Brunswick) by entering "​South*"​ (or "​South%"​) into the location filter editor. Or you enter "​*en*"​ (or "​%en%"​) to get all assets at locations containing "​en"​ (such as "UK C**en**tral"​ or "​V**en**ice"​).
Line 505: Line 505:
 {{:​visionx:​data_modeling_and_representation:​filters_step3.png?​nolink|Filters:​ result desktop}} {{:​visionx:​data_modeling_and_representation:​filters_step3.png?​nolink|Filters:​ result desktop}}
  
-===== Filters ​use IConditions =====+===== Filters ​Use IConditions =====
  
 How does this work? Each filter editor creates an [[http://​www.sibvisions.com/​files/​jvx/​current/​api/​index.html?​javax/​rad/​model/​condition/​ICondition.html|ICondition]] and is connected to other conditions by the logical operator AND. In other words, if multiple filters are set, the result contains only those rows that match all of the filters. How does this work? Each filter editor creates an [[http://​www.sibvisions.com/​files/​jvx/​current/​api/​index.html?​javax/​rad/​model/​condition/​ICondition.html|ICondition]] and is connected to other conditions by the logical operator AND. In other words, if multiple filters are set, the result contains only those rows that match all of the filters.
  
-Of course VisionX supports more than one search mode to use in filters and conditions. These are:+Of courseVisionX supports more than one search mode to use in filters and conditions. These are:
  
 ^Search mode       ​^Description ​                                                                                                                                ^ ^Search mode       ​^Description ​                                                                                                                                ^
Line 521: Line 521:
 |**Starts with** ​  ​|Matches all literals that start with the entered value ignoring the character casing. <​html><​br></​html>​Supports ?, * and % as wildcards. ​   | |**Starts with** ​  ​|Matches all literals that start with the entered value ignoring the character casing. <​html><​br></​html>​Supports ?, * and % as wildcards. ​   |
  
-All the above filters operate on a specific column.+All of the above filters operate on a specific column.
  
-===== Full text search ​=====+===== Full Text Search ​=====
  
-And what about the default search editorwe've used in all our screens so far? If you just drag and drop the "​Search"​ editor to a screen, a filter with the following specification is created:+What about the default search editor we've used in all of our screens so far? If you just drag and drop the "​Search"​ editor to a screen, a filter with the following specification is created:
  
 ^Search mode         ​^Description ​                                                                                                         ^ ^Search mode         ​^Description ​                                                                                                         ^
Line 532: Line 532:
 The "full text search filter"​ operates on all columns of the data object. The "full text search filter"​ operates on all columns of the data object.
  
-===== Specify a BETWEEN ​filter ​=====+===== Specify a BETWEEN ​Filter ​=====
  
-Let's implement the possibility to filter for assets issued in a specific ​timespan, in other words, between two dates. Simply drag and drop two Search Editors ​and bind them to "​[Localized Assets.Issue Date]" (1). Use "​Greater equals"​ (2) for the first filter and "Less equals"​ for the second filter.+Let's implement the possibility to filter for assets issued in a specific ​time span, in other words, between two dates. Simply drag and drop two search editors ​and bind them to "​[Localized Assets.Issue Date]" (1). Use "​Greater equals"​ (2) for the first filter and "Less equals"​ for the second filter.
  
 {{:​visionx:​data_modeling_and_representation:​filters_step4.png?​nolink|Filters:​ specify between filters}} {{:​visionx:​data_modeling_and_representation:​filters_step4.png?​nolink|Filters:​ specify between filters}}
This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information