Trace:
Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
visionx:actions [2019/07/01 11:40] robot |
visionx:actions [2023/04/04 11:03] (current) robot |
||
---|---|---|---|
Line 2: | Line 2: | ||
~~Title: VisionX Actions~~ | ~~Title: VisionX Actions~~ | ||
- | Version: 5.0 / 2019-07-01 | + | Version: 1.0 / 2023-04-04 |
====== Introduction ====== | ====== Introduction ====== | ||
- | VisionX actions allow the user to add more functionality/features to their applications. Actions are used to implement functions in workscreens, such as clicking a button named "Report" to open a report, or calculating the value ''%%QUANTITY * PRICE%%'' in the "SUM" column based on a value change in the "QUANTITY" column. | + | This chapter is about adding functionality and features to a screen. |
- | There are numerous examples for the use of actions. The following chapters will explain the functionality of actions using common examples. | + | For example, open a document on button click, calculate values after user input or log user changes, like when and who edited the record the last time. Of course, there are many more actions which we will look at in detail below. |
- | We will begin with the basics. | + | VisionX allows this very easily via events and actions. |
+ | |||
+ | The chapter is divided into the following sections: | ||
+ | |||
+ | * Basics | ||
+ | * Events | ||
+ | * Actions | ||
+ | * Formulas | ||
+ | * Parameter | ||
+ | * List of events | ||
+ | * List of actions | ||
+ | * List of conditions | ||
+ | * List of formulas | ||
+ | |||
+ | Let's start with the basics. | ||
====== Basics ====== | ====== Basics ====== | ||
- | Actions are created, edited and deleted via VisionX's GUI designer. They can be used for a number of events, such as, for example, the click of a button. When the selected event occurs during the use of a workscreen, the respective action is performed. | + | Events define when something happens and actions what happens. |
- | Example: When the event "button click" occurs, the specified action is executed. For example, the action can show a a report. | + | In the previously mentioned examples events are click on a button ('create action'), user input ('row value changed') or data change ('after updating row'). |
- | The following steps show how a report is displayed after the click of a button labeled "Report". | + | The equivalent actions are open a document ('show file'), calculate values ('calculate value') and update modified values ('set value'). |
- | ====== Define Actions ====== | + | ===== Events ===== |
- | The following steps demonstrate the definition of a simple action. | + | Let's have a closer lock on events. In order to add an action you must first think of the event which will trigger the action. |
- | Example: Displaying a report by clicking a button labeled "Report". | + | Screens, Tabsets, Editing Panels, Tables, Input Fields, Buttons and Hyperlinks have a lot of different events. A List of all these events and their description is provided below (see [[#list_of_events|List of events]]). |
- | - Open a workscreen in the GUI Designer - e.g.: the "Contacts" workscreen | + | ==== Create / edit event ==== |
- | - Select the "Report" button in the GUI Designer and click on the pencil icon | + | |
- | {{:visionx:actions:add-action-1.png?nolink|Step 2 - Create a new action}} | + | If you open the customizer with a right click on an element, a list of all possible events is displayed. |
- | <HTML><ol start="3" style="list-style-type: decimal;"></HTML> | + | After selecting the desired event, the action wizard will be opened. |
- | <HTML><li></HTML>Click on the button "Create/Edit Action" to create/edit an action<HTML></li></HTML><HTML></ol></HTML> | + | |
- | {{:visionx:actions:add-action-2.png?nolink|Step 3 - The Action Wizard}} | + | {{:visionx:actions:actions1.png?nolink|}} |
- | <HTML><ol start="4" style="list-style-type: decimal;"></HTML> | + | For example, if you want to show an uploaded image on button click you have to open the customizer with a right click on the button (1). |
- | <HTML><li></HTML>Enter a description of the action on the "Description" tab<HTML></li></HTML> | + | |
- | <HTML><li></HTML>Click on the "Action" tab and select "Show Report"<HTML></li></HTML><HTML></ol></HTML> | + | |
- | {{:visionx:actions:add-action-3.png?nolink|Step 5 - Select the correct action.}} | + | At the bottom of the customizer a list of all possible events is displayed (2). |
- | <HTML><ol start="6" style="list-style-type: decimal;"></HTML> | + | If you click on one of the events, the edit action wizard is opened. |
- | <HTML><li></HTML>Select the desired report as parameter<HTML></li></HTML><HTML></ol></HTML> | + | |
- | {{:visionx:actions:add-action-4.png?nolink|Step 6 - The finished report action.}} | + | {{:visionx:actions:actions2_1.png?nolink|}} |
- | <HTML><ol start="7" style="list-style-type: decimal;"></HTML> | + | ===== Actions ===== |
- | <HTML><li></HTML>Click the "Verify" button and then "OK" to verify and save<HTML></li></HTML><HTML></ol></HTML> | + | |
- | This completes the action. It can be tested by closing the GUI Designer and changing to runtime mode. Clicking the "Report" button opens the "Contacts" report. | + | In the edit action wizard, you have 3 different tabs. |
- | Also, all selection lists can be searched for values using *. E.g.: "*show" to search for all commands containing "show". | + | {{:visionx:actions:actions2.png?nolink|}} |
- | ====== Documentation / Software Developer Specification ====== | + | In the first tab **'Description'** (1) you can describe the functionality of the element. |
- | When an action is created, the first tab of the action wizard can be used to add a description. Our experience shows that unfortunately the documentation of applications is often neglected, or when it is created, not kept up to date. VisionX offers a great advantage through the universal use of a centralized description throughout the entire application. Consistent updating of the documentation requires little effort and should not be neglected. It particularly simplifies and shortens communication efforts when parts of the development tasks are transferred to suppliers. | + | This description will be added in the documentation (Help or Specification) which can be generated in VisionX. |
- | In VisionX, the description of the action on the first tab of the action wizard is used for the following: | + | The description will also be used as documentation directly in the generated source code. |
- | <HTML><ul></HTML> | + | The second tab **'Action'** (2) offers the possibility to create or edit the actions. |
- | <HTML><li></HTML><HTML><p></HTML>Description of the action in the specification document.<HTML></p></HTML> | + | |
- | <HTML><p></HTML>This text serves as specification of the action for the software developer!<HTML></p></HTML> | + | |
- | Specification documents make it easy to outsource certain functions to software providers / IT departments.<HTML></li></HTML> | + | |
- | <HTML><li></HTML>Description of the action in the application's online help.<HTML></li></HTML> | + | |
- | <HTML><li></HTML><HTML><p></HTML>Description of the action in the function header (Javadoc) of the action-function in the Java source code.<HTML></p></HTML> | + | |
- | <HTML><p></HTML>Changes to the description text (Javadoc) in the source code are automatically transferred verbatim to the VisionX action editor.<HTML></p></HTML> | + | |
- | <HTML><p></HTML>This makes it easy to keep the documentation up to date!<HTML></p></HTML><HTML></li></HTML><HTML></ul></HTML> | + | |
- | ====== Command Categories ====== | + | When you are an advanced user, it is possible to edit the source code directly. This can be done in the tab **'Source Code'** (3). The changes must be validated too. |
- | There are different types of commands in VisionX: | + | For each action an example of the generated java code is provided, which can also be inserted or edited directly in the source code tab. |
- | <HTML><ul></HTML> | + | ==== Tab Action ==== |
- | <HTML><li></HTML><HTML><p></HTML>Commands<HTML></p></HTML> | + | |
- | Commands execute predefined operations. They can include parameters that are considered when the action is performed.<HTML></li></HTML> | + | |
- | <HTML><li></HTML><HTML><p></HTML>Conditions<HTML></p></HTML> | + | |
- | <HTML><p></HTML>Conditions allow for the execution of commands in dependence on whether the condition is met or not.<HTML></p></HTML> | + | |
- | Example: If the currently registered user has the "Administrator" role, all fields on the workscreen are visible. If the user does not have this role, only selected fields are shown.<HTML></li></HTML> | + | |
- | <HTML><li></HTML><HTML><p></HTML>Loops<HTML></p></HTML> | + | |
- | <HTML><p></HTML>Loops are used to execute commands multiple times for the datasets of a table/view.<HTML></p></HTML> | + | |
- | <HTML><p></HTML>Example: Sending an email to all contacts.<HTML></p></HTML><HTML></li></HTML><HTML></ul></HTML> | + | |
- | ====== Commands ====== | + | In this tab you can configure the actions. |
- | Commands execute predefined operations, considering the specified parameters. | + | {{:visionx:actions:actions3.png?nolink|}} |
- | ===== Formulas in commands ===== | + | The action and the needed parameters are called **'Command'** (1). |
- | A number of commands can include the use of formulas. E.g. "Calculate Value". | + | For example 'show file' with the parameters 'Filename' and 'Content' is a command. |
- | Formulas allow for the calculation of values using basic arithmetic operations, as well as a variety of group functions. For arithmetic operations ''%%+%%'',''%%-%%'',''%%*%%'', ''%%/%%'' and brackets ''%%(%%'' ''%%)%%'' can be used. E.g.: ''%%12 *23 / 2 + (1 - [Items.Quantity] * [Items.Price]) - [Booking.Discount]%%''. | + | A command is one of 3 possible statements (2). |
- | Group functions calculate results based on all values in a table column. A list is created using each row in the table column; the group function is then applied to this list. E.g. ''%%avg([Items.Price])%%'' which returns the average of the prices in the table "Items". | + | The statements are **'Command'**, **'Condition'** and **'Repeat'**. |
- | In addition, all functions are available in the variant to return ''%%null%%'' if all values in the column were ''%%null%%''. These variants have the same name but are postfixed with "Null", E.g. ''%%avgNull([Items.Price])%%''. For additional information see [[http://en.wikipedia.org/wiki/Null_(SQL)|the Wikipedia entry on SQL Null]]. | + | Statements can be selected and combined as often as desired. |
- | ==== avg / avgNull ==== | + | The configured statements can be checked using 'Validate'. (3) The wizard remains open and changes can still be made. |
- | Returns the average of all values. | + | With 'Finish' (4) the generated code is also checked, applied and the wizard is closed. |
- | <code> | + | 'Cancel' (4) discards all changes and closes the wizard. |
- | avg([Items.Price]) | + | |
- | avgNull([Items.Price]) | + | ==== Create Statements ==== |
+ | |||
+ | It is possible to add more than one statements to an event. | ||
+ | |||
+ | To add another statement it must be dragged from the statement block and dropped into the existing list of statements in the appropriate order. | ||
+ | |||
+ | {{:visionx:actions:actions5.png?nolink|}} | ||
+ | |||
+ | Therefore, you can select and drag the statement out from the right box (1) into the list of actions. | ||
+ | |||
+ | The black line indicates where the statement will be placed (2). | ||
+ | |||
+ | ==== Sort Statements ==== | ||
+ | |||
+ | It is also possible to change the order of the statements. | ||
+ | |||
+ | {{:visionx:actions:actions3_4.png?nolink|}} | ||
+ | |||
+ | To do this, move the mouse pointer to the left over the statement and start the move mode as already described for adding a new statement. | ||
+ | |||
+ | ==== Delete Statements ==== | ||
+ | |||
+ | A statement can be deleted using the red cross to the right of the statement. | ||
+ | |||
+ | {{:visionx:actions:actions3_2_2.png?nolink|}} | ||
+ | |||
+ | It's also possible to delete all statements of an event. Therefore you must click the red cross next to the event. | ||
+ | |||
+ | //{{:visionx:actions:actions8.png?nolink|}}// | ||
+ | |||
+ | ==== Command ==== | ||
+ | |||
+ | By default, an empty command is added in the wizard and you can select the appropriate action. | ||
+ | |||
+ | {{:visionx:actions:actions3_1.png?nolink|}} | ||
+ | |||
+ | Let's look at our example 'show file'. | ||
+ | |||
+ | {{:visionx:actions:actions3_2.png?nolink|}} | ||
+ | |||
+ | The action 'show file' for example, opens the selected file stored in a data table. | ||
+ | |||
+ | This action needs two parameters which you need to select from the corresponding table. The first one is the filename and the second the file itself. | ||
+ | |||
+ | ==== Condition ==== | ||
+ | |||
+ | Now let's look at conditions. With conditions it's possible to perform an action only if a certain condition is met. | ||
+ | |||
+ | {{:visionx:actions:actions6.png?nolink|}} | ||
+ | |||
+ | Therefore, you must drag a condition out of the right statement box (1). | ||
+ | |||
+ | Now you can define the condition when the action has to be performed. | ||
+ | |||
+ | For example, if a file was uploaded (2) no action is performed, if a file was uploaded the file is displayed (3). | ||
+ | |||
+ | ==== Repeat ==== | ||
+ | |||
+ | It's also possible to perform an action for each row in a table. | ||
+ | |||
+ | {{:visionx:actions:actions7.png?nolink|}} | ||
+ | |||
+ | Therefore, you must drag a repeat statement out of the statement box on the right side (1). | ||
+ | |||
+ | Now you can decide for which table the action should be performed (2). | ||
+ | |||
+ | In this example an email is sent to each contact stored in the table (3). | ||
+ | |||
+ | ==== Validate, Finish and Cancel ==== | ||
+ | |||
+ | After an event has been configured, it still needs to be validated. | ||
+ | |||
+ | {{:visionx:actions:actions3_5.png?nolink|}} | ||
+ | |||
+ | The configured statements can be validated using 'Validate'. (1) The wizard remains open and changes can still be made. | ||
+ | |||
+ | With 'Finish' (2) the generated code is also validated, but applied and the wizard is closed. | ||
+ | |||
+ | 'Cancel' (2) discards all changes and closes the wizard. | ||
+ | |||
+ | ==== Search for actions ==== | ||
+ | |||
+ | There are two possible ways to search for actions. | ||
+ | |||
+ | The first option is to open the drop down box in the action wizard and enter a search term. | ||
+ | |||
+ | For example, if you search for 'value' only actions with the term 'value' are displayed. | ||
+ | |||
+ | {{:visionx:actions:actions9.png?nolink|}} | ||
+ | |||
+ | The second possibility is to open the search wizard (1) with the button '...' (2) next to the dropdwonbox. | ||
+ | |||
+ | {{:visionx:actions:actions10.png?nolink|}} | ||
+ | |||
+ | You can either search for a term (1) or filter all actions by category (2). It's also possible to combine both. | ||
+ | |||
+ | {{:visionx:actions:actions11.png?nolink|}} | ||
+ | |||
+ | If an action is selected all required parameters and a short description are displayed below. | ||
+ | |||
+ | ==== Create, Edit or Delete ==== | ||
+ | |||
+ | In the customizer you can see if actions are configured and it's possible to delete or edit them. | ||
+ | |||
+ | //{{:visionx:actions:actions4.png?nolink|}}// | ||
+ | |||
+ | Events with attached actions are now renamed to 'edit …' (1) on click the action wizard is opened and shows the actions. | ||
+ | |||
+ | With the red cross next to the event you can delete all defined statements (2). | ||
+ | |||
+ | Events with no action are still named 'create….' (3). | ||
+ | |||
+ | ===== Formulas ===== | ||
+ | |||
+ | A number of actions can include the use of formulas. | ||
+ | |||
+ | These actions can be recognized by the fact that the parameter input field is marked with "Formula", which are: | ||
+ | |||
+ | * [[#calculate_value|Calculate value]] | ||
+ | * [[#set_label_with_calculated_currency|Set label with calculated currency]] | ||
+ | * [[#set_label_with_calculated_date|Set label with calculated date]] | ||
+ | * [[#set_label_with_calculated_date_short|Set label with calculated date short]] | ||
+ | * [[#set_label_with_calculated_date_time|Set label with calculated date time]] | ||
+ | * [[#set_label_with_calculated_date_time_short|Set label with calculated date time short]] | ||
+ | * [[#set_label_with_calculated_time|Set label with calculated time]] | ||
+ | * [[#set_label_with_calculated_value|Set label with calculated value]] | ||
+ | * [[#set_parameter_with_calculated_value|Set Parameter with calculated value]] | ||
+ | |||
+ | There are lots of arithmetic operations, group functions, date calculation and text operations available. | ||
+ | |||
+ | A forumla is directly written in the formula field of an action. | ||
+ | |||
+ | {{:visionx:actions:formulas.png?nolink|}} | ||
+ | |||
+ | For a list of possible formulas see [[#list_of_formulas|List of formulas]] | ||
+ | |||
+ | ===== Parameters ===== | ||
+ | |||
+ | Parameters can be used to temporarily store values and reuse them within the screen or pass parameters to a screen. | ||
+ | |||
+ | When the screen is closed, the parameter and the corresponding value are no longer available. | ||
+ | |||
+ | There are the following actions to set or calculate parameters: | ||
+ | |||
+ | * [[#set_parameter|Set Parameter]] | ||
+ | * [[#set_parameter_with_calculated_value|Set Parameter with calculated value]] | ||
+ | * [[#set_parameter_with_concatenated_text|Set Parameter with concatenated text]] | ||
+ | |||
+ | ====== List of events ====== | ||
+ | |||
+ | ===== Screen ===== | ||
+ | |||
+ | ==== On Load ==== | ||
+ | |||
+ | This event is triggered if the screen is initialized. As long as the screen is not closed and reopened this event will not be executed again. | ||
+ | |||
+ | In this event everything should be implemented that influences the screen directly. For example, hide elements due to roles, control access to tables (edit, update, delete), set filters... | ||
+ | |||
+ | ==== On Active ==== | ||
+ | |||
+ | This event is triggered each time the screen gets active. | ||
+ | |||
+ | For example, if you open the screen or activate the screen through an action from another screen or through a menu. | ||
+ | |||
+ | For example, if ID parameters are passed to the screen, they will be used in this action. | ||
+ | |||
+ | ==== On Close ==== | ||
+ | |||
+ | This event is triggered short before the screen is closed. | ||
+ | |||
+ | With this event it is possible to prevent the closing throug an exception. | ||
+ | |||
+ | ===== Tabset / Editing Panel ===== | ||
+ | |||
+ | ==== Tab Activated ==== | ||
+ | |||
+ | If a tab of a tabset is activated this event is triggered. | ||
+ | |||
+ | ===== Table / Input Fields ===== | ||
+ | |||
+ | ==== Row Value Changed ==== | ||
+ | |||
+ | Every time a value of the selected table is changed, this event is triggered. The event is triggered when the input field is deselected. | ||
+ | |||
+ | Hint: With this action you can create a log that saves any user changes. For more information see | ||
+ | |||
+ | It is good practice to add changed_on, created_on table columns for all relevant tables. | ||
+ | |||
+ | ==== Before Row Selected ==== | ||
+ | |||
+ | Is triggered before a row in a table is selected. | ||
+ | |||
+ | ==== After Row Selected ==== | ||
+ | |||
+ | Is triggered after a row in a table was selected. | ||
+ | |||
+ | ==== Before Inserting Row ==== | ||
+ | |||
+ | Is triggered before the data row is inserted in the memory. | ||
+ | |||
+ | ==== After Inserting Row ==== | ||
+ | |||
+ | Is triggered after the data row is inserted in the memory. | ||
+ | |||
+ | ==== Before Inserted Row ==== | ||
+ | |||
+ | Is triggered before the data row is inserted in the database. | ||
+ | |||
+ | ==== After Inserted Row ==== | ||
+ | |||
+ | Is triggered after the data row is inserted in the database. | ||
+ | |||
+ | ==== Before updating Row ==== | ||
+ | |||
+ | Is triggered before the data row is updated in the memory. | ||
+ | |||
+ | ==== After Updating Row ==== | ||
+ | |||
+ | Is triggered after the data row is updated in the memory. | ||
+ | |||
+ | ==== Before Updated Row ==== | ||
+ | |||
+ | Is triggered before the data row is updated in the database. | ||
+ | |||
+ | ==== After Updated Row ==== | ||
+ | |||
+ | Is triggered after the data row is inserted in the database. | ||
+ | |||
+ | ==== Before Deleting Row ==== | ||
+ | |||
+ | Is triggered before the data row is deleted from the memory. | ||
+ | |||
+ | ==== After Deleting Row ==== | ||
+ | |||
+ | Is triggered after the data row is deleted from the memory. | ||
+ | |||
+ | ==== Before Deleted Row ==== | ||
+ | |||
+ | Is triggered before the data row is deleted from the database. | ||
+ | |||
+ | ==== After Deleted Row ==== | ||
+ | |||
+ | Is triggered after the data row is deleted from the database. | ||
+ | |||
+ | ==== Before Restore Row ==== | ||
+ | |||
+ | If the action Restore selected record is executed, this event is triggered before restoring the row. | ||
+ | |||
+ | The data is taken from the memory and no database query is performed. | ||
+ | |||
+ | ==== After Restore Row ==== | ||
+ | |||
+ | If the action Restore selected record is executed, this event is triggered before restoring the row. | ||
+ | |||
+ | The data is taken from the memory and no database query is performed. | ||
+ | |||
+ | ==== Before Reload Row ==== | ||
+ | |||
+ | If any reload action is executed, this event is triggered before reloading the selected row. | ||
+ | |||
+ | The data is fetched from the database. | ||
+ | |||
+ | ==== After Reload Row ==== | ||
+ | |||
+ | If any reload action is executed, this event is triggered after reloading the selected row. | ||
+ | |||
+ | The data is fetched from the database. | ||
+ | |||
+ | ===== Button / Hyperlink ===== | ||
+ | |||
+ | ==== Create Action ==== | ||
+ | |||
+ | This event is triggered every time the button / hyperlink is clicked. | ||
+ | |||
+ | ===== Validator ===== | ||
+ | |||
+ | ==== Create Validation ==== | ||
+ | |||
+ | This event is triggered every time the validator is used. | ||
+ | |||
+ | ====== List of actions ====== | ||
+ | |||
+ | ===== Application ===== | ||
+ | |||
+ | ==== Logout ==== | ||
+ | |||
+ | The current user is logged out. | ||
+ | |||
+ | <code java> | ||
+ | ((ProjX)getApplication()).doLogout(null); | ||
</code> | </code> | ||
- | ==== min / minNull ==== | + | ==== Reload all screens ==== |
- | Returns the smallest value. | + | Discards all unsaved changes and reloads all screens. |
- | <code> | + | <code java> |
- | min([Items.Price]) | + | ((ProjX)getApplication()).doReload(); |
- | minNull([Items.Price]) | + | |
</code> | </code> | ||
- | ==== max / maxNull ==== | + | ==== Show error message ==== |
- | Returns the largest value. | + | Shows a message in an error dialogue. |
- | <code> | + | ^Parameter ^Description ^Example ^ |
- | max([Items.Price]) | + | |**Message** |Error message with reference to all databook columns and parameters of the screen |**[Contacts.Lastname] is missing!** | |
- | maxNull([Items.Price]) | + | |
+ | <code java> | ||
+ | showError(this,Text.val(new Var(rdbContacts,"LASTNAME")) + " is missing!"); | ||
</code> | </code> | ||
- | ==== count / countNull ==== | + | ==== Show information message ==== |
- | Returns the number of entries. | + | Shows a message in an information dialogue. |
- | <code> | + | ^Parameter ^Description ^Example ^ |
- | count([Items.Price]) | + | |**Message** |Information message with reference to all databook columns and parameters of the screen |**[Contacts.Lastname] is missing!** | |
- | countNull([Items.Price]) | + | |
+ | <code java> | ||
+ | showInformation(this,Text.val(new Var(rdbContacts,"LASTNAME")) + " is missing!"); | ||
</code> | </code> | ||
- | ==== sum / sumNull ==== | + | ==== Silent abort ==== |
- | Returns the sum of all values. | + | Cancels current execution without showing a message. |
- | <code> | + | <code java> |
- | sum([Items.Price]) | + | throw new SilentAbortException(); |
- | sumNull([Items.Price]) | + | |
</code> | </code> | ||
- | ==== sumToCurrent / sumToCurrentNull ==== | + | ===== Data management ===== |
- | Returns the sum of values from the first row to the selected row. | + | ==== Ask before delete ==== |
- | <code> | + | Shows an 'are you sure...' question before deleting a record within the selected table. |
- | sumToCurrent([Items.Price]) | + | |
- | sumToCurrentNull([Items.Price]) | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |Table name |**[Table: Contacts]** | | ||
+ | |||
+ | <code java> | ||
+ | ProjXUtil.addAskDeleteDialog(rdbContacts); | ||
</code> | </code> | ||
- | ==== first / firstNull ==== | + | ==== Assign column name ==== |
- | Returns the first value. | + | Assigns the column name where data should be stored. |
- | <code> | + | ^Parameter ^Description ^Example ^ |
- | first([Items.Price]) | + | |**Element** |the element |**[Editor: Contacts.Street]** | |
- | firstNull([Items.Price]) | + | |**Name** |the name of the column |**[Street]** | |
+ | |||
+ | <code java> | ||
+ | editContactsStreet.setColumnName("STREET"); | ||
</code> | </code> | ||
- | ==== last / lastNull ==== | + | ==== Assign table ==== |
- | Returns the last value. | + | Assigns the table which should be used for displaying data. If a table has been dragged into a screen, it can be replaced by another table. |
- | <code> | + | ^Parameter ^Description ^Example ^ |
- | first([Items.Price]) | + | |**Element** |the table view which should be replaced |**[TableView: Contacts]** | |
- | firstNull([Items.Price]) | + | |**Name** |the new assigned table |**[Table: Professions]** | |
+ | |||
+ | <code java> | ||
+ | tableContacts.setDataBook(rdbProfessions); | ||
</code> | </code> | ||
- | ===== List of all commands ===== | + | ==== Assign table for editor ==== |
- | The following table shows all commands, descriptions, parameters, examples, and the resulting Java Code: Command Description including Parameters and Example Java-Code | + | Assigns the table which should be used for displaying data of an editor . |
- | ==== Workscreen commands ==== | + | Hint: For example, a search field can be assigned to another table that will be searched. |
- | === Open screen === | + | ^Parameter ^Description ^Example ^ |
+ | |**Editor** |editor, search, validator |**[Search: Customers.*]** | | ||
+ | |**Table** |the table |**[Table: Contacts]** | | ||
- | Opens the specified workscreen. | + | <code java> |
+ | filterCustomers.setDataRow(rdbContacts); | ||
+ | </code> | ||
+ | ==== Calculate value ==== | ||
- | Parameters: ''%%[List of all Workscreens]%%'' | + | Calculates a value based on dynamic or fixed data and sets the result into a column (see [[#list_of_formulas|List of Formulas]]. The value can be calculated with any values from other tables, with parameters or specific texts. |
- | Example: Open Workscreen | User Management | + | ^Parameter ^Description ^Example ^ |
+ | |**Write to** |the column where the value is stored |**[Products.total]** | | ||
+ | |**Formula** |the calculation |**[Products.price]*[Products.quantity]** | | ||
- | <code> | + | <code java> |
- | getApplication().openWorkScreen("contacts.client.workscreens.ContactsWorkscreen") | + | Calc.set(new Var(rdbProducts,"TOTAL"),Calc.val(new Var(rdbProducts,"PRICE")) * Calc.val(new Var(rdbProducts,"QUANTITY"))); |
</code> | </code> | ||
- | === Close screen === | + | ==== Create unique identifier ==== |
- | Closes the specified workscreen. | + | Creates a unique identifier and sets the value into a selected column. |
- | Parameters: ''%%[List of all Workscreens]%%'' | + | ^Parameter ^Description ^Example ^ |
+ | |**Write to** |the column where the value is stored |**[Products.product key]** | | ||
- | Example: Close Workscreen | User Management | + | <code java> |
+ | DataBookUtil.createUniqueIdentifier(new Var(rdbProducts,"PRODUCT_KEY")); | ||
+ | </code> | ||
+ | ==== Delete all records ==== | ||
- | <code> | + | Deletes all records in the selected table. |
- | ((ProjX)getApplication()).close("contacts.client.workscreens.ContactsWorkscreen") | + | |
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Table** |the table |**[Table:Products]** | | ||
+ | |||
+ | <code java> | ||
+ | rdbProducts.deleteAllRows(); | ||
</code> | </code> | ||
- | === Center screen === | + | ==== Delete record ==== |
- | Centers the current workscreen (horizontally and vertically). | + | Deletes the selected/current record in the selected table. |
- | Example: Center Workscreen | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |the table |**[Table:Products]** | | ||
- | <code> | + | <code java> |
- | center() | + | rdbProducts.deleteAllRows(); |
</code> | </code> | ||
- | === Close this screen === | + | ==== Deselect ==== |
- | Closes the current workscreen. | + | In the selected table no row is selected, when a row is selected, it is deselected. |
- | Example: Close Workscreen | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |the table |**[Table:Products]** | | ||
- | <code> | + | <code java> |
- | close() | + | rdbProducts.setSelectedRow(-1); |
</code> | </code> | ||
- | ==== DataBook commands ==== | + | ==== Disable Delete cascade ==== |
- | === Fetch All === | + | Disables automatic deletion of sub records in the selected table. |
- | Fetches all rows of the specified databook. | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |the table |**[Table:Products]** | | ||
- | Parameters: ''%%[List of all databooks in a workscreen]%%'' | + | <code java> |
+ | rdbProducts.setDeleteCascade(false); | ||
+ | </code> | ||
+ | ==== Disable Delete in table ==== | ||
- | Example: Fetch all rows | [Databook: Contacts] | + | Disables deletion of records in the selected table. |
- | Hint: This command is used to ensure that all rows of a databook/view are loaded and displayed (e.g. to search for specific entries) | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |the table |**[Table:Products]** | | ||
- | <code> | + | <code java> |
- | rdbContacts.fetchAll() | + | rdbProducts.setDeleteEnabled(false); |
</code> | </code> | ||
- | === Deselect === | + | ==== Disable Edit in table ==== |
- | No row in the specified databook is selected. | + | Disables editing of records in the selected table. |
- | Parameters: ''%%[List of all databooks in a workscreen]%%'' | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |the table |**[Table:Products]** | | ||
- | Example: Deselect Row | [Databook: Contacts] | + | <code java> |
+ | rdbProducts.setUpdateEnabled(false); | ||
+ | </code> | ||
+ | ==== Disable Insert in table ==== | ||
- | <code> | + | Disables creating of records in the selected table. |
- | rdbContacts.setSelectedRow(-1) | + | |
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Table** |the table |**[Table:Products]** | | ||
+ | |||
+ | <code java> | ||
+ | rdbProducts.setInsertEnabled(false); | ||
</code> | </code> | ||
- | === Select first row === | + | ==== Disable data manipulation in table ==== |
- | The first row of the specified databook is selected. | + | Disables all manipulation (insert, edit, delete) of records in the selected table. |
- | Parameters: ''%%[List of all databooks in a workscreen]%%'' | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |the table |**[Table:Products]** | | ||
- | Example: Select First Row | [Databook: Contacts] | + | <code java> |
+ | rdbProducts.setReadOnly(true); | ||
+ | </code> | ||
+ | ==== Disable fetching data ==== | ||
- | <code> | + | Disables fetching data from server (no database query is performed). |
- | rdbContacts.setSelectedRow(0) | + | |
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Table** |the table |**[Table: Contacts]** | | ||
+ | |||
+ | <code java> | ||
+ | rdbContacts.setFetchEnabled(false); | ||
</code> | </code> | ||
- | === Select last row === | + | ==== Disable record lock ==== |
- | The last row of the specified databook is selected. | + | Disables record lock an reload of current record before start editing. |
- | Parameters: ''%%[List of all databooks in a workscreen]%%'' | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |the table |**[Table:Products]** | | ||
- | Example: Select last row | [Databook: Contacts] | + | <code java> |
+ | rdbProducts.setLockAndRefetchEnabled(false); | ||
+ | </code> | ||
+ | ==== Disable search in memory ==== | ||
- | <code> | + | Disables search in memory, the data is fetched form the server (a database query is performed). |
- | rdbContacts.setSelectedRow(rdbContacts.getRowCount() - 1) | + | |
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Table** |the table |**[Table:Products]** | | ||
+ | |||
+ | <code java> | ||
+ | rdbProducts.setMemFilter(false); | ||
</code> | </code> | ||
- | === Select last inserted row === | + | ==== Disable sort in memory ==== |
- | Selects the last inserted row in the specified databook. | + | Disables sort in memory, the data is fetched form the server (a database query is performed). |
- | Parameters: ''%%[List of all databooks in a workscreen]%%'' | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |the table |**[Table:Products]** | | ||
- | Example: Select last inserted row | [Databook: Contacts] | + | <code java> |
+ | rdbProducts.setMemSort(false); | ||
+ | </code> | ||
+ | ==== Disable store on server ==== | ||
- | Hint: This command can be used to transfer data from the last inserted row in a databook to another databook, or to use the data in a report. After the execution of this command the values of the row's various columns can be accessed (e.g. using the "Set Value with Text" command). | + | Disables sending changed records to the database. |
- | <code> | + | ^Parameter ^Description ^Example ^ |
- | DataBookUtil.selectLastInsertedRow(rdbContacts) | + | |**Table** |the table |**[Table:Products]** | |
+ | |||
+ | <code java> | ||
+ | rdbProducts.setWritebackEnabled(false); | ||
</code> | </code> | ||
- | === Select row having value === | + | ==== Duplicate selected record ==== |
- | Searches the specified databook for a row and selects that row. The selected table column is used to check if the value in the column is equal to the specified value. The search is applied to all rows of the table; the first row containing an exact match is selected. | + | Duplicates the selected record. |
- | Parameters: ''%%[List of all columns of all databooks in a workscreen], [Value for which all rows are searched]%%'' | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |the table |**[Table:Products]** | | ||
- | Example: Select row having value | [Contacts.Lastname] | Maria | + | <code java> |
+ | DataBookUtil.copySelectedRow(rdbProducts); | ||
+ | </code> | ||
+ | Hint: The old record remains selected. | ||
- | <code> | + | ==== Enable Delete cascade ==== |
- | DataBookUtil.selectRowHavingValue(rdbContacts,"Maria") | + | |
+ | Enables automatic deletion of sub records in the selected table. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Table** |the table |**[Table:Products]** | | ||
+ | |||
+ | <code java> | ||
+ | rdbProducts.setDeleteCascade(true); | ||
</code> | </code> | ||
- | === Store selection === | + | ==== Enable Delete in table ==== |
- | Stores the currently selected row in the specified databook, to enable selection of that row at a later time. | + | Enables deletion of records in the selected table. |
- | Parameters: ''%%[List of all databooks in a workscreen]%%'' | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |the table |**[Table:Products]** | | ||
- | Example: Store current selection | [Databook: Contacts] | + | <code java> |
+ | rdbProducts.setDeleteEnabled(true); | ||
+ | </code> | ||
+ | ==== Enable Edit in table ==== | ||
- | Hint: This command can be used to restore the original selection after a number of operations. | + | Enables editing of records in the selected table. |
- | <code> | + | ^Parameter ^Description ^Example ^ |
- | DataBookUtil.storeSelection(rdbContacts) | + | |**Table** |the table |**[Table:Products]** | |
+ | |||
+ | <code java> | ||
+ | rdbProducts.setUpdateEnabled(true); | ||
</code> | </code> | ||
- | === Restore selection === | + | ==== Enable Insert in table ==== |
- | The previously saved selection in the specified databook is restored. If no selection is stored, no change is made. | + | Enables creating of records in the selected table. |
- | Parameters: ''%%[List of all databooks in a workscreen]%%'' | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |the table |**[Table:Products]** | | ||
- | Example: Restores selection | [Databook: Contacts] | + | <code java> |
+ | rdbProducts.setInsertEnabled(true); | ||
+ | </code> | ||
+ | ==== Enable data manipulation in table ==== | ||
- | Hint: This command can be used to restore the original selection after a number of operations. | + | Enables all manipulation (insert, edit, delete) of records in the selected table. |
- | <code> | + | ^Parameter ^Description ^Example ^ |
- | DataBookUtil.restoreSelection(rdbContacts) | + | |**Table** |the table |**[Table:Products]** | |
+ | |||
+ | <code java> | ||
+ | rdbProducts.setReadOnly(false); | ||
</code> | </code> | ||
- | === Insert row before === | + | ==== Enable fetching data ==== |
- | Inserts a new row in the specified databook before the currently selected row. | + | Enables fetching data from server (database query is performed). |
- | Parameters: ''%%[List of all databooks in a workscreen]%%'' | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |the table |**[Table: Contacts]** | | ||
- | Example: Insert row before | [Databook: Contacts] | + | <code java> |
+ | rdbContacts.setFetchEnabled(true); | ||
+ | </code> | ||
+ | ==== Enable record lock ==== | ||
- | <code> | + | Enables record lock an reload of current record before start editing. |
- | rdbContacts.insert(true) | + | |
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Table** |the table |**[Table:Products]** | | ||
+ | |||
+ | <code java> | ||
+ | rdbProducts.setLockAndRefetchEnabled(true); | ||
</code> | </code> | ||
- | === Insert row after === | + | ==== Enable search in memory ==== |
- | Inserts a new row in the specified databook after the currently selected row. | + | Enables search in memory, the data is not fetched form the server (no database query is performed). |
- | Parameters: ''%%[List of all databooks in a workscreen]%%'' | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |the table |**[Table:Products]** | | ||
- | Example: Insert row after | [Databook: Contacts] | + | <code java> |
+ | rdbProducts.setMemFilter(true); | ||
+ | </code> | ||
+ | ==== Enable sort in memory ==== | ||
- | <code> | + | Enables sort in memory, the data is not fetched from the server (a database query is performed). |
- | rdbContacts.insert(false) | + | |
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Table** |the table |**[Table:Products]** | | ||
+ | |||
+ | <code java> | ||
+ | rdbProducts.setMemSort(false); | ||
</code> | </code> | ||
- | === Ask before delete === | + | ==== Enable store on server ==== |
- | Asks the user to confirm before a row is deleted in the specified databook. | + | Enables sending changed records to the database. |
- | Parameters: ''%%[List of all databooks in a workscreen]%%'' | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |the table |**[Table:Products]** | | ||
- | Example: Ask before delete | [Databook: Contacts] | + | <code java> |
+ | rdbProducts.setWritebackEnabled(true); | ||
+ | </code> | ||
+ | ==== Fetch all ==== | ||
- | <code> | + | Loads all available records of the selected table. |
- | ProjXUtil.addAskDeleteDialog(rdbContacts) | + | |
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Table** |the table |**[Table:Contacts]** | | ||
+ | |||
+ | <code java> | ||
+ | rdbContacts.fetchAll(); | ||
</code> | </code> | ||
- | === Calculate Value === | + | Hint: This command is used to ensure that all rows of a table/view are loaded and displayed (e.g., to search for specific entries) |
- | Calculates the result of the specified formula (see [[#formulas_in_commands|Formulas in commands]]) and written in the specified table column. | + | ==== Insert record after ==== |
- | Parameters: ''%%[List of all columns of all databooks in a workscreen], [Formula including reference to columns in all tables of the workscreen]%%'' | + | Inserts a new record in the selected table after the currently selected record. |
- | Example: Calculate value | [Contacts.Total] | [Contacts.Quantity] * [Contacts.Price] | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |the table |**[Table:Contacts]** | | ||
- | Hint: This command can be used for various mathematical operations. The result is then written to a table column. E.g.: calculation of the total price based on quantity and unit price. See [[#formulas_in_commands|Formulas in commands]] for additional details regarding the use of formulas in commands. | + | <code java> |
+ | rdbContacts.insert(false); | ||
+ | </code> | ||
+ | ==== Insert record before ==== | ||
- | <code> | + | Inserts a new record in the selected table before the currently selected record. |
- | Calc.set(new Var(rdbContacts,"TOTAL"), | + | |
- | Calc.val(new Var(rdbContacts,"QUANTITY")) * | + | ^Parameter ^Description ^Example ^ |
- | Calc.val(new Var(rdbContacts,"PRICE"))) | + | |**Table** |the table |**[Table:Contacts]** | |
+ | |||
+ | <code java> | ||
+ | rdbContacts.insert(true); | ||
</code> | </code> | ||
- | === Set Value with Text === | + | ==== Insert sub record ==== |
- | Inserts the specified text in the specified databook column. | + | If the data element tree is added to the screen it is possible to create a sub record at the current position in the tree. |
- | Parameters: ''%%[Target: List of all columns of all databooks in a workscreen], [Text including reference to columns in all tables of the workscreen]%%'' | + | ^Parameter ^Description ^Example ^ |
+ | |**Tree** |tree element |**[Tree: Customers|Orders|Order Details]** | | ||
- | Example: Set value with text| [Contacts.Name] | [Contacts.Filename], [Contacts.Lastname] | + | <code java> |
+ | tree1.doInsertSub(); | ||
+ | </code> | ||
+ | ==== Make value unique ==== | ||
- | Hint: This command can be used to populate text columns with fixed text or values from other columns. In the example below, the value from "Lastname", the fixed text ", " (comma + space) and the value from "Firstname" is written to the column "Name": "Doe, John". | + | Makes a value unique. |
- | <code> | + | It is checked whether this value already exists in the table column. If yes, then the value is extended by a numbering. For example, if the value 'XXX' is entered but already exists, the value is changed to 'XXX - 2'. |
- | Text.set(new Var(rdbContacts,"NAME"), | + | |
- | Text.val(new Var(rdbContacts,"LASTNAME")) + | + | ^Parameter ^Description ^Example ^ |
- | ", " + | + | |**Column** |the value |**[Products.product key]** | |
- | Text.val(new Var(rdbContacts,"FIRSTNAME"))) | + | |
+ | <code java> | ||
+ | DataBookUtil.makeValueUnique(new Var(rdbProducts,"PRODUCT_KEY")); | ||
</code> | </code> | ||
- | === Set Value === | + | ==== Reload table ==== |
- | The value in a specified table column (source) is written to another table column (target). | + | Discards all unsaved changes and reloads all records of the selected table. |
- | Parameters: ''%%[Target: List of all columns of all tables in the workscreen], [Source: List of all columns of all tables in the workscreen]%%'' | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |the table |**[Table:Contacts]** | | ||
- | Example: Set Value | [Contacts.Filename] | [Details.Filename] | + | <code java> |
+ | rdbContacts.reload(); | ||
+ | </code> | ||
+ | Hint: This action can be used to query changes from other users or made in other screens and update the opened screen. | ||
- | Hint: This command can be used to copy values (text, date, numerical) from one table column to another. E.g.: [Contacts.Filename] = [Details.Filename]. As a result, the file name of the details table is copied to the file name of the contacts table. | + | ==== Restore selected record ==== |
- | <code> | + | This action can be used to restore the original selection in a table after a number of operations. The selected row must be stored before. |
- | DataBookUtil.set(new Var(rdbContacts,"FILENAME"), | + | |
- | rdbDetails.getValue("FILENAME")) | + | Hint: This action works only within the same action as 'Store selected record'. |
+ | |||
+ | For example: - store selected record - loop through all records of the table - restore selected record | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Table** |the table |**[Table:Contacts]** | | ||
+ | |||
+ | <code java> | ||
+ | DataBookUtil.restoreSelection(rdbContacts); | ||
</code> | </code> | ||
- | === Set Current Date === | + | ==== Save table ==== |
- | The current time and date are written to the specified table column. | + | Saves all changes in the selected Table. |
- | Parameters: ''%%[List of all columns of all tables in the workscreen]%%'' | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |the table |**[Table:Contacts]** | | ||
- | Example: Set Current Date | [Contacts.Birthday] | + | <code java> |
+ | rdbContacts.saveAllRows(); | ||
+ | </code> | ||
+ | Hint: This action can be used to save changes using a "Save" button. | ||
- | Hint: This command can be used to pre-fill all date columns with the current date. Another application is the creation of a log that shows when a record was added or changed. It is good practice to add changed_on, created_on table columns for all relevant tables! | + | ==== Search by key ==== |
- | <code> | + | The filter works like [[*search-by-value|Search by value]], but in case of a drop down in search mode "equals", you don't search by the displayed value (e.g. "Mr.") but by the id (e.g. 1). |
- | Text.set(new Var(rdbContacts,"BIRTHDAY"), | + | |
- | new Date()) | + | This can improve the performance in some cases. |
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Element** |the search element |**[Search: Contacts.*]** | | ||
+ | |**Value** |the value |**[Table:Contacts]** | | ||
+ | |||
+ | <code java> | ||
+ | filterContacts.setValue("Mr."); | ||
</code> | </code> | ||
- | === Set Current User === | + | ==== Search by value ==== |
- | The name of the current user is inserted in the specified databook column. | + | Sets the value of a search element. |
- | Parameters: ''%%[List of all columns of all databooks in a workscreen]%%'' | + | It's possible to set a value or use column values, element values, parameters or combine all of them. |
- | Example: Set current user | [Contacts.Username] | + | ^Parameter ^Description ^Example ^ |
+ | |**Element** |the search element |**[Search: Contacts.*]** | | ||
+ | |**Value** |the value |**[Contacts.Firstname] [Contacts.Lastname]** | | ||
- | Hint: One application of this command is the creation of a log showing which user created or edited a dataset. It is good practice to add changed_by, created_by columns for all relevant databooks! | + | <code java> |
+ | filterContacts.setDisplayValue(Text.val(new Var(rdbContacts,"FIRSTNAME")) + " " + Text.val(new Var(rdbContacts,"LASTNAME"))); | ||
+ | </code> | ||
+ | ==== Select first record ==== | ||
- | <code> | + | Selects the first record of the selected table. |
- | Text.set(new Var(rdbContacts,"LASTNAME"), | + | |
- | getConnection().getUserName()) | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |the table |**[Table: Customers]** | | ||
+ | |||
+ | <code java> | ||
+ | DataBookUtil.selectFirstRow(rdbCustomers); | ||
</code> | </code> | ||
- | === Set Filter Value === | + | ==== Select last inserted record ==== |
- | The specified filter is set with the specified value. All filter editors used in the workscreen can be used as filters. They can be placed on the workscreen via the GUI Designer's data area. A full text filter or a filter for a selected table column can then be defined. "Similar", "equal", "equal or smaller", "equal or greater" and "greater" can be used as filters. After the value is set, the filter is applied to all rows of the associated table, and only the resulting rows are visible. | + | Selects the last inserted record in the selected table. |
- | Parameters: ''%%[List of all filter editors of the workscreen], [Value for which all rows are searched]%%'' | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |the table |**[Table: Customers]** | | ||
- | Example: Set filter value | [Search: Contacts.*] | Johanna | + | <code java> |
+ | DataBookUtil.selectLastInsertedRow(rdbCustomers); | ||
+ | </code> | ||
+ | ==== Select last record ==== | ||
- | All datasets that contain"//Johanna//" are shown in the Contacts table. | + | Selects the last record of the selected table. |
- | Hint: This command can be used to restrict access to information according to user roles. Role restriction at the data level! | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |the table |**[Table: Customers]** | | ||
- | * Administrator is able to see everything, no filter | + | <code java> |
- | * Staff member can only see their own datasets, filtered by username | + | DataBookUtil.selectLastRow(rdbCustomers,false); |
- | * Department manager can only see own department's datasets, filtered by department | + | </code> |
+ | ==== Select next record ==== | ||
- | Another application of this command is the search for a specified dataset based on a master data list. E.g.: Search for status "complete", after which the "ID" column can be transferred from the master data table to the main table (e.g. to preset the status as default value). | + | Selects the next record of the selected table. The cycle option enables you to jump from the last to the first record. |
- | <code> | + | ^Parameter ^Description ^Example ^ |
- | edtSearch.setValue("Johanna") | + | |**Table** |the table |**[Table: Customers]** | |
+ | |**Cycle** |jump from last to first |**Yes** | | ||
+ | |||
+ | <code java> | ||
+ | DataBookUtil.selectNextRow(rdbCustomers,true); | ||
</code> | </code> | ||
- | === Set Filter Current User === | + | ==== Select previous record ==== |
- | The current username is set as the filter value for the specified filter. | + | Selects the previous record of the selected table. The cycle option enables you to jump from the first to the last record. |
- | Parameters: ''%%[List of all filter editors of the workscreen]%%'' | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |the table |**[Table: Customers]** | | ||
+ | |**Cycle** |jump from first to last |**Yes** | | ||
- | Example: Set Filter Current User | [Search: Contacts.Username] | + | <code java> |
+ | DataBookUtil.selectPreviousRow(rdbCustomers,true,false); | ||
+ | </code> | ||
+ | ==== Select record having value ==== | ||
- | Hint: This command can be used to restrict access to information according to user roles. Role restriction at the data level! | + | Selects the first record that contains the specific value. |
- | * Administrator is able to see everything, no filter | + | ^Parameter ^Description ^Example ^ |
- | * Staff member can only see their own datasets, filtered by username | + | |**Column** |the table |**[Customers.company name]** | |
+ | |**Value** |the search value |**XYZ** | | ||
<code java> | <code java> | ||
- | edtSearch.setValue(getConnection().getUserName()) | + | DataBookUtil.selectRowHavingValue(new Var(rdbCustomers,"COMPANY_NAME"),"XYZ"); |
</code> | </code> | ||
- | === Set Column Readonly === | + | ==== Set ascending sort ==== |
- | The specified databook column is set to read-only. | + | Sorts the selected table ascending by the given column. |
- | Parameters: ''%%[List of all columns of all databooks in a workscreen]%%'' | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |tables |**[Table: Contacts]** | | ||
+ | |**Column** |columns |**[Lastname]** | | ||
- | Example: Set column readonly | [Contacts.Username] | + | <code java> |
+ | rdbContacts.setSort(new SortDefinition(true,"LASTNAME")); | ||
+ | </code> | ||
+ | ==== Set column default value ==== | ||
+ | |||
+ | If a new table row with filled default values is added. | ||
- | Hint: This command sets both the column in the table as well as the associated editor on the form to read-only! | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |the table |**[Table: Contacts]** | | ||
+ | |**Column** |the column |**[Salutation]** | | ||
+ | |**Value** |text, column value, filter value, parameter, concatenation of all |**Mrs.** | | ||
<code java> | <code java> | ||
- | DataBookUtil.setColumnReadOnly(new Var(rdbContacts,"USERNAME")) | + | rdbContacts.getRowDefinition().getColumnDefinition("SALU_SALUTATION").setDefaultValue("Mrs."); |
</code> | </code> | ||
- | === Set Column Editable === | + | ==== Set column editable ==== |
- | The specified databook column is set to read-write access. | + | The selected column of the table is set editable. |
- | Parameters: ''%%[List of all columns of all databooks in a workscreen]%%'' | + | Hint: This action sets both the column in the table as well as the associated editor editable! |
- | Example: Set column editable | [Contacts.Username] | + | If the column should not be editable you have to use the action 'Set column readonly'. |
- | Hint: This command sets both the column in the table as well as the associated editor on the form to read-write! | + | ^Parameter ^Description ^Example ^ |
+ | |**Column** |Column |**[Contacts.Firstname]** | | ||
<code java> | <code java> | ||
- | DataBookUtil.setColumnEditable(new Var(rdbContacts,"USERNAME")) | + | DataBookUtil.setColumnEditable(new Var(rdbContacts,"FIRSTNAME")); |
</code> | </code> | ||
- | === Enable Insert in table === | + | ==== Set column label ==== |
- | Enables the insertion of rows in the specified databook. | + | Changes the header label of a table column. |
- | Parameters: ''%%[List of all databooks in a workscreen]%%'' | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |the table |**[Table: Contacts]** | | ||
+ | |**Column** |the column |**[Salutation]** | | ||
+ | |**Label** |text, column value, filter value, parameter, concatenation of all |**Salutation** | | ||
- | Example: Enable insert in table | [Databook: Contacts] | + | <code java> |
+ | rdbContacts.getRowDefinition().getColumnDefinition("SALU_SALUTATION").setLabel("Salutation"); | ||
+ | </code> | ||
+ | ==== Set column mandatory ==== | ||
+ | |||
+ | Sets a column of a table mandatory. | ||
+ | |||
+ | Hint: This action sets both the column in the table as well as the associated editor mandatory! | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Table** |the table |**[Table: Contacts]** | | ||
+ | |**Column** |the column |**[Salutation]** | | ||
<code java> | <code java> | ||
- | rdbContacts.setInsertEnabled(true) | + | rdbContacts.getRowDefinition().getColumnDefinition("SALU_SALUTATION").setNullable(false); |
</code> | </code> | ||
- | === Disable Insert in table === | + | ==== Set column not mandatory ==== |
- | Disables the insertion of rows in the specified databook. | + | Sets a column of a table not mandatory. |
- | Parameters: ''%%[List of all databooks in a workscreen]%%'' | + | Hint: This action sets both the column in the table as well as the associated editor not mandatory! |
- | Example: Disable insert in table | [Databook: Contacts] | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |the table |**[Table: Contacts]** | | ||
+ | |**Column** |the column |**[Lastname]** | | ||
<code java> | <code java> | ||
- | rdbContacts.setInsertEnabled(false) | + | rdbContacts.getRowDefinition().getColumnDefinition("LASTNAME").setNullable(true); |
</code> | </code> | ||
- | === Enable Edit in table === | + | ==== Set column not searchabel ==== |
- | Enables editing of data in the specified databook. | + | A selected column is excluded from the search. |
- | Parameters: ''%%[List of all databooks in a workscreen]%%'' | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |the table |**[Table: Contacts]** | | ||
+ | |**Column** |the column |**[Lastname]** | | ||
- | Example: Enable edit in table | [Databook: Contacts] | + | <code java> |
+ | rdbContacts.getRowDefinition().getColumnDefinition("LASTNAME").setFilterable(false); | ||
+ | </code> | ||
+ | ==== Set column not sortable ==== | ||
+ | |||
+ | It is no longer possible to sort the selected column in the header. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Table** |the table |**[Table: Contacts]** | | ||
+ | |**Column** |the column |**[Lastname]** | | ||
<code java> | <code java> | ||
- | rdbContacts.setUpdateEnable(true) | + | rdbContacts.getRowDefinition().getColumnDefinition("LASTNAME").setSortable(false); |
</code> | </code> | ||
- | === Disable Edit in table === | + | ==== Set column readonly ==== |
- | Disables editing of data in the specified databook. | + | Sets a selected column readonly. |
- | Parameters: ''%%[List of all databooks in a workscreen]%%'' | + | Hint: This action sets both the column in the table as well as the associated editor readonly! |
- | Example: Disable edit in table | [Databook: Contacts] | + | ^Parameter ^Description ^Example ^ |
+ | |**Column** |the column |**[Contacts.Email]** | | ||
<code java> | <code java> | ||
- | rdbContacts.setUpdateEnabled(false) | + | DataBookUtil.setColumnReadOnly(new Var(rdbContacts,"EMAIL")); |
</code> | </code> | ||
- | === Enable Delete in table === | + | ==== Set column searchable ==== |
- | Enables deletion of rows in the specified table. | + | A selected column is included in the search. |
- | Parameters: ''%%[List of all databooks in a workscreen]%%'' | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |the table |**[Table: Contacts]** | | ||
+ | |**Column** |the column |**[Lastname]** | | ||
- | Example: Enable delete in table | [Databook: Contacts] | + | <code java> |
+ | rdbContacts.getRowDefinition().getColumnDefinition("LASTNAME").setFilterable(true); | ||
+ | </code> | ||
+ | ==== Set column sortable ==== | ||
+ | |||
+ | The selected column can be sorted in the header. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Table** |the table |**[Table: Contacts]** | | ||
+ | |**Column** |the column |**[Lastname]** | | ||
<code java> | <code java> | ||
- | rdbContacts.setDeleteEnabled(true) | + | rdbContacts.getRowDefinition().getColumnDefinition("LASTNAME").setSortable(true); |
</code> | </code> | ||
- | === Disable Delete in table === | + | ==== Set column width ==== |
- | Disables deletion of rows in the specified table. | + | Changes the width of a selected table column. |
- | Parameters: ''%%[List of all databooks in a workscreen]%%'' | + | Hint: This action works only in the onLoad event of the screen. |
- | Example: Disable delete in table | [Databook: Contacts] | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |the table |**[Table: Contacts]** | | ||
+ | |**Column** |the column |**[Lastname]** | | ||
+ | |**Width** |text, column value, parameter, concatenation of all |**200** | | ||
<code java> | <code java> | ||
- | rdbContacts.setDeleteEnabled(false) | + | rdbContacts.getRowDefinition().getColumnDefinition("LASTNAME").setWidth(200); |
</code> | </code> | ||
- | === Enable data manipulation in table === | + | ==== Set current date ==== |
- | Enables all data manipulation (insert, edit, delete) in the specified databook. | + | The current time and date are written to the selected table column. |
- | Parameters: ''%%[List of all databooks in a workscreen]%%'' | + | Hint: This action can be used to pre-fill all date columns with the current date. With this action it's also possible to create a log that shows when a record was added or changed. It is good practice to add changed_on, created_on table columns for all relevant tables! |
- | Example: Enable data manipulation in table | [Databook: Contacts] | + | ^Parameter ^Description ^Example ^ |
+ | |**Write to** |the date column |**[Contacts.Birthday]** | | ||
<code java> | <code java> | ||
- | rdbContacts.setReadOnly(false) | + | Text.set(new Var(rdbContacts,"BIRTHDAY"),new Date()); |
</code> | </code> | ||
- | === Disable data manipulation in table === | + | ==== Set current user ==== |
+ | |||
+ | Sets the current username into a selected column | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Write to** |the date column |**[Contacts.Username]** | | ||
+ | |||
+ | <code java> | ||
+ | Text.set(new Var(rdbContacts,"BIRTHDAY"),new Date()); | ||
+ | </code> | ||
+ | Hint: When you start VisionX you are logged in as VisionX user. With this user no user is set. To change the user there is a button "Switch User" at the bottom right. Here you can choose if you want to use the VisionX user or one of the actual application users managed in the user management. It's also possible to Logout and Login (Button in the top navigation) as application user. | ||
+ | |||
+ | With this action it's also possible to create a log that shows who added or changed a record. It is good practice to add changed_by, created_by table columns for all relevant tables! | ||
- | Disables all data manipulation (insert, edit, delete) in the specified databook. | + | ==== Set descending sort ==== |
- | Parameters: ''%%[List of all databooks in a workscreen]%%'' | + | Sorts the selected table descending by the given column. |
- | Example: Disable data manipulation in table | [Databook: Contacts] | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |tables |**[Table: Contacts]** | | ||
+ | |**Column** |columns |**[Lastname]** | | ||
<code java> | <code java> | ||
- | rdbContacts.setReadOnly(true) | + | rdbContacts.setSort(new SortDefinition(false,"LASTNAME")); |
</code> | </code> | ||
- | ==== Delete row ==== | + | ==== Set label with calculated currency ==== |
- | Delets the currently selected row in the specified databook. | + | Calculates a value based on dynamic or fixed data, rounds the result to 2 decimal places and set it as label. |
- | Parameters: ''%%[List of all databooks in a workscreen]%%'' | + | The value can be calculated with any values from other tables, with parameters or specific texts (see [[#list_of_formulas|List of Formulas]]). |
- | Example: Delete row | [DataBook: Contacts] | + | ^Parameter ^Description ^Example ^ |
+ | |**Label** |the label element (Button, Label, Group Panel) |**[Label: Total]** | | ||
+ | |**Formula** |the formula for calculation |**[Order Details.Unit Price]*[Order Details.Quantity]*[Order Details.Dsicount]** | | ||
<code java> | <code java> | ||
- | rdbContacts.delete(); | + | Calc.setText(labelTotalPrice,Calc.val(new Var(rdbOrderdetails,"UNIT_PRICE")) * Calc.val(new Var(rdbOrderdetails,"QUANTITY")) * Calc.val(new Var(rdbOrderdetails,"DSICOUNT")),"#,##0.00"); |
</code> | </code> | ||
- | ==== Table view (Navigation table) commands ==== | + | ==== Set label with calculated date ==== |
- | === Show Insert Button === | + | Calculates a date value and set it as label. |
- | The "Insert" button on the toolbar of the specified table view is shown. | + | The value can be calculated with any date values from other tables or with parameters (see [[#date_group_functions|Date group functions]]). |
- | Parameters: ''%%[List of all table views in the workscreen]%%'' | + | ^Parameter ^Description ^Example ^ |
+ | |**Label** |the label element (Button, Label, Group Panel) |**[Label: Date]** | | ||
+ | |**Formula** |the formula for calculation |**addYears([Contacts.Birthday],1)** | | ||
- | Example: Show insert button| [Table view: Contacts] | + | Example: January 1, 2001 |
<code java> | <code java> | ||
- | navContacts.setInsertVisible(true) | + | Calc.setDateText(labelLabel,Calc.addYears(Calc.val(new Var(rdbContacts,"BIRTHDAY")),1)); |
</code> | </code> | ||
- | === Hide Insert Button === | + | ==== Set label with calculated date short ==== |
- | The "Insert" button on the toolbar of the specified table view is hidden. | + | Calculates a date value, formats it as date short and set it as a label. |
- | Parameters: ''%%[List of all table views in the workscreen]%%'' | + | The value can be calculated with any date values from other tables or with parameters (see [[#date_group_functions|Date group functions]]). |
- | Example: Hide insert button | [Table view: Contacts] | + | ^Parameter ^Description ^Example ^ |
+ | |**Label** |the label element (Button, Label, Group Panel) |**[Label: Date]** | | ||
+ | |**Formula** |the formula for calculation |**addYears([Contacts.Birthday],1)** | | ||
+ | |||
+ | Example: 1/1/2001 | ||
<code java> | <code java> | ||
- | navContacts.setInsertVisible(false) | + | Calc.setDateShortText(labelLabel1,Calc.addYears(Calc.val(new Var(rdbContacts,"BIRTHDAY")),1)); |
</code> | </code> | ||
- | === Show Edit Button === | + | ==== Set label with calculated date time ==== |
+ | |||
+ | Calculates a date value, formats it as date and time and set it as a label. | ||
- | The "Edit" button on the toolbar of the specified table view is shown. | + | The value can be calculated with any date values from other tables or with parameters (see [[#date_group_functions|Date group functions]]). |
- | Parameters: ''%%[List of all table views in the workscreen]%%'' | + | ^Parameter ^Description ^Example ^ |
+ | |**Label** |the label element (Button, Label, Group Panel) |**[Label: Date]** | | ||
+ | |**Formula** |the formula for calculation |**addHours([Contacts.Birthday],5)** | | ||
- | Example: Show edit button | [Table view: Contacts] | + | Example: Januara 1, 2000, 6:00 AM |
<code java> | <code java> | ||
- | navContacts.setEditVisible(true) | + | Calc.setDateTimeText(labelLabel,Calc.addHours(Calc.val(new Var(rdbContacts,"BIRTHDAY")),5)); |
</code> | </code> | ||
- | === Hide Edit Button === | + | ==== Set label with calculated date time short ==== |
- | The "Edit" button on the toolbar of the specified table view is hidden. | + | Calculates a date value, formats it as date time short and set it as a label. |
- | Parameters: ''%%[List of all table views in the workscreen]%%'' | + | The value can be calculated with any date values from other tables or with parameters (see [[#date_group_functions|Date group functions]]). |
- | Example: Hide edit button | [Table view: Contacts] | + | ^Parameter ^Description ^Example ^ |
+ | |**Label** |the label element (Button, Label, Group Panel) |**[Label: Date]** | | ||
+ | |**Formula** |the formula for calculation |**addHours([Contacts.Birthday],5)** | | ||
+ | |||
+ | Example: 1/1/2000, 6:00 AM | ||
<code java> | <code java> | ||
- | navContacts.setEditVisible(false) | + | Calc.setDateTimeShortText(labelLabel1,Calc.addYears(Calc.val(new Var(rdbContacts,"BIRTHDAY")),1)); |
</code> | </code> | ||
- | === Show Delete Button === | + | ==== Set label with calculated time ==== |
- | The "Delete" button on the toolbar of the specified table view is shown. | + | Calculates a date value, formats it as date and time short and set it as a label. |
- | Parameters: ''%%[List of all table views in the workscreen]%%'' | + | The value can be calculated with any date values from other tables or with parameters (see [[#date_group_functions|Date group functions]]). |
- | Example: Show delete button | [Table view: Contacts] | + | ^Parameter ^Description ^Example ^ |
+ | |**Label** |the label element (Button, Label, Group Panel) |**[Label: Date]** | | ||
+ | |**Formula** |the formula for calculation |**addHours([Contacts.Birthday],5)** | | ||
+ | |||
+ | Example: 6:00 AM | ||
<code java> | <code java> | ||
- | navContacts.setDeleteVisible(true) | + | Calc.setTimeText(labelLabel,Calc.addHours(Calc.val(new Var(rdbContacts,"BIRTHDAY")),5)); |
</code> | </code> | ||
- | === Hide Delete Button === | + | ==== Set label with calculated value ==== |
- | The "Delete" button on the toolbar of the specified table view is hidden. | + | Calculates a value based on dynamic or fixed data and sets the result as label text. The value can be calculated with any values from other tables, with parameters or specific texts (see [[#list_of_formulas|List of Formulas]]). |
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Label** |the label element (Button, Label, Group Panel) |**[Label: Total]** | | ||
+ | |**Formula** |the formula for calculation |**[Order Details.Unit Price]*[Order Details.Quantity]*[Order Details.Dsicount]** | | ||
+ | |||
+ | <code java> | ||
+ | Calc.setText(labelTotalPrice,Calc.val(new Var(rdbOrderdetails,"UNIT_PRICE")) * Calc.val(new Var(rdbOrderdetails,"QUANTITY")) * Calc.val(new Var(rdbOrderdetails,"DSICOUNT")),null); | ||
+ | </code> | ||
+ | ==== Set read ahead count ==== | ||
- | Parameters: ''%%[List of all table views in the workscreen]%%'' | + | Sets the number of records which will be loaded initially. |
- | Example: Hide delete button | [Table view: Contacts] | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |the table |**[Table: Contacts]** | | ||
+ | |**Amount** |the amount |10 | | ||
<code java> | <code java> | ||
- | navContacts.setDeleteVisible(false) | + | rdbContacts.setReadAhead(10); |
</code> | </code> | ||
- | === Show Export Button === | + | ==== Set search current user ==== |
- | The "Export" button on the toolbar of the specified table view is shown. | + | Sets the current username as the value of a search element. |
- | Parameters: ''%%[List of all table views in the workscreen]%%'' | + | This action can be used to restrict access to information according to user roles. For example: * Administrator is able to see everything, no filter * Staff member can only see their own datasets, filtered by username |
- | Example: Show export button | [Table view: Contacts] | + | Hint: When you start VisionX you are logged in as VisionX user. With this user no filter is set. To change the user there is a button "Switch User" at the bottom right. Here you can choose if you want to use the VisionX user or one of the actual application users managed in the user management. It's also possible to Logout and Login (Button in the top navigation) as application user. |
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Element** |the search element |**[Search: Contacts.*]** | | ||
<code java> | <code java> | ||
- | navContacts.setExportVisible(true) | + | filterContacts.setValue(getConnection().getUserName()); |
+ | </code> | ||
+ | ==== Set selected column ==== | ||
- | #### Hide Export Button | + | Sets the current/selected column. |
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Table** |tables |**[Table: Contacts]** | | ||
+ | |**Column** |columns |**[Lastname]** | | ||
+ | |||
+ | <code java> | ||
+ | rdbContacts.setSelectedColumn("LASTNAME"); | ||
</code> | </code> | ||
- | The "Export" button on the toolbar of the specified table view is hidden. | + | ==== Set selected row ==== |
- | Parameters: ''%%[List of all table views in the workscreen]%%'' | + | Sets the current/selected row number. |
- | Example: Hide export button | [Table view: Contacts] | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |the table element |**[Table: Contacts]** | | ||
+ | |**Row number** |number or parameter |**2** | | ||
<code java> | <code java> | ||
- | navContacts.setExportVisible(false) | + | rdbContacts.setSelectedRow(2); |
</code> | </code> | ||
- | === Show Navigation === | + | Hint: The row numbers start at 0 and not at 1. For example, the row numbered 2 is the 3rd row in the table. |
- | The navigation toolbar is shown for the specified table view. | + | ==== Set value ==== |
- | Parameters: ''%%[List of all table views in the workscreen]%%'' | + | Sets a value into a column. The value can be any text, value from another table or a parameter. |
- | Example: Show navigation | [Table view: Contacts] | + | ^Parameter ^Description ^Example ^ |
+ | |**Write to** |the column |**[Contacts.Email]** | | ||
+ | |**Value** |text, column value, parameter |**[Customers.email]** | | ||
<code java> | <code java> | ||
- | navContacts.setToolBarVisible(true) | + | DataBookUtil.set(new Var(rdbContacts,"EMAIL"),rdbCustomers.getValue("EMAIL")); |
</code> | </code> | ||
- | === Hide Navigation === | + | Hint: This command can be used to copy values (text, date, numerical) from one table column to another. E.g.: [Contacts.Email] = [Customers.email]. As a result, the email of the customers table is copied to the email of the contacts table. |
- | The navigation toolbar is hidden for the specified table view. | + | ==== Set value with concatenated text ==== |
- | Parameters: ''%%[List of all table views in the workscreen]%%'' | + | Sets a concatenated text into a column. The text can contain values from other tables, from parameters and any texts. |
- | Example: Hide navigation | [Table view: Contacts] | + | ^Parameter ^Description ^Example ^ |
+ | |**Write to** |the column |**[Customers.name]** | | ||
+ | |**Text** |the text |**[Contacts.Lastname], [Contacts.Firstname]** | | ||
<code java> | <code java> | ||
- | navContacts.setToolBarVisible(false) | + | Text.set(new Var(rdbCustomers,"NAME"),Text.val(new Var(rdbContacts,"LASTNAME")) + ", " + Text.val(new Var(rdbContacts,"FIRSTNAME"))); |
</code> | </code> | ||
- | === Hide Column === | + | Hint: This command can be used to populate text columns with fixed text or values from other columns. In the example below, the value from "Lastname", the fixed text ", " (comma + space) and the value from "Firstname" is written to the column "Name": "Doe, John". |
- | The specified table column is hidden. | + | ==== Store selected record ==== |
- | Parameters: ''%%[List of all columns of all tables in a workscreen]%%'' | + | Stores the currently selected row in the selected table, to enable selection of that row at a later time. |
- | Example: Hide column | [Contacts.Username] | + | Hint: You can restore a stored selected record only within the same action. |
- | Hint: This command is used to hide table columns irrespective of user roles. | + | For example: - store selected record - loop through all records of the table - restore selected record |
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Table** |the table |**[Table:Contacts]** | | ||
<code java> | <code java> | ||
- | DataBookUtil.hideColumn(new Var(rdbContacts,"USERNAME")); | + | DataBookUtil.storeSelection(rdbContacts); |
</code> | </code> | ||
- | === Autoresize Columns === | + | ===== Debug ===== |
- | Automatically sets column widths for the selected table view. Widths are determined dynamically based on the database column width and the actual values in the columns. | + | ==== Debug log ==== |
- | Parameters: ''%%[List of all table views in the workscreen]%%'' | + | Logs a debug message. The message can be a text, column value, a filter value, a parameter or a combination of all. |
- | Example: Autoresize columns | [Table view: Contacts] | + | ^Parameter ^Description ^Example ^ |
+ | |**Message** |text, column value, filter value, parameter, concatenation of all |**[Contacts.Email]** | | ||
<code java> | <code java> | ||
- | navContacts.setAutoResize(true) | + | debug(rdbContacts.getValue("EMAIL")); |
</code> | </code> | ||
- | ==== Change management commands ==== | + | ==== Error log ==== |
- | === Discard all changes === | + | Logs an error message. The message can be a column value, a filter value or a parameter. |
- | All unsaved changes in all databooks of the current workscreen are discarded. | + | ^Parameter ^Description ^Example ^ |
+ | |**Message** |text, column value, filter value, parameter, concatenation of all |**[Contacts.Email]** | | ||
- | Example: Discard all changes | + | <code java> |
+ | error(rdbContacts.getValue("EMAIL")); | ||
+ | </code> | ||
+ | ==== Info log ==== | ||
- | Hint: This command is used to discard charges on a form using a "Cancel" button. | + | Logs an info message. The message can be a column value, a filter value or a parameter. |
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Message** |text, column value, filter value, parameter, concatenation of all |**[Contacts.Email]** | | ||
<code java> | <code java> | ||
- | getDataSource().restoreAllDataBooks() | + | info(rdbContacts.getValue("EMAIL")); |
</code> | </code> | ||
- | === Save === | + | ==== Print to console ==== |
- | Saves all unsaved changes in all databooks of the current workscreen. | + | Prints a message to the console. |
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Text** |text, column value, filter value, parameter, concatenation of all |**[Contacts.Email]** | | ||
+ | |||
+ | <code java> | ||
+ | System.out.println((String)rdbCustomers.getValue("EMAIL")); | ||
+ | </code> | ||
+ | ===== Documents ===== | ||
+ | |||
+ | ==== Download file ==== | ||
+ | |||
+ | Downloads the selected file. The file can be saved to a local hard drive and then opened. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Filename** |text, parameter, column value, filter value |**[Contacts.Filename]** | | ||
+ | |**Content** |text, parameter, column value, filter value |**[Contacts.Image]** | | ||
+ | |||
+ | <code java> | ||
+ | ProjXUtil.downloadFile(this,(String)rdbContacts.getValue("FILENAME"),rdbContacts.getValue("IMAGE")); | ||
+ | </code> | ||
+ | ==== Download report ==== | ||
- | Example: Save | + | Downloads the selected, previously created, report. The report can be saved on a local hard drive and then opened. |
- | Hint: This command can be used before a report is shown, or to save changes in a form using a "Save" button. | + | ^Parameter ^Description ^Example ^ |
+ | |**Report** |previously created report |**List Report Contacts** | | ||
<code java> | <code java> | ||
- | getDataSource().saveAllDataBooks() | + | getApplication().getLauncher().saveFileHandle(getListReportContacts()); |
</code> | </code> | ||
- | === Save table === | + | ==== Import report (insert) / (merge) ==== |
- | Saves all unsaved changes in the specified databook. | + | Imports the selected report. All of the report's data is imported to the relevant rows and fields of the screen. If **Merge** is selected, only changed, deleted or new data is imported. Data that already exists is not added. If **Insert** is used, all data rows, including existing rows (tested for similarity) are transferred. |
- | Example: Save table | + | This functionality is only available for XLSX (Excel) and XML reports that were created with VisionX. Of course, the report templates can be edited. This is command is used to import offline forms into the application. |
- | Hint: This command can be used to save changes in a form using a "Save" button. | + | ^Parameter ^Description ^Example ^ |
+ | |**Template** |previously created xlsx or xml report |**List Report Contacts (xlsx)** | | ||
<code java> | <code java> | ||
- | rdbContacts.saveAllRows() | + | merge: |
+ | ProjXUtil.importFile(this,"/reports/screens/NeuWorkScreen$ContactsList.xlsx",true); | ||
+ | |||
+ | insert: | ||
+ | ProjXUtil.importFile(this,"/reports/screens/NeuWorkScreen$ContactsList.xlsx",false); | ||
</code> | </code> | ||
- | === Reload table === | + | ==== Remove file ==== |
- | Reloads all datasets in the specified databook from the database. | + | Removes a file or report from the selected record. The columns in which the filename and the content was stored must be specified. |
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Filename** |column value |**[Contacts.Filename]** | | ||
+ | |**Content** |column value |**[Contacts.Image]** | | ||
+ | |||
+ | <code java> | ||
+ | ProjXUtil.deleteFile(new Var(rdbContacts,"FILENAME"),new Var(rdbContacts,"IMAGE")); | ||
+ | </code> | ||
+ | ==== Save report ==== | ||
- | Example: Reload table | + | Saves the specified report in a table. The save location is defined via two parameters: The report's file name is saved in a text column of the table; the file itself is saved in the current record of a table column of the type Image or File. |
- | Hint: This command is used to keep changes made by other users or in other workscreens to the same databook current. | + | ^Parameter ^Description ^Example ^ |
+ | |**Filename** |column |**[Contacts.Filename]** | | ||
+ | |**Content** |column |**[Contacts.Image]** | | ||
+ | |**Report** |previously created report |**List Report Contacts** | | ||
<code java> | <code java> | ||
- | rdbContacts.reload() | + | ProjXUtil.storeFileHandle(new Var(rdbContacts,"REPORT_NAME"),new Var(rdbContacts,"REPORT_FILE"),getListReportContacts()); |
</code> | </code> | ||
- | === Reload all === | + | ==== Show file ==== |
- | Reloads all databooks in the current workscreen from the database. | + | Shows the selected file. The file is either displayed in a browser or opened using the relevant program (e.g. Word, Excel), depending on how the PC is configured. |
- | Example: Reload all | + | ^Parameter ^Description ^Example ^ |
+ | |**Filename** |text, parameter, column value, filter value |**[Contacts.Filename]** | | ||
+ | |**Content** |text, parameter, column value, filter value |**[Contacts.Image]** | | ||
<code java> | <code java> | ||
- | getDataSource().reloadAllDataBooks() | + | ProjXUtil.showFile(this,(String)rdbContacts.getValue("FILENAME"),rdbContacts.getValue("IMAGE")); |
</code> | </code> | ||
- | === Reload all screens === | + | ==== Show report ==== |
- | Reloads all databooks in all open workscreens from the database. | + | Shows the specified report. The report is either displayed in a browser or opened using the relevant program (e.g. Word, Excel), depending on how the PC is configured. |
- | Example: Reload all screens | + | ^Parameter ^Description ^Example ^ |
+ | |**Report** |list of previously created reports |**List Report Contacts** | | ||
<code java> | <code java> | ||
- | ((ProjX)getApplication()).doReload() | + | getApplication().getLauncher().showFileHandle(getListReportContacts()); |
</code> | </code> | ||
- | === Manual Save and Reload === | + | ==== Upload file ==== |
- | The current workscreen is decoupled from the application toolbar. Clicking "Save" or "Reload" on the toolbar is ignored within the current workscreen. This is a useful feature for typical form workscreens; it is a default setting for the generation of such workscreens in VisionX. It is therefore necessary to create separate "Save" and "Cancel" buttons for these workscreens with the respective functionality. | + | Saves a file in the current record. The name of the uploaded file is saved in a text column; the file itself is saved in a column of type Image or File. |
- | Example: Manual save and reload | + | ^Parameter ^Description ^Example ^ |
+ | |**Filename** |column for the name |**[Contacts.Filename]** | | ||
+ | |**Content** |column for the data (type image or file) |**[Contacts.Image]** | | ||
<code java> | <code java> | ||
- | setManualSaveAndReload(true) | + | ProjXUtil.showFile(this,(String)rdbContacts.getValue("FILENAME"),rdbContacts.getValue("IMAGE")); |
</code> | </code> | ||
- | ==== Report commands ==== | + | ===== Table control ===== |
- | === Show Report === | + | ==== Disable header sorting ==== |
- | Shows the specified report. The report is either displayed in a browser or opened using the relevant program (e.g. Word, Excel), depending on how the PC is configured. | + | Disables header sorting by click in the header columns. |
- | Parameters: ''%%[List of all reports in the workscreen]%%'' | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |table view in screen |**[TableView: Contacts]** | | ||
- | Example: Show Report | Form Report Contacts | + | <code java> |
+ | tableContacts.setSortOnHeaderEnabled(false); | ||
+ | </code> | ||
+ | ==== Enable header sorting ==== | ||
+ | |||
+ | Enables header sorting by click in the header columns. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Table** |table view in screen |**[TableView: Contacts]** | | ||
<code java> | <code java> | ||
- | getApplication().getLauncher().showFileHandle(getFormReportContacts()) | + | tableContacts.setSortOnHeaderEnabled(false); |
</code> | </code> | ||
- | === Download Report === | + | ==== Hide Delete button ==== |
- | Downloads the specified report. The report can be saved on a local hard drive and then opened. | + | Hides the 'delete record' button in the table view. |
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Table** |table view in screen |**[TableView: Contacts]** | | ||
+ | |||
+ | <code java> | ||
+ | tableContacts.setDeleteVisible(false); | ||
+ | </code> | ||
+ | ==== Hide Duplicate button ==== | ||
- | Parameters: ''%%[List of all reports in the workscreen]%%'' | + | Hides the 'duplicate record' button in the table view. |
- | Example: Download report | Form Report Contacts | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |table view in screen |**[TableView: Contacts]** | | ||
<code java> | <code java> | ||
- | getApplication().getLauncher().saveFileHandle(getFormReportContacts()) | + | tableContacts.setDuplicateVisible(false); |
</code> | </code> | ||
- | === Save Report === | + | ==== Hide Edit button ==== |
- | Saves the specified report in a table. The save location is defined via two parameters: The report's file name is saved in a text column of the table; the file itself is saved in the current row of a table column of the type Image or File. | + | Hides the 'edit record' button in the table view. |
- | Parameters: ''%%[Filename: List of all columns of all databooks in a workscreen], [File: List of all columns of all databooks in a workscreen] | [List of all reports in the workscreen]%%'' | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |table view in screen |**[TableView: Contacts]** | | ||
- | Example: Save Report | [Contacts.Filename] | [Contacts.Image] | Form Report Contacts | + | <code java> |
+ | tableContacts.setEditVisible(false); | ||
+ | </code> | ||
+ | ==== Hide Export button ==== | ||
- | Hint: This command can be used to save the reports generated by the application in a databook (e.g.: lists, proposals and other business reports). | + | Hides the 'export' button in the table view. |
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Table** |table view in screen |**[TableView: Contacts]** | | ||
<code java> | <code java> | ||
- | ProjXUtil.storeFileHandle( | + | tableContacts.setExportVisible(false); |
- | new Var(rdbContacts,"FILENAME"), | + | |
- | new Var(rdbContacts,"IMAGE"), | + | |
- | getFormReportContacts()) | + | |
</code> | </code> | ||
- | === Import Report (merge) === | + | ==== Hide New button ==== |
- | Imports the specified report. All of the report's data is imported to the relevant rows and fields of the workscreen. If "Merge" is selected, only changed, deleted or new information is imported. Data that already exists is not added separately. If "Insert" is used, all data rows, including existing rows (tested for similarity) are transferred. This functionality is only available for XLSX (Excel) and XML reports that were created using VisionX. Of course the report templates can be edited. This is command is used to import offline forms into the application. | + | Hides the 'insert new record' button in the table view. |
- | Parameters: ''%%[List of all reports in the workscreen]%%'' | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |table view in screen |**[TableView: Contacts]** | | ||
- | Example: Show report | Form Report2 Contacts (xls) | + | <code java> |
+ | tableContacts.setInsertVisible(false); | ||
+ | </code> | ||
+ | ==== Hide Search button ==== | ||
+ | |||
+ | Hides the 'search record' button in the table view. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Table** |table view in screen |**[TableView: Contacts]** | | ||
<code java> | <code java> | ||
- | ProjXUtil.importFile(this, "/reports/screens/ContactsWorkScreen$ContactsForm.xls", true) | + | tableContacts.setSearchVisible(false); |
</code> | </code> | ||
- | === Import Report (insert) === | + | ==== Hide Search record ==== |
- | See [[#import_report_(merge)|Import Report (merge)]] above | + | It is possible to search directly in a table view. If such a search was performed, this action can be used to disable the search restriction. 'Enable Search button' restores the restriction by the search terms. |
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Table** |table view in screen |**[TableView: Contacts]** | | ||
<code java> | <code java> | ||
- | ProjXUtil.importFile(this, "/reports/screens/ContactsWorkScreen$ContactsForm.xls", false) | + | tableContacts.setSearchEnabled(false); |
</code> | </code> | ||
- | ==== File upload/download commands ==== | + | ==== Hide focus rectangle ==== |
- | === Upload File to === | + | Hides the focus style of the selected cell in the table view. A selected cell has no additional frame. The cell looks unselected. |
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Table** |table view in screen |**[TableView: Contacts]** | | ||
+ | |||
+ | <code java> | ||
+ | tableContacts.setShowFocusRect(false); | ||
+ | </code> | ||
+ | Hint: This action does not work in the web application | ||
- | Uploads a file that is selected by the user and saves it in a databook. The save location is determined by two parameters: The name of the uploaded file is saved in a table's text column; the file itself is saved in the current row of a table column of the type Image or File. Parameters: ''%%[Filename: List of all columns of all databooks in a workscreen]%%'', ''%%[File: List of all columns of all databooks in a workscreen]%%''. | + | ==== Hide gridlines ==== |
- | Example: Upload file | [Contacts.Filename] | [Contacts.Image] | + | Hides the horizontal and vertical gridlines in the table view. |
- | Hint: This command can be used to saved files in a databook. (e.g. emails, proposals and other business reports). | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |table view in screen |**[TableView: Contacts]** | | ||
<code java> | <code java> | ||
- | ProjXUtil.uploadFile(this, | + | tableContacts.setShowGridLines(false); |
- | new Var(rdbContacts,"FILENAME"), | + | |
- | new Var(rdbContacts,"IMAGE")) | + | |
</code> | </code> | ||
- | === Show File === | + | ==== Hide horizontal lines ==== |
- | Shows the specified file. The file is either displayed in a browser or opened using the relevant program (e.g. Word, Excel), depending on how the PC is configured. The file is selected via two parameters: the file name and a databook column. The file name can be selected via a table's text column or using fixed text. The data is taken from a column in the currently selected table row (type Image or File). | + | Hides the horizontal lines in the table view. |
- | Parameters: ''%%[Filename: List of all columns of all databooks in a workscreen], [File: List of all columns of all databooks in a workscreen]%%'' | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |table view in screen |**[TableView: Contacts]** | | ||
- | Example: Show file | [Contacts.Filename] | [Contacts.Image] | + | <code java> |
+ | tableContacts.setShowHorizontalLines(false); | ||
+ | </code> | ||
+ | ==== Hide selection ==== | ||
- | Hint: This command is used to display documents that were saved in the application by the user. | + | Disables highlighting of the selected record in the table view. |
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Table** |table view in screen |**[TableView: Contacts]** | | ||
<code java> | <code java> | ||
- | ProjXUtil.showFile(this, | + | tableContacts.setShowSelection(false); |
- | (String)rdbContacts.getValue("FILENAME"), | + | |
- | rdbContacts.getValue("IMAGE")) | + | |
</code> | </code> | ||
- | === Download File === | + | ==== Hide table control buttons ==== |
- | Downloads the specified file. The file can be saved to a local hard drive and opened from there. The file is selected via two parameters: the file name and a databook column. The file name can be selected via a table's text column or using fixed text. The data is taken from a column in the currently selected table row (type Image or File). | + | Hides the navigation toolbar for the selected table view. |
- | Parameters: ''%%[Filename: List of all columns of all databooks in a workscreen], [File: List of all columns of all databooks in a workscreen]%%'' | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |table view in screen |**[TableView: Contacts]** | | ||
- | Example: Download file | [Contacts.Filename] | [Contacts.Image] | + | <code java> |
+ | tableContacts.setToolBarVisible(false); | ||
+ | </code> | ||
+ | ==== Hide vertical lines ==== | ||
- | Hint: This command is used to download files that were saved in the application by the user. | + | Hides the vertical lines in the table view. |
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Table** |table view in screen |**[TableView: Contacts]** | | ||
+ | |||
+ | <code java> | ||
+ | tableContacts.setShowVerticalLines(false); | ||
+ | </code> | ||
+ | ==== Set maximum row height ==== | ||
+ | |||
+ | Sets the maximum row height of a table view. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Table** |table view in screen |**[TableView: Contacts]** | | ||
+ | |**Height** |number, parameter |**30** | | ||
<code java> | <code java> | ||
- | ProjXUtil.downloadFile(this, | + | tableContacts.setMaxRowHeight(30); |
- | (String)rdbContacts.getValue("FILENAME"), | + | |
- | rdbContacts.getValue("IMAGE")) | + | |
</code> | </code> | ||
- | === Delete File === | + | Hint: The height of the header line is not changed. |
- | Deletes the specified file. | + | ==== Set minimum row height ==== |
- | Parameters: ''%%[Filename: List of all columns of all databooks in a workscreen], [File: List of all columns of all databooks in a workscreen]%%'' | + | Sets the minimum row height of a table view. |
- | Example: Delete File | [Contacts.Filename] | [Contacts.Image] | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |table view in screen |**[TableView: Contacts]** | | ||
+ | |**Height** |number, parameter |**30** | | ||
<code java> | <code java> | ||
- | ProjXUtil.deleteFile(*,*) | + | tableContacts.setMinRowHeight(30); |
</code> | </code> | ||
- | ==== GUI component commands ==== | + | Hint: The height of the header line is not changed. |
- | === Disable Component === | + | ==== Set row height ==== |
- | Disables the specified GUI component. The element is grayed out and no changes can be made. | + | Set the row height of a table view. |
- | Parameters: ''%%[List of all GUI components on the workscreen]%%'' | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |table view in screen |**[TableView: Contacts]** | | ||
+ | |**Height** |number, parameter |**50** | | ||
- | Example: Disable component | [Input field: Contacts.Lastname] | + | <code java> |
+ | tableContacts.setRowHeight(50); | ||
+ | </code> | ||
+ | Hint: The height of the header line is not changed. | ||
+ | |||
+ | ==== Set sort order column name ==== | ||
+ | |||
+ | Defines in which column the sort order is stored as a numerical value. The sorting starts at 0 and the table view is sorted by this column. In the table view navigation, there are two new buttons 'move up' and 'move down' to move a record up or down in the sort order. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Table** |table view in screen |**[TableView: Contacts]** | | ||
+ | |**Column** |table column |**[Contacts.sorting]** | | ||
<code java> | <code java> | ||
- | edtLastName.setEnabled(false) | + | tableContacts.setSortOrderColumnName("SORTING"); |
</code> | </code> | ||
- | === Enable Component === | + | ==== Show Delete button ==== |
- | Enables the specified GUI component. | + | Shows the 'delete recored' button in the table view. |
- | Parameters: ''%%[List of all GUI components on the workscreen]%%'' | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |table view in screen |**[TableView: Contacts]** | | ||
- | Example: Enable component | [Input field: Contacts.Lastname] | + | <code java> |
+ | tableContacts.setDeleteVisible(true); | ||
+ | </code> | ||
+ | ==== Show Duplicate button ==== | ||
+ | |||
+ | Shows the 'duplicate record' button in the table view. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Table** |table view in screen |**[TableView: Contacts]** | | ||
<code java> | <code java> | ||
- | edtLastName.setEnabled(true) | + | tableContacts.setDuplicateVisible(true); |
</code> | </code> | ||
- | === Hide Component === | + | ==== Show Edit button ==== |
- | Hides the specified GUI component. | + | Shows the 'edit record' button in the table view. |
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Table** |table view in screen |**[TableView: Contacts]** | | ||
+ | |||
+ | <code java> | ||
+ | tableContacts.setEditVisible(true); | ||
+ | </code> | ||
+ | ==== Show Export button ==== | ||
- | Parameters: ''%%[List of all GUI components on the workscreen]%%'' | + | Shows the 'export' button in the table view. |
- | Example: Hide component | [Input field: Contacts.Lastname] | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |table view in screen |**[TableView: Contacts]** | | ||
<code java> | <code java> | ||
- | edtLastName.setVisible(false) | + | tableContacts.setExportVisible(true); |
</code> | </code> | ||
- | === Show Component === | + | ==== Show New button ==== |
- | Shows the specified GUI component. | + | Shows the 'insert new record' button in the table view. |
- | Parameters: ''%%[List of all GUI elements on the workscreen]%%'' | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |table view in screen |**[TableView: Contacts]** | | ||
- | Example: Show component | [Input field: Contacts.Lastname] | + | <code java> |
+ | tableContacts.setInsertVisible(false); | ||
+ | </code> | ||
+ | ==== Show Search button ==== | ||
+ | |||
+ | Hides the 'search record' button in the table view. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Table** |table view in screen |**[TableView: Contacts]** | | ||
<code java> | <code java> | ||
- | edtLastName.setVisible(true) | + | tableContacts.setSearchVisible(true); |
</code> | </code> | ||
- | === Deselect Button === | + | ==== Show Search record ==== |
- | Deselects the specified button (checkbox, radio- or toggle button). | + | It is possible to search directly in a table view. If such a search was performed and disabled, this action can be used to enable the search restriction again. The table view is now again filtered according to the previously entered search terms. |
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Table** |table view in screen |**[TableView: Contacts]** | | ||
+ | |||
+ | <code java> | ||
+ | tableContacts.setSearchEnabled(true); | ||
+ | </code> | ||
+ | ==== Show focus rectangle ==== | ||
- | Parameters: ''%%[List of all buttons (checkbox, radio- and toggle) on the workscreen]%%'' | + | Shows the focus style of the selected cell in the table view. A selected cell has an additional frame. |
- | Example: Deselect button | [Input field: Contacts.Lastname] | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |table view in screen |**[TableView: Contacts]** | | ||
<code java> | <code java> | ||
- | edtLastName.setSelected(false) | + | tableContacts.setShowFocusRect(true); |
</code> | </code> | ||
- | === Select Button === | + | ==== Show gridlines ==== |
- | Selects the specified button (checkbox, radio- or toggle button). | + | Shows the horizontal and vertical gridlines in the table view. |
- | Parameters: ''%%[List of all buttons (checkbox, radio- and toggle) on the workscreen]%%'' | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |table view in screen |**[TableView: Contacts]** | | ||
- | Example: Select button | [Input field: Contacts.Lastname] | + | <code java> |
+ | tableContacts.setShowGridLines(true); | ||
+ | </code> | ||
+ | ==== Show horizontal lines ==== | ||
+ | |||
+ | Shows the horizontal lines in the table view. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Table** |table view in screen |**[TableView: Contacts]** | | ||
<code java> | <code java> | ||
- | edtLastName.setSelected(true) | + | tableContacts.setShowHorizontalLines(true); |
</code> | </code> | ||
- | === Enable Tab === | + | ==== Show selection ==== |
- | Activates the specified tab so that it is not grayed out and can be selected. | + | Disables highlighting of the selected record in the table view. |
- | Parameters: ''%%[Component: List of all of the workscreen's tab controls]%%'' | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |table view in screen |**[TableView: Contacts]** | | ||
+ | |||
+ | <code java> | ||
+ | tableContacts.setShowSelection(false); | ||
+ | </code> | ||
+ | ==== Show table control buttons ==== | ||
- | Parameters: ''%%[Tab: List of all tabs of the selected tab control]%%'' | + | Shows the navigation toolbar for the selected table view. |
- | Example: Enable tab | [TabsetPanel: tabsetPanelMain] | Tab 2 | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |table view in screen |**[TableView: Contacts]** | | ||
<code java> | <code java> | ||
- | tabsetPanelMain.setEnabledAtIfExists("Tab 2",true) | + | tableContacts.setToolBarVisible(true); |
</code> | </code> | ||
- | === Disable Tab === | + | ==== Show vertical lines ==== |
- | Deactivates the specified tab. It is grayed out and cannot be selected. | + | Shows the vertical lines in the table view. |
- | Parameters: ''%%[Component: List of all of the workscreen's tab controls]%%'' | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |table view in screen |**[TableView: Contacts]** | | ||
- | Parameters: ''%%[Tab: List of all tabs of the selected tab control]%%'' | + | <code java> |
+ | tableContacts.setShowVerticalLines(true); | ||
+ | </code> | ||
+ | ===== Tools ===== | ||
- | Example: Disable tab | [TabsetPanel: tabsetPanelMain] | Tab 2 | + | ==== Call server action ==== |
+ | |||
+ | Calls a server action or a stored procedure from the database. The parameters of this action are different, depending on which server action is selected. 'sendMail' for example has the following parameters: pFrom, pTo, pSubject, pText, pFileName, pContent | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Server action** |list of server actions |**doCommit** | | ||
<code java> | <code java> | ||
- | tabsetPanelMain.setEnabledAtIfExists("Tab 2",false) | + | getConnection().callAction("doCommit"); |
</code> | </code> | ||
- | === Select Tab === | + | ==== Open Website ==== |
- | Selects the specified tab. | + | Opens an Website in a web browser. |
- | Parameters: ''%%[Component: List of all of the workscreen's tab controls]%%'' | + | Hint: Depending on the browser settings you may have to allow the pop up the first time. |
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**URL** |text, parameter, column value, filter value, concatenation of all |**doCommit** | | ||
+ | |||
+ | <code java> | ||
+ | getApplication().getLauncher().showDocument("https://www.sibvisions.com/",null,"_blank"); | ||
+ | </code> | ||
+ | ==== QR Contact ==== | ||
- | Parameters: ''%%[Tab: List of all tabs of the selected tab control]%%'' | + | Converts the given contact information into a QR code and saves it in the selected image column. Parameters can be left empty. |
- | Example: Select tab | [TabsetPanel: tabsetPanelMain] | Tab 2 | + | ^Parameter ^Description ^Example ^ |
+ | |**Write to** |column |**[Contacts.QR]** | | ||
+ | |**Name** |text, parameter, column value, filter value |**[Contacts.QR]** | | ||
+ | |**Company** |text, parameter, column value, filter value |**[Customers.company name]** | | ||
+ | |**Title** |text, parameter, column value, filter value |**[Contacts.Academic Title]** | | ||
+ | |**Phone number** |text, parameter, column value, filter value |**[Contacts.QR]** | | ||
+ | |**E-Mail** |text, parameter, column value, filter value |**[Contacts.Email]** | | ||
+ | |**Address** |text, parameter, column value, filter value |**{address}** | | ||
+ | |**Website** |text, parameter, column value, filter value | | | ||
+ | |**Note** |text, parameter, column value, filter value |**[Contacts.description]** | | ||
<code java> | <code java> | ||
- | tabsetPanelMain.setSelectedIndexIfExists("Tab 2") | + | QRUtil.setContact(getConnection(),new Var(rdbContacts,"QR"),(String)getParameter("name"),"",(String)rdbContacts.getValue("ACTI_ACADEMIC_TITLE"),"",(String)rdbContacts.getValue("EMAIL"),(String)getParameter("address"),"",(String)rdbContacts.getValue("DESCRIPTION")); |
</code> | </code> | ||
- | === Set Tab Text === | + | Hint: If several columns should be merged into one text, this is possible via parameters. Before the action a parameter can be set and this can be used in the action. For more information see 'Set Parameter', 'Set Parameter with concatenated text', 'Set Parameter with calculated value'. |
- | Sets the text of the specified tab. | + | ==== QR E-Mail ==== |
- | Parameters: ''%%[Component: List of all of the workscreen's tab controls]%%'' | + | Converts the E-Mail address into a QR code and saves it in the selected image column. |
- | Parameters: ''%%[Tab: List of all tabs of the selected tab control]%%'' | + | ^Parameter ^Description ^Example ^ |
+ | |**Write to** |column |**[Contacts.QR]** | | ||
+ | |**E-Mail** |text, parameter, column value, filter value |**[Contacts.Email]** | | ||
- | Example: Set tab text | [TabsetPanel: tabsetPanelMain] | Tab 2 | Tab 2 New | + | <code java> |
+ | QRUtil.setEMail(getConnection(),new Var(rdbContacts,"QR"),(String)rdbContacts.getValue("EMAIL")); | ||
+ | </code> | ||
+ | ==== QR Geo location ==== | ||
+ | |||
+ | Converts the given location into a QR code and saves it in the selected column. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Write to** |column |**[Contacts.QR]** | | ||
+ | |**Latitude** |text, parameter, column value, filter value |**48.24669129999999** | | ||
+ | |**Longitude** |text, parameter, column value, filter value |**16.3798883** | | ||
<code java> | <code java> | ||
- | tabsetPanelMain. setTextAtIfExists("Tab 2","Tab 2 New") | + | QRUtil.setGeoLocation(getConnection(),new Var(rdbContacts,"QR"),"48.24669129999999","16.3798883",null); |
</code> | </code> | ||
- | === Set Label with calculated Value === | + | ==== QR Phone number ==== |
- | Calculates the result of the specified formula (see [[#formulas_in_commands|Formulas in commands]]) and writes it to the specified label (GUI element). | + | Converts the given phone number into a QR code and saves it in the selected image column. |
- | Parameters: ''%%[List of all labels (GUI elements) of the workscreen], [Formula including reference to columns in all tables of the workscreen]%%'' | + | ^Parameter ^Description ^Example ^ |
+ | |**Write to** |column |**[Contacts.QR]** | | ||
+ | |**Phone Number** |text, parameter, column value, filter value |**+43 1 934 6009 0** | | ||
- | Example: Set label with calculated value | [Contacts.Total] | [Contacts.Quantity] * [Contacts.Price] | + | <code java> |
+ | QRUtil.setPhoneNumber(getConnection(),new Var(rdbContacts,"QR"),"+43 1 934 6009 0"); | ||
+ | </code> | ||
+ | ==== QR Text ==== | ||
- | Hint: This command can be used for various mathematical operations. The result is then written to a table column. E.g.: calculation of the total price based on quantity and unit price. | + | Converts the given text into a QR code and saves it in the selected image column. |
- | Additional details regarding the use of formulas in commands can be found in [[#formulas_in_commands|Formulas in commands]]. | + | ^Parameter ^Description ^Example ^ |
+ | |**Write to** |column |**[Contacts.QR]** | | ||
+ | |**Text** |text, parameter, column value, filter value |**VisionX** | | ||
<code java> | <code java> | ||
- | Calc.setText(*,*,null) Calc.set(new Var(rdbContacts,"TOTAL"), | + | QRUtil.setText(getConnection(),new Var(rdbContacts,"QR"),"VisionX"); |
- | Calc.val(new Var(rdbContacts,"QUANTITY")) * | + | |
- | Calc.val(new Var(rdbContacts,"PRICE")), null) | + | |
</code> | </code> | ||
- | === Set Label Text === | + | ==== Send e-mail ==== |
- | The specified text is written to the specified label (GUI element). | + | Sends an email message using the application settings. One file can be attached. Before this action can be used, the mail server must be configured under **Settings -> E-Mail**. The needed Parameters are: Server, Port, TLS Username, Password Default Sender Default Html |
+ | |||
+ | Hint: Filename and data can be left empty if no attachment is to be sent. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**From** |text, parameter, column value, filter value |**application.email@test.com** | | ||
+ | |**To** |text, parameter, column value, filter value |**[Contacts.Email]** | | ||
+ | |**Subject** |text, parameter, column value, filter value |**Subject** | | ||
+ | |**Text** |text, column value, filter value, parameter, concatenation of all |**Dear [Contacts.Firstname] [Contacts.Lastname], this is the body of the e-mail.** | | ||
+ | |**Filename** |text, parameter, column value, filter value |**[Contacts.report name]** | | ||
+ | |**Data** |column value (File or Image) |**[Contacts.report file]** | | ||
+ | |||
+ | <code java> | ||
+ | getConnection().callAction("sendMail","application.email@test.com",(String)rdbContacts.getValue("EMAIL"),"Subject","Dear " + Text.val(new Var(rdbContacts,"FIRSTNAME")) + " "+ Text.val(new Var(rdbContacts,"LASTNAME"))+ ",\nthis is the body of the e-mail.",(String)rdbContacts.getValue("REPORT_NAME"),rdbContacts.getValue("REPORT_FILE")); | ||
+ | </code> | ||
+ | ==== Send e-mail with custom server ==== | ||
- | Parameters: ''%%[Target: List of all labels (GUI-elements) of the workscreen], [Text including reference to columns in all tables of the workscreen]%%'' | + | This action can be used if you want to send from another server than defined in the application settings. It's possible to use TLS encryption. No HTML only plain text is possible. One file can be attached. |
- | Example: Set Label Text| [Contacts.Name] | [Contacts.Filename], [Contacts.Lastname] | + | Hint: Filename and data can be left empty if no attachment is to be sent. |
- | Hint: This command can be used to populate text columns with fixed text or values from other columns. | + | If you want to use more than one server you can store the connection details in a server table, filter the table before sending and then you can use the table information. |
- | In the example on the right, the value from "Lastname", the fixed text ", " (comma + space) and the value from "Firstname" is written to the column "Name": "Doe, John" | + | ^Parameter ^Description ^Example ^ |
+ | |**SMTP Host** |text, parameter, column value, filter value |**host** | | ||
+ | |**SMTP Port** |text, parameter, column value, filter value |**25** | | ||
+ | |**Username** |text, parameter, column value, filter value |**Username** | | ||
+ | |**Password** |text, parameter, column value, filter value |**Password** | | ||
+ | |**TLS** |checkbox |**yes** | | ||
+ | |**From** |text, parameter, column value, filter value |**application.email@test.com** | | ||
+ | |**To** |text, parameter, column value, filter value |**[Contacts.Email]** | | ||
+ | |**Subject** |text, parameter, column value, filter value |**Subject** | | ||
+ | |**Text** |text, column value, filter value, parameter, concatenation of all |**Dear [Contacts.Firstname] [Contacts.Lastname], this is the body of the e-mail.** | | ||
+ | |**Filename** |text, parameter, column value, filter value |**[Contacts.report name]** | | ||
+ | |**Data** |column value (File or Image) |**[Contacts.report file]** | | ||
<code java> | <code java> | ||
- | lblLastName.setText() | + | getConnection().callAction("sendMail","host","25","Username","Password",Boolean.TRUE,Boolean.FALSE,"application.email@test.com",(String)rdbContacts.getValue("EMAIL"),"Subject","Dear " + Text.val(new Var(rdbContacts,"FIRSTNAME")) + " "+ Text.val(new Var(rdbContacts,"LASTNAME"))+ ",\nthis is the body of the e-mail.",(String)rdbContacts.getValue("REPORT_NAME"),rdbContacts.getValue("REPORT_FILE")); |
- | Text.set(new Var(rdbContacts,"NAME"), | + | |
- | Text.val(new Var(rdbContacts,"LASTNAME")) + | + | |
- | ", " + | + | |
- | Text.val(new Var(rdbContacts,"FIRSTNAME"))) | + | |
</code> | </code> | ||
- | === Disable all components === | + | ==== Send e-mail with custom server (no TLS) ==== |
- | Disables all components in the given container. | + | This action can be used if you want to send from another server than defined in the application settings. It's not possible to use TLS encryption. No HTML only plain text is possible. One file can be attached. |
- | Parameters: ''%%[Target: List of all GUI components of the workscreen]%%'' | + | Hint: Filename and data can be left empty if no attachment is to be sent. |
- | Example: Disable all components | [Contacts.Panel] | + | If you want to use more than one server you can store the connection details in a server table, filter the table before sending and then you can use the table information. |
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**SMTP Host** |text, parameter, column value, filter value |**host** | | ||
+ | |**SMTP Port** |text, parameter, column value, filter value |**25** | | ||
+ | |**Username** |text, parameter, column value, filter value |**Username** | | ||
+ | |**Password** |text, parameter, column value, filter value |**Password** | | ||
+ | |**From** |text, parameter, column value, filter value |**application.email@test.com** | | ||
+ | |**To** |text, parameter, column value, filter value |**[Contacts.Email]** | | ||
+ | |**Subject** |text, parameter, column value, filter value |**Subject** | | ||
+ | |**Text** |text, column value, filter value, parameter, concatenation of all |**Dear [Contacts.Firstname] [Contacts.Lastname], this is the body of the e-mail.** | | ||
+ | |**Filename** |text, parameter, column value, filter value |**[Contacts.report name]** | | ||
+ | |**Data** |column value (File or Image) |**[Contacts.report file]** | | ||
<code java> | <code java> | ||
- | ProjXUtil.setComponentsEnabled(pnlMain, false) | + | getConnection().callAction("sendMail","host","25","Username","Password","application.email@test.com",(String)rdbContacts.getValue("EMAIL"),"Subject","Dear " + Text.val(new Var(rdbContacts,"FIRSTNAME")) + " "+ Text.val(new Var(rdbContacts,"LASTNAME"))+ ",\nthis is the body of the e-mail.",(String)rdbContacts.getValue("REPORT_NAME"),rdbContacts.getValue("REPORT_FILE")); |
</code> | </code> | ||
- | === Enable all components === | + | ==== Send html e-mail with custom server ==== |
- | Enables all components in the given container. | + | This action can be used if you want to send HTML Mails from another server than defined in the application settings. It's possible to use TLS encryption. One file can be attached. |
- | Parameters: ''%%[Target: List of all GUI components of the workscreen]%%'' | + | Hint: Filename and data can be left empty if no attachment is to be sent. |
- | Example: Enable all components | [Contacts.Panel] | + | If you want to use more than one server you can store the connection details in a server table, filter the table before sending and then you can use the table information. |
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**SMTP Host** |text, parameter, column value, filter value |**host** | | ||
+ | |**SMTP Port** |text, parameter, column value, filter value |**25** | | ||
+ | |**Username** |text, parameter, column value, filter value |**Username** | | ||
+ | |**Password** |text, parameter, column value, filter value |**Password** | | ||
+ | |**TLS** |checkbox |**yes** | | ||
+ | |**From** |text, parameter, column value, filter value |**application.email@test.com** | | ||
+ | |**To** |text, parameter, column value, filter value |**[Contacts.Email]** | | ||
+ | |**Subject** |text, parameter, column value, filter value |**Subject** | | ||
+ | |**Text** |text, column value, filter value, parameter, concatenation of all |**Dear [Contacts.Firstname] [Contacts.Lastname], this is the body of the e-mail.** | | ||
+ | |**Filename** |text, parameter, column value, filter value |**[Contacts.report name]** | | ||
+ | |**Data** |column value (File or Image) |**[Contacts.report file]** | | ||
<code java> | <code java> | ||
- | ProjXUtil.setComponentsEnabled(pnlMain, true) | + | getConnection().callAction("sendMail","host","25","Username","Password",Boolean.TRUE,Boolean.TRUE,"application.email@test.com",(String)rdbContacts.getValue("EMAIL"),"Subject","Dear " + Text.val(new Var(rdbContacts,"FIRSTNAME")) + " "+ Text.val(new Var(rdbContacts,"LASTNAME"))+ ",\nthis is the body of the e-mail.",(String)rdbContacts.getValue("REPORT_NAME"),rdbContacts.getValue("REPORT_FILE")); |
</code> | </code> | ||
- | ==== Additional commands ==== | + | ===== User interface ===== |
- | === Logout === | + | ==== Activate autoresize columns ==== |
- | The user is logged out. | + | Activates autoresize for the selected table view. If no width was set for a column, it will automatically be set so that all displayed columns have space on the screen. |
- | Example: Logout | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |table view |**[TableView: Contacts]** | | ||
<code java> | <code java> | ||
- | ((ProjX)getApplication()).doLogout(null) | + | tableContacts.setAutoResize(true); |
</code> | </code> | ||
- | === Show Error === | + | ==== Activate responsive design ==== |
- | Shows a predefined message in an error dialogue. | + | Activates responsive design for the selected element. Only works when the responsive mode is activated under **Settings -> Design**. |
- | Parameters: ''%%[Error message with reference to all databook columns in the workscreen]%%'' | + | ^Parameter ^Description ^Example ^ |
+ | |**Element** |Layout |**[Advanced Form Layout: advancedFormLayout1]** | | ||
- | Example: Show Error | [Input field: Contacts.Lastname] is missing! | + | <code java> |
+ | advancedFormLayout1.setResponsive(true); | ||
+ | </code> | ||
+ | ==== Add style ==== | ||
+ | |||
+ | A CSS (Cascading Style Sheets) class can be assigned to an element. This class must be defined under **Settings -> Web Application Settings -> Styles** | ||
+ | |||
+ | {{:visionx:actions:actions12.png?nolink|imgSmall}} | ||
<code java> | <code java> | ||
- | showError(this, | + | /* |
- | Text.val(new Var(rdbContacts,"LASTNAME")) + | + | Put your custom application styles in this file. |
- | " is missing!") | + | */ |
+ | |||
+ | .colorGreen .v-panel-caption { | ||
+ | color: green; | ||
+ | } | ||
</code> | </code> | ||
- | === Show Information === | + | This action works only in the web. |
- | Shows a predefined message in an information dialogue. | + | ^Parameter ^Description ^Example ^ |
+ | |**Element** |Layout |**[Group Panel: Contacts]** | | ||
+ | |**Style** |text, column value, filter value, parameter, concatenation of all |**[colorGreen]** | | ||
- | Parameters: ''%%[Information message with reference to all databook columns in the workscreen]%%'' | + | <code java> |
+ | Style.addStyleNames(groupPanelContacts,"colorGreen"); | ||
+ | </code> | ||
+ | ==== Allow focus ==== | ||
- | Example: Show information | [Input field: Contacts.Lastname] is missing! | + | Allows setting focus (selection of the element with tab) on an element. |
+ | |||
+ | Hint: Works only in web. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Element** |Layout |**[Editor: Contacts.Firstname]** | | ||
<code java> | <code java> | ||
- | showInformation(this, | + | editContactsFirstname.setFocusable(true); |
- | Text.val(new Var(rdbContacts,"LASTNAME")) + | + | |
- | " is missing!") | + | |
</code> | </code> | ||
- | === Validation Error === | + | ==== Deactivate autoresize columns ==== |
- | Shows a validation error. The specified text is shown on the workscreen in a validation error message. | + | Deactivates autoresize for the selected table view. |
- | Parameters: ''%%[Validation error message with reference to all databook columns in the workscreen]%%'' | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |table view |**[TableView: Contacts]** | | ||
- | Example: Validation error | [Input field: Contacts.Street] is a required field. | + | <code java> |
+ | tableContacts.setAutoResize(false); | ||
+ | </code> | ||
+ | ==== Deactivate responsive design ==== | ||
- | Hint:Validation errors are always used for the GUI element "field validation." If email is empty, then validation error "..."! | + | Deactivates responsive design for the selected element. |
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Element** |Layout |**[Advanced Form Layout: advancedFormLayout1]** | | ||
<code java> | <code java> | ||
- | throw new Exception( | + | advancedFormLayout1.setResponsive(false); |
- | Text.val(new Var(rdbContacts,"STREET")) + | + | |
- | " is a required field.") | + | |
</code> | </code> | ||
- | === Send Mail === | + | ==== Disable element ==== |
- | Sends an email message. The parameters can reference databook columns or can be defined using fixed text. | + | Disables the selected element. The element is grayed out and no changes can be made. |
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Element** |Layout |**[Editor: Contacts.Firstname]** | | ||
+ | |||
+ | <code java> | ||
+ | editContactsFirstname.setEnabled(false); | ||
+ | </code> | ||
+ | ==== Disable tab ==== | ||
- | Parameters: ''%%[STMP Server], [STMP Port], [SMTP User], [SMTP Password], [Sender], [Recipient], [Subject], [Mail Text], [Filename], [File]%%'' | + | Disables the selected tab in a tabset. It is grayed out and cannot be clicked. |
- | Hint: It is good practice to create one or more tables containing the various parameters, to allow for easier configuration. | + | ^Parameter ^Description ^Example ^ |
+ | |**Tabset** |Layout - Tabsets |**[Tabset: tabsetPanelMain]** | | ||
+ | |**Tab** |Layout - Tabs |**2. customers** | | ||
<code java> | <code java> | ||
- | getConnection().callAction("sendMail", | + | tabsetPanelMain.setEnabledAtIfExists(1,false); |
- | (String)rdbEmailserver.getValue("SMTPSERVER"), | + | |
- | (String)rdbEmailserver.getValue("SMTPPORT"), | + | |
- | (String)rdbEmailserver.getValue("USERNAME"), | + | |
- | (String)rdbEmailserver.getValue("PASSWORD"), | + | |
- | (String)rdbEmailserver.getValue("SENDER"), | + | |
- | (String)rdbUsers.getValue("RECIPIENT"), | + | |
- | "E-Mail subject", | + | |
- | "Test\nhttp://sibvisions.com", | + | |
- | "", | + | |
- | "") | + | |
</code> | </code> | ||
- | === Open URL === | + | ==== Disable translation ==== |
- | Opens an URL. The parameter can reference databook columns or can be defined using fixed text. | + | Disables the translation of an element. This action works only in the onLoad Event of the Screen. |
- | Parameters: ''%%[URL]%%'' | + | ^Parameter ^Description ^Example ^ |
+ | |**Element** |Layout - Elements |**[Tabset: tabsetPanelMain]** | | ||
<code java> | <code java> | ||
- | getApplication().getLauncher().showDocument( | + | tabsetPanelMain.setEnabledAtIfExists(1,false); |
- | (String)rdbUrls.getValue("URL"), | + | |
- | null, | + | |
- | "blank") | + | |
</code> | </code> | ||
- | === Call Server Action === | + | ==== Do not allow focus ==== |
- | Executes the given server action. | + | Disables the translation for the selected element. |
- | Parameters: ''%%[Action Name]%%'' | + | Disallow setting focus (selection of the element with tab) on an element. |
+ | |||
+ | Hint: Works only in web. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Element** |Layout |**[Editor: Contacts.Firstname]** | | ||
<code java> | <code java> | ||
- | getConnection().callAction("action") | + | editContactsFirstname.setFocusable(false); |
</code> | </code> | ||
- | === Silent abort === | + | ==== Do not preserve aspect ratio ==== |
+ | |||
+ | If an icon has horizontal and/or vertical alignment set to stretch, this action does not keep the original heights and width ratio. | ||
- | Aborts the current operation silently and completely. | + | ^Parameter ^Description ^Example ^ |
+ | |**Icon** |icon of the screen |**[Icon: icon1]** | | ||
<code java> | <code java> | ||
- | throw new SilentAbortException() | + | icon1.setPreserveAspectRatio(false); |
</code> | </code> | ||
- | ==== QR ==== | + | ==== Enable element ==== |
- | === QR Text === | + | Enables the selected element. The element is grayed out and no changes can be made. |
- | Converts the given text into a QR code and saves it in the given column. | + | ^Parameter ^Description ^Example ^ |
+ | |**Element** |Layout |**[Editor: Contacts.Firstname]** | | ||
- | Parameters: ''%%[List of all columns of all databooks in a workscreen], [List of all columns of all databooks in a workscreen]%%'' | + | <code java> |
+ | editContactsFirstname.setEnabled(true); | ||
+ | </code> | ||
+ | ==== Enable tab ==== | ||
- | Exmaple: QR Text | [Contacts.Qr] | [Contacts.Firstname] | + | Enables the selected tab in a tabset. It is not grayed out and can opened. |
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Tabset** |Layout - Tabsets |**[Tabset: tabsetPanelMain]** | | ||
+ | |**Tab** |Layout - Tabs |**2. customers** | | ||
<code java> | <code java> | ||
- | QRUtil.setText( | + | tabsetPanelMain.setEnabledAtIfExists(1,true); |
- | getConnection(), | + | |
- | (String)rdbContacts.getValue("QR"), | + | |
- | (String)rdbContacts.getValue("FIRSTNAME")) | + | |
</code> | </code> | ||
- | === QR E-Mail === | + | ==== Enable translation ==== |
- | Converts the given E-Mail address into a QR code and saves it in the given column. | + | Enables the translation of an element. This action works only in the onLoad Event of the Screen. |
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Element** |Layout - Elements |**[Tabset: tabsetPanelMain]** | | ||
+ | |||
+ | <code java> | ||
+ | tabsetPanelMain.setEnabledAtIfExists(1,false); | ||
+ | </code> | ||
+ | ==== Hide button border ==== | ||
- | Parameters: ''%%[List of all columns of all databooks in a workscreen], [List of all columns of all databooks in a workscreen]%%'' | + | Hides the border of the selected button. |
- | Exmaple: QR Text | [Contacts.Qr] | [Contacts.Email] | + | ^Parameter ^Description ^Example ^ |
+ | |**Button** |Button |**[Button: Save]** | | ||
<code java> | <code java> | ||
- | QRUtil.setEMail( | + | buttonButton14.setBorderPainted(false); |
- | getConnection(), | + | |
- | (String)rdbContacts.getValue("QR"), | + | |
- | (String)rdbContacts.getValue("EMAIL")) | + | |
</code> | </code> | ||
- | === QR Phone number === | + | ==== Hide column ==== |
- | Converts the given phone number into a QR code and saves it in the given column. | + | Hides the selected column of a Table. |
- | Parameters: ''%%[List of all columns of all databooks in a workscreen], [List of all columns of all databooks in a workscreen]%%'' | + | ^Parameter ^Description ^Example ^ |
+ | |**Column** |Table column |**[Contacts.Firstname]** | | ||
- | Exmaple: QR Text | [Contacts.Qr] | [Contacts.Phone] | + | <code java> |
+ | DataBookUtil.hideColumn(new Var(rdbContacts,"FIRSTNAME")); | ||
+ | </code> | ||
+ | ==== Hide editor border ==== | ||
+ | |||
+ | Hides the border of an input field used in the screen. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Editor** |editors used in screen |**[Editor: Contacts.Firstname]** | | ||
<code java> | <code java> | ||
- | QRUtil.setPhoneNumber( | + | editContactsFirstname.setBorderVisible(false); |
- | getConnection(), | + | |
- | (String)rdbContacts.getValue("QR"), | + | |
- | (String)rdbContacts.getValue("PHONE")) | + | |
</code> | </code> | ||
- | === QR Geo location === | + | ==== Hide element ==== |
- | Converts the given location into a QR code and saves it in the given column. | + | Hides the selected element used in the screen. |
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Element** |element of the screen |**[Editor: Contacts.Firstname]** | | ||
+ | |||
+ | <code java> | ||
+ | editContactsFirstname.setVisible(false); | ||
+ | </code> | ||
+ | ==== Hide navigation ==== | ||
- | Parameters: ''%%[List of all columns of all databooks in a workscreen], [List of all columns of all databooks in a workscreen], [List of all columns of all databooks in a workscreen]%%'' | + | Hides the navigation of an editing panel in display mode Tabset or Inline or the table |
- | Exmaple: QR Text | [Contacts.Qr] | [Contacts.Latitude] | [Contacts.Longitude] | + | ^Parameter ^Description ^Example ^ |
+ | |**Editing Panel** |element of the screen |**[Editing Panel: morphPanelMain]** | | ||
<code java> | <code java> | ||
- | QRUtil.setText( | + | morphPanelMain.setTabHeaderVisible(false); |
- | getConnection(), | + | |
- | (String)rdbContacts.getValue("QR"), | + | |
- | (String)rdbContacts.getValue("LATITUDE"), | + | |
- | (String)rdbContacts.getValue("LONGITUDE"), | + | |
- | null) | + | |
</code> | </code> | ||
- | === QR Contact === | + | ==== Preserve aspect ratio ==== |
- | Converts the given contact information into a QR code and saves it in the given column. | + | If an icon has horizontal and/or vertical alignment set to stretch, this action can keep the original height and width ratio. |
- | Parameters: ''%%[List of all columns of all databooks in a workscreen], [List of all columns of all databooks in a workscreen], [List of all columns of all databooks in a workscreen], [List of all columns of all databooks in a workscreen], [List of all columns of all databooks in a workscreen], [List of all columns of all databooks in a workscreen], [List of all columns of all databooks in a workscreen], [List of all columns of all databooks in a workscreen], [List of all columns of all databooks in a workscreen]%%'' | + | ^Parameter ^Description ^Example ^ |
+ | |**Icon** |icon of the screen |**[Icon: icon1]** | | ||
- | Exmaple: QR Text | [Contacts.Qr] | [Contacts.Name] | [Contacts.Company] | [Contacts.Title] | [Contacts.Phone] | [Contacts.Email] | [Contacts.Address] | [Contacts.Website] | [Contacts.Note] | + | <code java> |
+ | icon1.setPreserveAspectRatio(true); | ||
+ | </code> | ||
+ | ==== Remove style ==== | ||
+ | |||
+ | A CSS (Cascading Style Sheets) class can be removed from an element. | ||
+ | |||
+ | Only styles that were previously added with add style can be removed. | ||
+ | |||
+ | This action works only in the web. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Element** |Layout |**[Group Panel: Contacts]** | | ||
+ | |**Style** |text, column value, filter value, parameter, concatenation of all |**[colorGreen]** | | ||
<code java> | <code java> | ||
- | QRUtil.setPhoneNumber( | + | Style.removeStyleNames(groupPanelOverview,"colorGreen"); |
- | getConnection(), | + | |
- | (String)rdbContacts.getValue("QR"), | + | |
- | (String)rdbContacts.getValue("NAME"), | + | |
- | (String)rdbContacts.getValue("COMPANY"), | + | |
- | (String)rdbContacts.getValue("TITLE"), | + | |
- | (String)rdbContacts.getValue("PHONE"), | + | |
- | (String)rdbContacts.getValue("EMAIL"), | + | |
- | (String)rdbContacts.getValue("ADDRESS"), | + | |
- | (String)rdbContacts.getValue("WEBSITE"), | + | |
- | (String)rdbContacts.getValue("NOTE")) | + | |
</code> | </code> | ||
- | ====== Conditions ====== | + | ==== Request focus ==== |
- | Conditions allow for the execution of commands in dependence on whether the condition is met or not. One set of commands can be executed if the condition is met, and another if the condition is not met. | + | Requests the focus (selection of the element with tab) on an element. This works also, if the focus of the element is disabled. |
- | This results in varying outcomes depending on the condition, e.g.: if the user has the role "Administrator", all databook columns are visible, otherwise only a selected number of columns is shown. | + | ^Parameter ^Description ^Example ^ |
+ | |**Editor** |Editor, Search |**[Editor: Contacts.Firstname]** | | ||
- | Example: | + | <code java> |
+ | editContactsFirstname.requestFocus(); | ||
+ | </code> | ||
+ | ==== Save editor immediately ==== | ||
- | {{:visionx:actions:if.png?nolink|The example of an If cascade.}} | + | Normally, changed editor values are only saved in the model when the editor is exited. |
- | - If the column "Userdata.Created" is empty, execute the following commands | + | For example, the filter does not search until the editor is exited with enter, tab or mouse click. |
- | - Write the current date to "Userdata.Createdon" | + | |
- | - Write the current user to "Userdata.Createdby" | + | |
- | - Otherwise, execute the following commands | + | |
- | - Write the current user to "Userdata.Changedby" | + | |
- | - Write the current date to "Userdata.Changedon" | + | |
- | ===== If Equals / If not Equals / If Greater / If Greater Or Equal / If Smaller / If Smaller Or Equal ===== | + | If Save editor immediately is set to an editor or filter, it is saved to the model with each keystroke. The filter searches immediately during the input. |
- | If the first parameter equals / does not equal / is greater than / is greater than or equals / is smaller than / is smaller than or equals the second parameter, then the commands in the "If" path are executed, otherwise the commands in the "Else" path are executed. | + | ^Parameter ^Description ^Example ^ |
+ | |**Editor** |Editor, Search |**[Search: Contacts]** | | ||
- | Parameters: ''%%[List of all columns of all databooks in the workscreen, or a set value], [List of all columns of all databooks in the workscreen, or a set value]%%'' | + | <code java> |
+ | filterContacts.setSavingImmediate(true); | ||
+ | </code> | ||
+ | ==== Save editor not immediately ==== | ||
+ | |||
+ | Changed editor values are only saved in the model when the editor is exited. | ||
+ | |||
+ | For example, the filter does not search until the editor is exited with Enter, Tab or mouse click. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Element** |Layout |**[Search: Contacts]** | | ||
+ | |||
+ | <code java> | ||
+ | filterContacts.setSavingImmediate(false); | ||
+ | </code> | ||
+ | ==== Select tab ==== | ||
+ | |||
+ | Activates the selected tab. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Tabset** |Tabsets in the screen |**[Tabset: tabsetPanelMain]** | | ||
+ | |**Tab** |Tabsets of selected tabset |**2. Customers** | | ||
+ | |||
+ | <code java> | ||
+ | tabsetPanelMain.setSelectedIndexIfExists(1); | ||
+ | </code> | ||
+ | ==== Set background color ==== | ||
+ | |||
+ | Changes the background color of the selected element. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Element** |Element in the screen |**[Group Panel: Contacts]]** | | ||
+ | |**Color** |Color Picker |**#FF0000** | | ||
+ | |||
+ | <code java> | ||
+ | groupPanelOverview.setBackground(new UIColor(0xff0000)); | ||
+ | </code> | ||
+ | ==== Set background image ==== | ||
+ | |||
+ | Changes the background image of the selected panel. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Panel** |Panels in the screen |**[Panel: panelMain]** | | ||
+ | |**Image** |Image Upload / Picker |**Background.png** | | ||
+ | |||
+ | <code java> | ||
+ | panelMain.setBackgroundImage(UIImage.getImage("/com/sibvisions/apps/vxdemo/images/Background.png")); | ||
+ | </code> | ||
+ | ==== Set button margins ==== | ||
+ | |||
+ | Changes the button margins of the selected button. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Button** |Buttons in the screen |**[Button: download report]** | | ||
+ | |**Margins** |North, East, South, West margins |**10, 10, 10, 10** | | ||
+ | |||
+ | <code java> | ||
+ | buttonShowReport.setMargins(new UIInsets(10,10,10,10)); | ||
+ | </code> | ||
+ | ==== Set display mode ==== | ||
+ | |||
+ | Changes the display mode of an editing panel. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Editing Panel** |editing panels |**[Editing Panel: morphPanelMain]** | | ||
+ | |**Display Mode** |display modes |**Tabset** | | ||
+ | |||
+ | <code java> | ||
+ | morphPanelMain.setDisplayMode(DisplayMode.Tabset); | ||
+ | </code> | ||
+ | ==== Set divider position ==== | ||
+ | |||
+ | Sets the divider position of a split panel. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Split Panel** |editing panels |**[Split Panel: morphPanelMain]** | | ||
+ | |**Position** |number value |**350** | | ||
+ | |||
+ | <code java> | ||
+ | morphPanelMain.setDividerPosition(350); | ||
+ | </code> | ||
+ | ==== Set element editable ==== | ||
+ | |||
+ | Enables editing of a table view or trees. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Element** |table view, tree |**[TableView: Contacts]** | | ||
+ | |||
+ | <code java> | ||
+ | tableContacts.setEditable(true); | ||
+ | </code> | ||
+ | ==== Set element not editable ==== | ||
+ | |||
+ | Disables editing of a table view or trees. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Element** |table view, tree |**[TableView: Contacts]** | | ||
+ | |||
+ | <code java> | ||
+ | tableContacts.setEditable(false); | ||
+ | </code> | ||
+ | ==== Set font ==== | ||
+ | |||
+ | Changes the font of an element. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Element** |elements |**[Group Panel: Contacts]** | | ||
+ | |**Font** |list of fonts |**Comic Sans MS** | | ||
+ | |**Size** |number |**16** | | ||
+ | |**Bold** |yes/no |**yes** | | ||
+ | |**Italic** |yes/no |**yes** | | ||
+ | |||
+ | <code java> | ||
+ | groupPanelOverview.setFont(new UIFont("Comic Sans MS",3,16)); | ||
+ | </code> | ||
+ | ==== Set gap between text and image ==== | ||
+ | |||
+ | Changes the gap between the image and the text within a button. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Button** |buttons |**[Button: Save]** | | ||
+ | |**Gap** |number or parameter |**30** | | ||
+ | |||
+ | <code java> | ||
+ | groupPanelOverview.setFont(new UIFont("Comic Sans MS",3,16)); | ||
+ | </code> | ||
+ | ==== Set horizontal alignment ==== | ||
+ | |||
+ | Changes the alignment of an element text. Left, center and right are possible. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Element** |element |**[Button: Save]** | | ||
+ | |**Alignment** |left, center, right |**right** | | ||
+ | |||
+ | <code java> | ||
+ | buttonButton15.setHorizontalAlignment(UIButton.ALIGN_RIGHT); | ||
+ | </code> | ||
+ | ==== Set horizontal text position ==== | ||
+ | |||
+ | Changes the alignment of a button text in relation to the button image. Left, center and right are possible. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Button** |button |**[Button: Save]** | | ||
+ | |**Alignment** |left, center, right |**right** | | ||
+ | |||
+ | <code java> | ||
+ | buttonButton10.setHorizontalTextPosition(UIButton.ALIGN_RIGHT); | ||
+ | </code> | ||
+ | ==== Set image ==== | ||
+ | |||
+ | Changes the image of a button. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Element** |button |**[Button: Save]** | | ||
+ | |**Image** |Image wizard |**save.png** | | ||
+ | |||
+ | <code java> | ||
+ | buttonButton15.setImage(UIImage.getImage(UIImage.SAVE_SMALL)); | ||
+ | </code> | ||
+ | ==== Set label ==== | ||
+ | |||
+ | Changes the text of a label. It's possible to concatenate different values like fixed text and column values. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Label** |Label |**[Label: Hallo]** | | ||
+ | |**Text** |text, column value, filter value, parameter, concatenation of all |**Hello, [Contacts.Firstname] [Contacts.Lastname]** | | ||
+ | |||
+ | <code java> | ||
+ | labelLabel.setText("Hello, " + Text.val(new Var(rdbContacts,"FIRSTNAME")) + " "+ Text.val(new Var(rdbContacts,"LASTNAME"))); | ||
+ | </code> | ||
+ | Hint: It's possible to use HTML tags within the label. | ||
<code> | <code> | ||
- | if (Logical.equals(rdbUserdata.getValue("CREATEDON"),"")) | + | <html><div style="color:red;"><b><i>Hello,</i></b></div></html> |
- | { | + | </code> |
- | // "If" - Path | + | ==== Set maximum size ==== |
+ | |||
+ | Changes the maximum height and width of an element. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Element** |element |**[Button: Save]** | | ||
+ | |**Width** |number or parameter |**150** | | ||
+ | |**Height** |number or parameter |**50** | | ||
+ | |||
+ | <code java> | ||
+ | buttonButton16.setMaximumSize(150,50); | ||
+ | </code> | ||
+ | ==== Set minimum size ==== | ||
+ | |||
+ | Changes the minimum height and width of an element. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Element** |element |**[Button: Save]** | | ||
+ | |**Width** |number or parameter |**150** | | ||
+ | |**Height** |number or parameter |**50** | | ||
+ | |||
+ | <code java> | ||
+ | buttonButton16.setMinimumSize(150,50); | ||
+ | </code> | ||
+ | ==== Set mouse over image ==== | ||
+ | |||
+ | Changes the mouse over image of a button. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Button** |button |**[Button: Save]** | | ||
+ | |**Image** |image wizard |**save.png** | | ||
+ | |||
+ | <code java> | ||
+ | buttonButton16.setMouseOverImage(UIImage.getImage(UIImage.SAVE_LARGE)); | ||
+ | </code> | ||
+ | ==== Set navigation mode ==== | ||
+ | |||
+ | Changes the navigation mode of an editing panel. | ||
+ | |||
+ | The navigation by single or double click works only if on the first tab is a table placed and on the second the input form. The display mode must be **inline** or **popup** and the navigation hidden. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Editing Panel** |editing panel |**[Editing Panel: morphPanelMain]** | | ||
+ | |**Navigation Mode** |None, Single Click, Double Click |**Double Click** | | ||
+ | |||
+ | <code java> | ||
+ | morphPanelMain.setInlineAndPopupNavigationMode(NavigationMode.DoubleClick); | ||
+ | </code> | ||
+ | ==== Set placeholder ==== | ||
+ | |||
+ | Sets a placeholder text on an element. | ||
+ | |||
+ | For example, a date format placeholder text can be displayed in a birthday input field. The text is light grey and only displayed, when the editor / element is empty. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Element** |element |**[Editor: Contacts.Birthday]** | | ||
+ | |**Text** |text, column value, filter value, parameter, concatenation of all |**DD.MM.YYYY (01.01.1999)** | | ||
+ | |||
+ | <code java> | ||
+ | editContactsBirthday.setPlaceholder("DD.MM.YYYY (01.01.1999)"); | ||
+ | </code> | ||
+ | ==== Set preferred size ==== | ||
+ | |||
+ | Changes the preferred height and width of an element. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Element** |element |**[Button: Save]** | | ||
+ | |**Width** |number or parameter |**150** | | ||
+ | |**Height** |number or parameter |**50** | | ||
+ | |||
+ | <code java> | ||
+ | buttonButton15.setPreferredSize(150,50); | ||
+ | </code> | ||
+ | ==== Set pressed image ==== | ||
+ | |||
+ | Changes the on button click image of a button. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Button** |button |**[Button: Save]** | | ||
+ | |**Image** |image wizard |**save.png** | | ||
+ | |||
+ | <code java> | ||
+ | buttonButton16.setPressedImage(UIImage.getImage(UIImage.SAVE_LARGE)); | ||
+ | </code> | ||
+ | ==== Set tab image ==== | ||
+ | |||
+ | Changes the image of the selected tab. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Tabset** |Tabset |**[Tabset: tabsetPanelMain]** | | ||
+ | |**Tabset** |Tab of selected Tabset |**2. customers** | | ||
+ | |**Image** |image wizard |**about.png** | | ||
+ | |||
+ | <code java> | ||
+ | tabsetPanelMain.setIconAtIfExists(1,UIImage.getImage(UIImage.ABOUT_SMALL)); | ||
+ | </code> | ||
+ | ==== Set tab text ==== | ||
+ | |||
+ | Changes the text of the selected tab. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Tabset** |Tabset |**[Tabset: tabsetPanelMain]** | | ||
+ | |**Tabset** |Tab of selected Tabset |**2. customers** | | ||
+ | |**Text** |text, column value, filter value, parameter, concatenation of all |**[Customers.company name]** | | ||
+ | |||
+ | <code java> | ||
+ | tabsetPanelMain.setTextAtIfExists(1,Text.val(new Var(rdbCustomers,"COMPANY_NAME"))); | ||
+ | </code> | ||
+ | ==== Set text color ==== | ||
+ | |||
+ | Changes the text color of an element. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Element** |element |**[Button: Save]** | | ||
+ | |**Color** |Color chooser |**#FF0000** | | ||
+ | |||
+ | <code java> | ||
+ | buttonButton15.setForeground(new UIColor(0xff0000)); | ||
+ | </code> | ||
+ | ==== Set tooltip ==== | ||
+ | |||
+ | Changes the tooltip text of an element. The tooltip is displayed when the mouse is positioned over the selected element. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Element** |element |**[Button: Save]** | | ||
+ | |**Text** |text, column value, filter value, parameter, concatenation of all |**This button saves all changes.** | | ||
+ | |||
+ | <code java> | ||
+ | buttonButton15.setToolTipText("This button saves all changes."); | ||
+ | </code> | ||
+ | ==== Set vertical alignment ==== | ||
+ | |||
+ | Changes the vertical alignment of a selected element. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Element** |element |**[Button: Save]** | | ||
+ | |**Alignment** |top, middle, bottom |**top** | | ||
+ | |||
+ | <code java> | ||
+ | buttonButton15.setVerticalAlignment(UIButton.ALIGN_TOP); | ||
+ | </code> | ||
+ | ==== Set vertical text position ==== | ||
+ | |||
+ | Changes the vertical text position of a button in relation to the button image. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Button** |button |**[Button: Save]** | | ||
+ | |**Position** |top, middle, bottom |**top** | | ||
+ | |||
+ | <code java> | ||
+ | buttonButton15.setVerticalTextPosition(UIButton.ALIGN_TOP); | ||
+ | </code> | ||
+ | ==== Show button border ==== | ||
+ | |||
+ | Shows the border of the selected button. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Button** |Button |**[Button: Save]** | | ||
+ | |||
+ | <code java> | ||
+ | buttonButton14.setBorderPainted(false); | ||
+ | </code> | ||
+ | ==== Show button border if mouse is not over ==== | ||
+ | |||
+ | Shows the border of the selected button if the mouse cursor is not pointing over the button. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Button** |Button |**[Button: Save]** | | ||
+ | |||
+ | <code java> | ||
+ | buttonButton15.setBorderOnMouseEntered(false); | ||
+ | </code> | ||
+ | ==== Show button border if mouse is over ==== | ||
+ | |||
+ | Shows the border of the selected button if the mouse cursor points over the button. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Button** |Button |**[Button: Save]** | | ||
+ | |||
+ | <code java> | ||
+ | buttonButton15.setBorderOnMouseEntered(true); | ||
+ | </code> | ||
+ | ==== Show column ==== | ||
+ | |||
+ | Shows the selected column of a Table. The column will be placed at the end of all displayed columns. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Column** |Table column |**[Contacts.Firstname]** | | ||
+ | |||
+ | <code java> | ||
+ | DataBookUtil.showColumn(new Var(rdbContacts,"FIRSTNAME")); | ||
+ | </code> | ||
+ | ==== Show editor border ==== | ||
+ | |||
+ | Shows the border of an input field used in the screen. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Editor** |editors used in screen |**[Editor: Contacts.Firstname]** | | ||
+ | |||
+ | <code java> | ||
+ | editContactsFirstname.setBorderVisible(false); | ||
+ | </code> | ||
+ | ==== Show element ==== | ||
+ | |||
+ | Shows the selected element used in the screen. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Element** |element of the screen |**[Editor: Contacts.Firstname]** | | ||
+ | |||
+ | <code java> | ||
+ | editContactsFirstname.setVisible(true); | ||
+ | </code> | ||
+ | ==== Show navigation ==== | ||
+ | |||
+ | Shows the navigation of an editing panel in display mode Tabset or Inline. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Editing Panel** |element of the screen |**[Editing Panel: morphPanelMain]** | | ||
+ | |||
+ | <code java> | ||
+ | morphPanelMain.setTabHeaderVisible(true); | ||
+ | </code> | ||
+ | ==== Start editing ==== | ||
+ | |||
+ | Starts editing in the selected row and column of a table view. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Element** |table views |**[TableView: Contacts]** | | ||
+ | |||
+ | <code java> | ||
+ | tableContacts.startEditing(); | ||
+ | </code> | ||
+ | ==== Toggle button down ==== | ||
+ | |||
+ | The selected toggle button (checkbox, radio- or toggle button) is pressed. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Button** |checkbox, radio button, toggle button |**[Check Box: Check Box]** | | ||
+ | |||
+ | <code java> | ||
+ | checkBoxCheckBox.setSelected(true); | ||
+ | </code> | ||
+ | ==== Toggle button up ==== | ||
+ | |||
+ | The selected toggle button (checkbox, radio- or toggle button) is unpressed. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Button** |checkbox, radio button, toggle button |**[Check Box: Check Box]** | | ||
+ | |||
+ | <code java> | ||
+ | checkBoxCheckBox.setSelected(false); | ||
+ | </code> | ||
+ | ==== Trigger validation error ==== | ||
+ | |||
+ | Shows a validation error. The defined error message is shown in a Validation Result area. | ||
+ | |||
+ | Hint: Only triggered within a validator will display it in the Validation Result. If this action is placed on a button, it will be displayed in a message dialog. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Message** |text, column value, filter value, parameter, concatenation of all |**The email [Customers.email] is not valid.** | | ||
+ | |||
+ | <code java> | ||
+ | throw new Exception("The email " + Text.val(new Var(rdbCustomers,"EMAIL")) + " is not valid."); | ||
+ | </code> | ||
+ | ===== Work screen ===== | ||
+ | |||
+ | ==== Center this screen ==== | ||
+ | |||
+ | Centers the current screen (horizontally and vertically). It only works, if the screen is not maximized. | ||
+ | |||
+ | <code java> | ||
+ | center(); | ||
+ | </code> | ||
+ | ==== Close screen ==== | ||
+ | |||
+ | Closes the selected screen. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Screen** |List of screens |**Contacts** | | ||
+ | |||
+ | <code java> | ||
+ | ((ProjX)getApplication()).close("com.sibvisions.apps.vxdemo.screens.ContactsWorkScreen"); | ||
+ | </code> | ||
+ | ==== Close this screen ==== | ||
+ | |||
+ | Closes the current screen. | ||
+ | |||
+ | <code java> | ||
+ | close(); | ||
+ | </code> | ||
+ | ==== Disable manual save and reload ==== | ||
+ | |||
+ | Changes are saved automatically. | ||
+ | |||
+ | Hint: The current screen is attached to the application toolbar. Clicking "Save" or "Reload" on the toolbar is working within the current screen. | ||
+ | |||
+ | <code java> | ||
+ | setManualSaveAndReload(false); | ||
+ | </code> | ||
+ | ==== Discard all changes ==== | ||
+ | |||
+ | Discards all changes on a screen, without reloading the data. | ||
+ | |||
+ | Hint: This command is used to discard changes on a form using a "Cancel" button. | ||
+ | |||
+ | <code java> | ||
+ | getDataSource().restoreAllDataBooks(); | ||
+ | </code> | ||
+ | ==== Enable manual save and reload ==== | ||
+ | |||
+ | No changes are saved automatically. To save or undo changes, there are the following actions: | ||
+ | |||
+ | * Save all changes | ||
+ | * Save table | ||
+ | * Reload all | ||
+ | * Reload all screens | ||
+ | * Reload table | ||
+ | * Discard all changes | ||
+ | |||
+ | Hint: The current screen is detached from the application toolbar. Clicking "Save" or "Reload" on the toolbar is ignored within the current screen. | ||
+ | |||
+ | <code java> | ||
+ | setManualSaveAndReload(true); | ||
+ | </code> | ||
+ | ==== Open Screen ==== | ||
+ | |||
+ | Opens the selected workscreen. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Screen** |List of screens |**Contacts** | | ||
+ | |||
+ | <code java> | ||
+ | ((ProjX)getApplication()).openWorkScreen("com.sibvisions.apps.vxdemo.screens.ContactsWorkScreen"); | ||
+ | </code> | ||
+ | ==== Reload all ==== | ||
+ | |||
+ | Discards all changes and reloads records of the current screen from the database. | ||
+ | |||
+ | <code java> | ||
+ | getDataSource().reloadAllDataBooks(); | ||
+ | </code> | ||
+ | ==== Save all changes ==== | ||
+ | |||
+ | Saves all changes of the current screen. | ||
+ | |||
+ | <code java> | ||
+ | getDataSource().saveAllDataBooks(); | ||
+ | </code> | ||
+ | ==== Set Parameter ==== | ||
+ | |||
+ | Sets a parameter with a static value. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Name** |text value |VALUE | | ||
+ | |**Value** |text, column value, filter value, parameter | | | ||
+ | |||
+ | <code java> | ||
+ | setParameter("VALUE","100"); | ||
+ | </code> | ||
+ | ==== Set Parameter with calculated value ==== | ||
+ | |||
+ | Sets a parameter with a calculated value. For more information see [[#formulas|Formulas]] | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Name** |text value |VALUE | | ||
+ | |**Fromula** |text, column value, filter value, parameter |[Order Details.Quantity]*[Order Details.Unit Price] | | ||
+ | |||
+ | <code java> | ||
+ | Calc.setParameter(this,"VALUE",Calc.val(new Var(rdbOrderdetails,"QUANTITY")) * Calc.val(new Var(rdbOrderdetails,"UNIT_PRICE"))); | ||
+ | </code> | ||
+ | ==== Set Parameter with concatenated text ==== | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Name** |text value |VALUE | | ||
+ | |**Text** |text, column value, filter value, parameter, concatenation of all | | | ||
+ | |||
+ | <code java> | ||
+ | Text.setParameter(this,"VALUE",Text.val(new Var(rdbContacts,"FIRSTNAME")) + " " + Text.val(new Var(rdbContacts,"LASTNAME"))); | ||
+ | </code> | ||
+ | ====== List of conditions ====== | ||
+ | |||
+ | ===== Conditions ===== | ||
+ | |||
+ | If an action is to be executed only in certain cases, then conditions are required. Always 2 values are compared by means of a given condition. If this condition is fulfilled, one or more actions are executed, if this condition is not fulfilled, another action can be executed. Conditions are nestable. | ||
+ | |||
+ | ==== Are equal ==== | ||
+ | |||
+ | Compares two values if they are equal. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Value 1** |text, column value, filter value, parameter |**Contacts** | | ||
+ | |**Value 2** |text, column value, filter value, parameter |**Contacts** | | ||
+ | |||
+ | <code java> | ||
+ | if (Logical.equals(rdbContacts.getValue("TOWN"),"Vienna")) { | ||
+ | showInformation(this,"Yes"); | ||
} | } | ||
- | else | + | else { |
- | { | + | showInformation(this,"No"); |
- | // "Else" - Path | + | |
} | } | ||
</code> | </code> | ||
- | ===== If Between / If Not Between ===== | + | ==== Are not equal ==== |
- | If the first parameter is greater than or equal to the second parameter and the first parameter is also smaller than or equal to the third parameter, then the commands in the "If" path are executed, otherwise the commands in the "Else" path are executed. "If not between" results in the opposite. | + | Compares two values if they are not equal. |
- | Parameters: ''%%[List of all columns of all tables of the workscreen or a constant value], [List of all columns of all tables of the workscreen or a constant value]%%'' | + | ^Parameter ^Description ^Example ^ |
+ | |**Value 1** |text, column value, filter value, parameter |**Contacts** | | ||
+ | |**Value 2** |text, column value, filter value, parameter |**Contacts** | | ||
- | Hint: This command is often used to check a date field against a specified date range, or to check a number field against a specified range of values. | + | <code java> |
+ | if (!Logical.equals(rdbContacts.getValue("TOWN"),"Vienna")) { | ||
+ | showInformation(this,"Yes"); | ||
+ | } | ||
+ | else { | ||
+ | showInformation(this,"No"); | ||
+ | } | ||
+ | </code> | ||
+ | ==== Are validations in area ok ==== | ||
+ | |||
+ | It's possible to check all validators of a grouping element or a validator directly When all validators or the selected are correct, the actions in the "If" path are executed, otherwise the actions in the "Else" path are executed. | ||
+ | |||
+ | Hint: It is also possible to check nested elements here. For example, if a panel is selected, all validators on the panel and on all panels that have been placed on this panel are checked. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Element** |grouping elements, validators |**[Group Panel: Contacts]** | | ||
<code java> | <code java> | ||
- | if (Logical.between(rdbUserdata.getValue("PRICE"),100, 1000)) | + | if (validationResult2.isValid()) { |
- | { | + | showInformation(this,"yes"); |
- | // "If" - Path | + | |
} | } | ||
- | else | + | else { |
- | { | + | showInformation(this,"no"); |
- | // "Else" - Path | + | |
} | } | ||
</code> | </code> | ||
- | ===== If a row is selected ===== | + | ==== Are validations ok ==== |
+ | |||
+ | If all validation elements on the same grouping element as the result element are correct, then the actions in the "If" path are executed, otherwise the actions in the "Else" path are executed. | ||
- | If a row is selected in the specified table, then the commands in the "If" path are executed, otherwise the commands in the "Else" path are executed. | + | Hint: This condition is often used to perform and show all field validations. If validation errors occur during the field validations, they are displayed collectively in the selected validation result. |
- | Parameters: ''%%[List of all tables of the workscreen]%%'' | + | ^Parameter ^Description ^Example ^ |
+ | |**Element** |Validation results |**[Validation Result: validationResult2]** | | ||
<code java> | <code java> | ||
- | if (Logical.equals(rdbUserdata.getValue("CREATEDON"),"")) { | + | if (validationResult2.isValid()) { |
- | // "If" - Path | + | showInformation(this,"yes"); |
} | } | ||
- | else | + | else { |
- | { | + | showInformation(this,"no"); |
- | // "Else" - Path | + | |
} | } | ||
</code> | </code> | ||
- | ===== Has Role / Not has Role ===== | + | ==== Has record ==== |
- | If the current user has the specified role, then the commands in the "If" path are executed, otherwise the commands in the "Else" path are executed. | + | Checks if a table has at least one record. |
- | Parameters: ''%%[List of all roles in the application]%%'' | + | Hint: If a filter is used in the screen, you may reset or if needed set the filter to check if there are any records. |
- | Hint: This command can be used to restrict access to information according to user roles. Role restriction at the data level! | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |tables |**[Table: Contacts]** | | ||
- | * Administrator is able to see everything, no filter | + | <code java> |
- | * Staff member can only see their own datasets, filtered by username | + | if (DataBookUtil.hasRecords(rdbContacts)) { |
+ | showInformation(this,"yes"); | ||
+ | } | ||
+ | else { | ||
+ | showInformation(this,"no"); | ||
+ | } | ||
+ | </code> | ||
+ | ==== Has role assigned ==== | ||
+ | |||
+ | This condition is true if the selected role has been assigned to the user. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Role** |roles |**Administrator** | | ||
<code java> | <code java> | ||
- | if (getApplication().hasRole("Administrator")) | + | if (getApplication().hasRole("Administrator")) { |
- | { | + | showInformation(this,"yes"); |
- | // "If" - Path | + | |
} | } | ||
- | else | + | else { |
- | { | + | showInformation(this,"no"); |
- | // "Else" - Path | + | |
} | } | ||
</code> | </code> | ||
- | ===== Is Enabled ===== | + | ==== Is Desktop environment ==== |
- | If the specified GUI element is active (see command "Enable Component"), then the commands in the "If" path are executed, otherwise the commands in the "Else" path are executed. | + | This condition is true when the application is executed in a desktop environment. |
- | Parameters: ''%%[List of all GUI elements of the workscreen]%%'' | + | <code java> |
+ | if (getApplication().getLauncher().isDesktopEnvironment()) { | ||
+ | showInformation(this,"yes"); | ||
+ | } | ||
+ | else { | ||
+ | showInformation(this,"no"); | ||
+ | } | ||
+ | </code> | ||
+ | ==== Is Html5 environment ==== | ||
+ | |||
+ | This condition is true when the application is executed in a Html5 environment. | ||
<code java> | <code java> | ||
- | if (edtLastName.isEnabled()) | + | if (getApplication().getLauncher().isDesktopEnvironment()) { |
- | { | + | showInformation(this,"yes"); |
- | // "If" - Path | + | |
} | } | ||
- | else | + | else { |
- | { | + | showInformation(this,"no"); |
- | // "Else" - Path | + | |
} | } | ||
</code> | </code> | ||
- | ===== Is Visible ===== | + | ==== Is Mobile environment ==== |
- | If the specified GUI element is visible (see command "Show Component"), then the commands in the "If" path are executed, otherwise the commands in the "Else" path are executed. | + | This condition is true when the application is executed in a mobile environment. |
- | Parameters: ''%%[List of all GUI elements of the workscreen]%%'' | + | <code java> |
+ | if (getApplication().getLauncher().isMobileEnvironment()) { | ||
+ | showInformation(this,"yes"); | ||
+ | } | ||
+ | else { | ||
+ | showInformation(this,"no"); | ||
+ | } | ||
+ | </code> | ||
+ | ==== Is REST environment ==== | ||
+ | |||
+ | This condition is true when the application is executed in a REST environment. | ||
<code java> | <code java> | ||
- | if (edtLastName.isVisible()) | + | if (getApplication().getLauncher().isRESTEnvironment()) { |
- | { | + | showInformation(this,"yes"); |
- | // "If" - Path | + | |
} | } | ||
- | else | + | else { |
- | { | + | showInformation(this,"no"); |
- | // "Else" - Path | + | |
} | } | ||
</code> | </code> | ||
- | ===== Is Button Selected ===== | + | ==== Is Service environment ==== |
- | If the specified button is selected (checked) (see command "show element"), then the commands in the "If" path are executed, otherwise the commands in the "Else" path are executed. | + | This condition is true when the application is executed in a service environment. |
+ | |||
+ | <code java> | ||
+ | if ("APPSERVICES".equals(getApplication().getLauncher().getEnvironmentName())) { | ||
+ | showInformation(this,"yes"); | ||
+ | } | ||
+ | else { | ||
+ | showInformation(this,"no"); | ||
+ | } | ||
+ | </code> | ||
+ | ==== Is Test environment ==== | ||
- | Parameters: ''%%[List of all GUI elements of the workscreen]%%'' | + | This condition is true when the application is executed in a test environment. |
<code java> | <code java> | ||
- | if (edtLastName.isSelected()) | + | if (getApplication().getLauncher().isHeadlessEnvironment()) { |
- | { | + | showInformation(this,"yes"); |
- | // "If" - Path | + | |
} | } | ||
- | else | + | else { |
- | { | + | showInformation(this,"no"); |
- | // "Else" - Path | + | |
} | } | ||
</code> | </code> | ||
- | ===== Is Tab Selected ===== | + | ==== Is between ==== |
- | If the specified tab is selected (see command "Select Tab "), then the commands in the "If" path are executed, otherwise the commands in the "Else" path are executed. | + | This condition is true when the selected value is between minimum and maximum value. |
- | Parameters: ''%%[Element: List of all tab controls of the workscreen]%%'' | + | ^Parameter ^Description ^Example ^ |
+ | |**value** |text, column value, filter value, parameter |**[Contacts.Birthday]** | | ||
+ | |**minimum value** |text, column value, filter value, parameter |**01.01.1990** | | ||
+ | |**maximum value** |text, column value, filter value, parameter |**31.12.2022** | | ||
- | Parameters: ''%%[Tab: List of all tabs of the previously selected tab control]%%'' | + | <code java> |
+ | if (Logical.between(rdbContacts.getValue("BIRTHDAY"),"01.01.1990","31.12.2022")) { | ||
+ | showInformation(this,"yes"); | ||
+ | } | ||
+ | else { | ||
+ | showInformation(this,"no"); | ||
+ | } | ||
+ | </code> | ||
+ | ==== Is column changed ==== | ||
+ | |||
+ | If the selected column is changed the condition is true and the actions in the "If" path are executed, otherwise the actions in the "Else" path are executed. | ||
+ | |||
+ | Hint: This condition works only with **Row value changed** and **Update** events. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Column** |column |**[Contacts.Firstname]** | | ||
<code java> | <code java> | ||
- | if (tabsetPanelMain.getSelectedIndex() == "Tab 2") | + | if (DataBookUtil.isChangedColumnName(pEvent,new Var(rdbContacts,"FIRSTNAME"))) { |
- | { | + | showInformation(this,"yes"); |
- | // "If" - Path | + | |
} | } | ||
- | else | + | else { |
- | { | + | showInformation(this,"no"); |
- | // "Else" - Path | + | |
} | } | ||
</code> | </code> | ||
- | ===== Is Column Changed ===== | + | ==== Is e-mail invalid ==== |
- | If the columns is changed (value changed) then the commands in the "If" path are executed, otherwise the commands in the "Else" path are executed. | + | If the first parameter is an invalid email address (W3C consortium definition), then the actions in the "If" path are executed, otherwise the actions in the "Else" path are executed. |
- | Parameters: ''%%[List of all table columns in a workscreen]%%'' | + | ^Parameter ^Description ^Example ^ |
+ | |**Text** |text, column value, filter value, parameter |**[Contacts.Email]** | | ||
<code java> | <code java> | ||
- | if (DataBookUtil.isChangedColumnName(pEvent,"LASTNAME")) | + | if (!Logical.isValidEmail((String)rdbContacts.getValue("EMAIL"))) { |
- | { | + | showInformation(this,"yes"); |
- | // "If" - Path | + | |
} | } | ||
- | else | + | else { |
- | { | + | showInformation(this,"no"); |
- | // "Else" - Path | + | |
} | } | ||
</code> | </code> | ||
- | ===== Are Validations Ok ===== | + | ==== Is enabled ==== |
- | If all field validations on the same panel (GUI Element) of the validation result element are correct, then the commands in the "If" path are executed, otherwise the commands in the "Else" path are executed. | + | If the selected element is enabled the condition is true and the actions in the "If" path are executed. |
- | Parameters: ''%%[List of all validation results]%%'' | + | ^Parameter ^Description ^Example ^ |
+ | |**Element** |element |**[Editor: Contacts.Firstname]** | | ||
- | Hint: This condition is often used to perform and show all field validations. If validation errors (see command "Validation Error") occur during the field validations, they are collectively shown in the specified validation result element. | + | <code java> |
+ | if (editContactsFirstname.isEnabled()) { | ||
+ | showInformation(this,"yes"); | ||
+ | } | ||
+ | else { | ||
+ | showInformation(this,"no"); | ||
+ | } | ||
+ | </code> | ||
+ | ==== Is first record selected ==== | ||
- | What does "on the same panel "mean? | + | If the first record of the selected table is selected the condition is true and the actions in the "If" path are executed. |
- | "Panel" means a GUI element that is merely a drawing area containing fields, labels, etc. VisionX performs all field validations that are on the same panel as the validation result. | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |table |**[Table: Contacts]** | | ||
<code java> | <code java> | ||
- | if (validationResult.isValid()) | + | if (DataBookUtil.isFirstRowSelected(rdbContacts)) { |
- | { | + | showInformation(this,"yes"); |
- | // "If" - Path | + | |
} | } | ||
- | else | + | else { |
- | { | + | showInformation(this,"no"); |
- | // "Else" - Path | + | |
} | } | ||
</code> | </code> | ||
- | ===== Is Invalid Email ===== | + | ==== Is greater ==== |
- | If the first parameter is an invalid email address (W3C consortium definition), then the commands in the "If" path are executed, otherwise the commands in the "Else" path are executed. | + | If the selected value is greater than the limit the condition is true and the actions in the "If" path are executed. |
- | Parameters: ''%%[List of all columns of all tables in the workscreen or a fixed value]%%'' | + | ^Parameter ^Description ^Example ^ |
+ | |**Value** |text, column value, filter value, parameter |**[Contacts.Birthday]** | | ||
+ | |**Limit** |text, column value, filter value, parameter |**01.01.1990** | | ||
<code java> | <code java> | ||
- | if (Logical.equals(rdbUserdata.getValue("CREATEDON"),"")) | + | if (Logical.greater(rdbContacts.getValue("BIRTHDAY"),"01.01.1990")) { |
- | { | + | showInformation(this,"yes"); |
- | // "If" - Path | + | |
} | } | ||
- | else | + | else { |
- | { | + | showInformation(this,"no"); |
- | // "Else" - Path | + | |
} | } | ||
</code> | </code> | ||
- | ===== Is Showing ===== | + | ==== Is greater or equal ==== |
- | This condition is true if the workscreen is showing and the operations "open" and "load" have been completed. The condition can be used for a events such as "After Row selected" to determine if the event occurred during initialization or if it was triggered by the user. | + | If the selected value is greater or equal than the limit the condition is true and the actions in the "If" path are executed. |
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Value** |text, column value, filter value, parameter |**[Contacts.Birthday]** | | ||
+ | |**Limit** |text, column value, filter value, parameter |**01.01.1990** | | ||
<code java> | <code java> | ||
- | if (isShowing()) | + | if (Logical.greaterOrEqual(rdbContacts.getValue("BIRTHDAY"),"01.01.1990")) { |
- | { | + | showInformation(this,"yes"); |
- | // "If" - Path | + | |
} | } | ||
- | else | + | else { |
- | { | + | showInformation(this,"no"); |
- | // "Else" - Path | + | |
} | } | ||
</code> | </code> | ||
- | ===== Is Importing ===== | + | ==== Is importing ==== |
This condition is true if the "import" action is currently executed. The condition can be used for events such as "After row selected" to determine if the event occurred during initialization or if it was triggered by the user. | This condition is true if the "import" action is currently executed. The condition can be used for events such as "After row selected" to determine if the event occurred during initialization or if it was triggered by the user. | ||
<code java> | <code java> | ||
- | if (ProjXUtil.isImporting()) | + | if (ProjXUtil.isImporting()) { |
- | { | + | showInformation(this,"yes"); |
- | // "If" - Path | + | |
} | } | ||
- | else | + | else { |
- | { | + | showInformation(this,"no"); |
- | // "Else" - Path | + | |
} | } | ||
</code> | </code> | ||
- | ===== Is Mobile Environment ===== | + | ==== Is last record selected ==== |
- | This condition is true when the application is executed in a mobile environment. | + | If the last record of the selected table is selected the condition is true and the actions in the "If" path are executed. |
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Table** |table |**[Table: Contacts]** | | ||
<code java> | <code java> | ||
- | if (getApplication().getLauncher().isMobileEnvironment()) | + | if (DataBookUtil.isLastRowSelected(rdbContacts,false)) { |
- | { | + | showInformation(this,"yes"); |
- | // "If" - Path | + | |
} | } | ||
- | else | + | else { |
- | { | + | showInformation(this,"no"); |
- | // "Else" - Path | + | |
} | } | ||
</code> | </code> | ||
- | ===== Is Desktop Environment ===== | + | ==== Is longer ==== |
- | This condition is true when the application is executed in a desktop environment. | + | If the value length is greater than the selected length the condition is true and the actions in the "If" path are executed. |
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Value** |column |**[Contacts.Birthday]** | | ||
+ | |**Length** |value, parameter |**10** | | ||
<code java> | <code java> | ||
- | if (getApplication().getLauncher().isDesktopEnvironment()) | + | if (Text.isLonger(new Var(rdbContacts,"FIRSTNAME"),10)) { |
- | { | + | showInformation(this,"yes"); |
- | // "If" - Path | + | |
} | } | ||
- | else | + | else { |
- | { | + | showInformation(this,"no"); |
- | // "Else" - Path | + | |
} | } | ||
</code> | </code> | ||
- | ===== Is Html5 Environment ===== | + | ==== Is not between ==== |
- | This condition is true when the application is executed in a Html5 environment. | + | This condition is true when the selected value is not between minimum and maximum value. |
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**value** |text, column value, filter value, parameter |**[Contacts.Birthday]** | | ||
+ | |**minimum value** |text, column value, filter value, parameter |**01.01.1990** | | ||
+ | |**maximum value** |text, column value, filter value, parameter |**01.01.2000** | | ||
<code java> | <code java> | ||
- | if (getApplication().getLauncher().isWebEnvironment()) | + | if (!Logical.between(rdbContacts.getValue("BIRTHDAY"),"01.01.1990","01.01.2000")) { |
- | { | + | showInformation(this,"yes"); |
- | // "If" - Path | + | |
} | } | ||
- | else | + | else { |
- | { | + | showInformation(this,"no"); |
- | // "Else" - Path | + | |
} | } | ||
</code> | </code> | ||
- | ===== Is Service Environment ===== | + | ==== Is pressed or checked ==== |
- | This condition is true when the application is executed in a service environment. | + | This condition is true when a toggle button is pressed or checkbox/radio button is checked. |
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Button** |checkbox, radio button, toggle button |**[Check Box: Check Box]** | | ||
<code java> | <code java> | ||
- | if ("APPSERVICES".equals(getApplication().getLauncher().getEnvironmentName())) | + | if (checkBoxCheckBox1.isSelected()) { |
- | { | + | showInformation(this,"yes"); |
- | // "If" - Path | + | |
} | } | ||
- | else | + | else { |
- | { | + | showInformation(this,"no"); |
- | // "Else" - Path | + | |
} | } | ||
</code> | </code> | ||
- | ====== Loop ====== | + | ==== Is record selected ==== |
- | Loops are used to execute commands multiple times for the datasets of a table/view. | + | If any record of the selected table is selected the condition is true and the actions in the "If" path are executed. |
- | ===== Example: Create sum ===== | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |table |**[Table: Contacts]** | | ||
- | A typical application of a repetition is the generation of the sum from a number of individual values. The individual values (e.g. table "Items") are saved in a detail table, which is used as the parameter for the repetition. | + | <code java> |
+ | if (rdbContacts.getSelectedRow() >= 0) { | ||
+ | showInformation(this,"yes"); | ||
+ | } | ||
+ | else { | ||
+ | showInformation(this,"no"); | ||
+ | } | ||
+ | </code> | ||
+ | ==== Is row selected ==== | ||
- | {{:visionx:actions:sum-1.png?nolink|The example of creating a sum.}} | + | If a certain row of the selected table is selected the condition is true and the actions in the "If" path are executed. |
- | - The column "Bill.Total" is set to 0. | + | Hint: The row numbers start at 0 and not at 1. For example, the row numbered 2 is the 3rd row in the table. |
- | - The following command is executed for all rows of the table "Items": | + | |
- | - Calculate ''%%[Bill.Total] + [Items.Price]%%'' and write the resulting value to "[Bill.Total]". | + | |
- | All prices are added and the total is saved in the "Bill.Total" column | + | ^Parameter ^Description ^Example ^ |
+ | |**Table** |table |**[Table: Contacts]** | | ||
+ | |**Row number** |number, parameter |**0** | | ||
- | ===== Example: Keeping sub-totals current ===== | + | <code java> |
+ | if (rdbContacts.getSelectedRow() == 0) { | ||
+ | showInformation(this,"yes"); | ||
+ | } | ||
+ | else { | ||
+ | showInformation(this,"no"); | ||
+ | } | ||
+ | </code> | ||
+ | ==== Is screen showing ==== | ||
- | Another common example is the generation of sub-totals after each individual entry. In the example below, the table "To-dos" contains a column "Value1" (e.g. for expenses). For each To-do row we would like to know the amount of expenses that have accumulated up to and including the current To-do item. | + | The condition is true when the current screen is displayed and not closed. |
- | The values in the "Value1" column are added from the first row to the currently selected row using the sumToCurrent([Todos.Value1]) group function. This function returns the sub-total of expenses in each To-do row. | + | <code java> |
+ | if (isShowing()) { | ||
+ | showInformation(this,"yes"); | ||
+ | } | ||
+ | else { | ||
+ | showInformation(this,"no"); | ||
+ | } | ||
+ | </code> | ||
+ | ==== Is selected row greater ==== | ||
- | If the expenses for an individual To-do item ("Value1" column) are changed, all sub-totals in all rows have to be recalculated. This calculation can be performed using a repetition involving all rows in the To-dos table. It is good practice to add this action as a "value change" event in the "To-dos" table. In addition, the currently selected row in the "Todos" table should be saved, and restored after the operation is completed. | + | If the current row of the selected table is greater than the defined row number the condition is true and the actions in the "If" path are executed. |
- | {{:visionx:actions:sum-2.png?nolink|The example of creating sub-totals.}} | + | Hint: The row numbers start at 0 and not at 1. For example, the row numbered 2 is the 3rd row in the table. |
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Table** |table |**[Table: Contacts]** | | ||
+ | |**Row number** |value, parameter |**5** | | ||
+ | |||
+ | <code java> | ||
+ | if (rdbContacts.getSelectedRow() > 5) { | ||
+ | showInformation(this,"yes"); | ||
+ | } | ||
+ | else { | ||
+ | showInformation(this,"no"); | ||
+ | } | ||
+ | </code> | ||
+ | ==== Is selected row greater or equal ==== | ||
+ | |||
+ | If the current row of the selected table is greater or equal than the defined row number the condition is true and the actions in the "If" path are executed. | ||
+ | |||
+ | Hint: The row numbers start at 0 and not at 1. For example, the row numbered 2 is the 3rd row in the table. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Table** |table |**[Table: Contacts]** | | ||
+ | |**Row number** |value, parameter |**5** | | ||
+ | |||
+ | <code java> | ||
+ | if (rdbContacts.getSelectedRow() >= 5) { | ||
+ | showInformation(this,"yes"); | ||
+ | } | ||
+ | else { | ||
+ | showInformation(this,"no"); | ||
+ | } | ||
+ | </code> | ||
+ | ==== Is selected row smaller ==== | ||
+ | |||
+ | If the current row of the selected table is smaller than the defined row number the condition is true and the actions in the "If" path are executed. | ||
+ | |||
+ | Hint: The row numbers start at 0 and not at 1. For example, the row numbered 2 is the 3rd row in the table. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Table** |table |**[Table: Contacts]** | | ||
+ | |**Row number** |value, parameter |**5** | | ||
+ | |||
+ | <code java> | ||
+ | if (rdbContacts.getSelectedRow() < 5) { | ||
+ | showInformation(this,"yes"); | ||
+ | } | ||
+ | else { | ||
+ | showInformation(this,"no"); | ||
+ | } | ||
+ | </code> | ||
+ | ==== Is selected row smaller or equal ==== | ||
+ | |||
+ | If the current row of the selected table is smaller or equal than the defined row number the condition is true and the actions in the "If" path are executed. | ||
+ | |||
+ | Hint: The row numbers start at 0 and not at 1. For example, the row numbered 2 is the 3rd row in the table. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Table** |table |**[Table: Contacts]** | | ||
+ | |**Row number** |value, parameter |**5** | | ||
+ | |||
+ | <code java> | ||
+ | if (rdbContacts.getSelectedRow() <= 5) { | ||
+ | showInformation(this,"yes"); | ||
+ | } | ||
+ | else { | ||
+ | showInformation(this,"no"); | ||
+ | } | ||
+ | </code> | ||
+ | ==== Is shorter ==== | ||
+ | |||
+ | If the value length is shorter than the selected length the condition is true and the actions in the "If" path are executed. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Value** |column |**[Contacts.Birthday]** | | ||
+ | |**Length** |value, parameter |**10** | | ||
+ | |||
+ | <code java> | ||
+ | if (Text.isShorter(new Var(rdbContacts,"FIRSTNAME"),10)) { | ||
+ | showInformation(this,"yes"); | ||
+ | } | ||
+ | else { | ||
+ | showInformation(this,"no"); | ||
+ | } | ||
+ | </code> | ||
+ | ==== Is smaller ==== | ||
+ | |||
+ | If the selected value is smaller than the limit the condition is true and the actions in the "If" path are executed. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Value** |text, column value, filter value, parameter |**[Contacts.Birthday]** | | ||
+ | |**Limit** |text, column value, filter value, parameter |**01.01.1990** | | ||
+ | |||
+ | <code java> | ||
+ | if (Logical.smaller(rdbContacts.getValue("BIRTHDAY"),"1.1.1990")) { | ||
+ | showInformation(this,"yes"); | ||
+ | } | ||
+ | else { | ||
+ | showInformation(this,"no"); | ||
+ | } | ||
+ | </code> | ||
+ | ==== Is smaller or equal ==== | ||
+ | |||
+ | If the selected value is smaller or equal than the limit the condition is true and the actions in the "If" path are executed. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Value** |text, column value, filter value, parameter |**[Contacts.Birthday]** | | ||
+ | |**Limit** |text, column value, filter value, parameter |**01.01.1990** | | ||
+ | |||
+ | <code java> | ||
+ | if (Logical.smaller(rdbContacts.getValue("BIRTHDAY"),"1.1.1990")) { | ||
+ | showInformation(this,"yes"); | ||
+ | } | ||
+ | else { | ||
+ | showInformation(this,"no"); | ||
+ | } | ||
+ | </code> | ||
+ | ==== Is tab selected ==== | ||
+ | |||
+ | If the selected tab is active the condition is true and actions in the "If" path are executed, otherwise the commands in the "Else" path are executed. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Tabset** |tabsets |**[Tabset: tabsetPanelMain]** | | ||
+ | |**Tab** |tabs of selected tabset |**1. contact** | | ||
+ | |||
+ | <code java> | ||
+ | if (tabsetPanelMain.getSelectedIndex() == 0) { | ||
+ | showInformation(this,"yes"); | ||
+ | } | ||
+ | else { | ||
+ | showInformation(this,"no"); | ||
+ | } | ||
+ | </code> | ||
+ | ==== Is visible ==== | ||
+ | |||
+ | If the selected element is visible the condition is true and the actions in the "If" path are executed. | ||
+ | |||
+ | Hint: see Actions **Hide element** and **Show element** | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Element** |elements |**[Editor: Contacts.Firstname]** | | ||
+ | |||
+ | <code java> | ||
+ | if (editContactsFirstname.isVisible()) { | ||
+ | showInformation(this,"yes"); | ||
+ | } | ||
+ | else { | ||
+ | showInformation(this,"no"); | ||
+ | } | ||
+ | </code> | ||
+ | ==== Not has record ==== | ||
+ | |||
+ | Checks if a table is empty. | ||
+ | |||
+ | Hint: If a filter is used in the screen, you may reset or if needed set the filter to check if there are any records. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Table** |tables |**[Table: Contacts]** | | ||
+ | |||
+ | <code java> | ||
+ | if (!DataBookUtil.hasRecords(rdbContacts)) { | ||
+ | showInformation(this,"yes"); | ||
+ | } | ||
+ | else { | ||
+ | showInformation(this,"no"); | ||
+ | } | ||
+ | </code> | ||
+ | ==== Not has role assigned ==== | ||
+ | |||
+ | This condition is true if the selected role has not been assigned to the user. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Role** |roles |**Administrator** | | ||
+ | |||
+ | <code java> | ||
+ | if (!getApplication().hasRole("Administrator")) { | ||
+ | showInformation(this,"yes"); | ||
+ | } | ||
+ | else { | ||
+ | showInformation(this,"no"); | ||
+ | } | ||
+ | </code> | ||
+ | ==== Not is longer ==== | ||
+ | |||
+ | If the value length is not greater than the selected length the condition is true and the actions in the "If" path are executed. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Value** |column |**[Contacts.Birthday]** | | ||
+ | |**Length** |value, parameter |**10** | | ||
+ | |||
+ | <code java> | ||
+ | if (!Text.isLonger(new Var(rdbContacts,"FIRSTNAME"),10)) { | ||
+ | showInformation(this,"yes"); | ||
+ | } | ||
+ | else { | ||
+ | showInformation(this,"no"); | ||
+ | } | ||
+ | </code> | ||
+ | ==== Not is record selected ==== | ||
+ | |||
+ | If no record of the selected table is selected the condition is true and the actions in the "If" path are executed. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Table** |table |**[Table: Contacts]** | | ||
+ | |||
+ | <code java> | ||
+ | if (rdbContacts.getSelectedRow() < 0) { | ||
+ | showInformation(this,"yes"); | ||
+ | } | ||
+ | else { | ||
+ | showInformation(this,"no"); | ||
+ | } | ||
+ | </code> | ||
+ | ==== Not is row selected ==== | ||
+ | |||
+ | If a certain row of the selected table is not selected the condition is true and the actions in the "If" path are executed. | ||
+ | |||
+ | Hint: The row numbers start at 0 and not at 1. For example, the row numbered 2 is the 3rd row in the table. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Table** |table |**[Table: Contacts]** | | ||
+ | |**Row number** |number, parameter |**5** | | ||
+ | |||
+ | <code java> | ||
+ | if (rdbContacts.getSelectedRow() != 5) { | ||
+ | showInformation(this,"yes"); | ||
+ | } | ||
+ | else { | ||
+ | showInformation(this,"no"); | ||
+ | } | ||
+ | </code> | ||
+ | ==== Not is shorter ==== | ||
+ | |||
+ | If the value length is not shorter than the selected length the condition is true and the actions in the "If" path are executed. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Value** |column |**[Contacts.Lastname]** | | ||
+ | |**Length** |value, parameter |**5** | | ||
+ | |||
+ | <code java> | ||
+ | if (!Text.isShorter(new Var(rdbContacts,"LASTNAME"),5)) { | ||
+ | showInformation(this,"yes"); | ||
+ | } | ||
+ | else { | ||
+ | showInformation(this,"no"); | ||
+ | } | ||
+ | </code> | ||
+ | ====== List of formulas ====== | ||
+ | |||
+ | A number of actions can include the use of formulas. E.g. "Calculate Value". | ||
+ | |||
+ | ===== Arithmetic operations ===== | ||
+ | |||
+ | Formulas allow for the calculation of values using basic arithmetic operations, as well as a variety of group functions. For arithmetic operations ''%%+%%'',''%%-%%'',''%%*%%'', ''%%/%%'' and brackets ''%%(%%'' ''%%)%%'' can be used. E.g.: ''%%12 *23 / 2 + (1 - [Items.Quantity] * [Items.Price]) - [Booking.Discount]%%''. | ||
+ | |||
+ | The arithmetic operations can be used with the following actions: | ||
+ | |||
+ | * [[#calculate_value|Calculate value]] | ||
+ | * [[#set_label_with_calculated_currency|Set label with calculated currency]] | ||
+ | * [[#set_label_with_calculated_date|Set label with calculated date]] | ||
+ | * [[#set_label_with_calculated_date_short|Set label with calculated date short]] | ||
+ | * [[#set_label_with_calculated_date_time|Set label with calculated date time]] | ||
+ | * [[#set_label_with_calculated_date_time_short|Set label with calculated date time short]] | ||
+ | * [[#set_label_with_calculated_time|Set label with calculated time]] | ||
+ | * [[#set_label_with_calculated_value|Set label with calculated value]] | ||
+ | * [[#set_parameter_with_calculated_value|Set Parameter with calculated value]] | ||
+ | |||
+ | ===== Group Functions ===== | ||
+ | |||
+ | Group functions calculate results based on all values in a table column. A list is created using each row in the table column; the group function is then applied to this list. E.g. ''%%avg([Items.Price])%%'' which returns the average of the prices in the table "Items". | ||
+ | |||
+ | In addition, all functions are available in the variant to return ''%%null%%'' if all values in the column were ''%%null%%''. These variants have the same name but are postfixed with "NoValue", E.g. ''%%avgNoValue([Items.Price])%%''. For additional information see [[http://en.wikipedia.org/wiki/Null_(SQL)|the Wikipedia entry on SQL Null]]. | ||
+ | |||
+ | The group functions can be used with the following actions: | ||
+ | |||
+ | * [[#calculate_value|Calculate value]] | ||
+ | * [[#set_label_with_calculated_currency|Set label with calculated currency]] | ||
+ | * [[#set_label_with_calculated_date|Set label with calculated date]] | ||
+ | * [[#set_label_with_calculated_date_short|Set label with calculated date short]] | ||
+ | * [[#set_label_with_calculated_date_time|Set label with calculated date time]] | ||
+ | * [[#set_label_with_calculated_date_time_short|Set label with calculated date time short]] | ||
+ | * [[#set_label_with_calculated_time|Set label with calculated time]] | ||
+ | * [[#set_label_with_calculated_value|Set label with calculated value]] | ||
+ | * [[#set_parameter_with_calculated_value|Set Parameter with calculated value]] | ||
+ | |||
+ | ==== avg / avgNoValue ==== | ||
+ | |||
+ | Returns the average of all values. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Value** |column |**[Items.Price]** | | ||
+ | |||
+ | <code java> | ||
+ | avg([Items.Price]) | ||
+ | avgNoValue([Items.Price]) | ||
+ | </code> | ||
+ | ==== min / minNoValue ==== | ||
+ | |||
+ | Returns the smallest value. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Value** |column |**[Items.Price]** | | ||
+ | |||
+ | <code java> | ||
+ | min([Items.Price]) | ||
+ | minNoValue([Items.Price]) | ||
+ | </code> | ||
+ | ==== max / maxNoValue ==== | ||
+ | |||
+ | Returns the largest value. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Value** |column |**[Items.Price]** | | ||
+ | |||
+ | <code java> | ||
+ | max([Items.Price]) | ||
+ | maxNoValue([Items.Price]) | ||
+ | </code> | ||
+ | ==== count / countNoValue ==== | ||
+ | |||
+ | Returns the number of entries. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Value** |column |**[Items.Price]** | | ||
+ | |||
+ | <code java> | ||
+ | count([Items.Price]) | ||
+ | countNoValue([Items.Price]) | ||
+ | </code> | ||
+ | ==== sum / sumNoValue ==== | ||
+ | |||
+ | Returns the sum of all values. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Value** |column |**[Items.Price]** | | ||
+ | |||
+ | <code java> | ||
+ | sum([Items.Price]) | ||
+ | sumNoValue([Items.Price]) | ||
+ | </code> | ||
+ | ==== sumToSelected / sumToSelectedNoValue ==== | ||
+ | |||
+ | Returns the sum of values from the first row to the selected row. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Value** |column |**[Items.Price]** | | ||
+ | |||
+ | <code java> | ||
+ | sumToSelected([Items.Price]) | ||
+ | sumToSelectedNoValue([Items.Price]) | ||
+ | </code> | ||
+ | ==== first / firstNoValue ==== | ||
+ | |||
+ | Returns the first value. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Value** |column |**[Items.Price]** | | ||
+ | |||
+ | <code java> | ||
+ | first([Items.Price]) | ||
+ | firstNoValue([Items.Price]) | ||
+ | </code> | ||
+ | ==== last / lastNoValue ==== | ||
+ | |||
+ | Returns the last value. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Value** |column |**[Items.Price]** | | ||
+ | |||
+ | <code java> | ||
+ | first([Items.Price]) | ||
+ | firstNoValue([Items.Price]) | ||
+ | </code> | ||
+ | ===== Date calculation ===== | ||
+ | |||
+ | The date calculation functions can be used with the following actions: | ||
+ | |||
+ | * [[#calculate_value|Calculate value]] | ||
+ | * [[#set_label_with_calculated_date|Set label with calculated date]] | ||
+ | * [[#set_label_with_calculated_date_short|Set label with calculated date short]] | ||
+ | * [[#set_label_with_calculated_date_time|Set label with calculated date time]] | ||
+ | * [[#set_label_with_calculated_date_time_short|Set label with calculated date time short]] | ||
+ | * [[#set_label_with_calculated_time|Set label with calculated time]] | ||
+ | * [[#set_parameter_with_calculated_value|Set Parameter with calculated value]] | ||
+ | |||
+ | ==== addYears ==== | ||
+ | |||
+ | Adds a given number of years to the date. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Value** |date column |**[Items.PublicationDate]** | | ||
+ | |||
+ | <code java> | ||
+ | addYears([Items.PublicationDate], 1) | ||
+ | </code> | ||
+ | ==== addMonths ==== | ||
+ | |||
+ | Adds a given number of months to the date. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Value** |date column |**[Items.PublicationDate]** | | ||
+ | |**Amount** |number |**1** | | ||
+ | |||
+ | <code java> | ||
+ | addMonths([Items.PublicationDate], 1) | ||
+ | </code> | ||
+ | ==== addDays ==== | ||
+ | |||
+ | Adds a given number of days to the date. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Value** |date column |**[Items.PublicationDate]** | | ||
+ | |**Amount** |number |**1** | | ||
+ | |||
+ | <code java> | ||
+ | addDays([Items.PublicationDate], 1) | ||
+ | </code> | ||
+ | ==== addHours ==== | ||
+ | |||
+ | Adds a given number of hours to the date. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Value** |date column |**[Items.PublicationDate]** | | ||
+ | |**Amount** |number |**1** | | ||
+ | |||
+ | <code java> | ||
+ | addHours([Items.PublicationDate], 1) | ||
+ | </code> | ||
+ | ==== addMinutes ==== | ||
+ | |||
+ | Adds a given number of minutes to the date. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Value** |date column |**[Items.PublicationDate]** | | ||
+ | |**Amount** |number |**1** | | ||
+ | |||
+ | <code java> | ||
+ | addMinutes([Items.PublicationDate], 1) | ||
+ | </code> | ||
+ | ==== addSeconds ==== | ||
+ | |||
+ | Adds a given number of seconds to the date. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Value** |date column |**[Items.PublicationDate]** | | ||
+ | |**Amount** |number |**1** | | ||
+ | |||
+ | <code java> | ||
+ | addSeconds([Items.PublicationDate], 1) | ||
+ | </code> | ||
+ | ==== yearsBetween ==== | ||
+ | |||
+ | Calculates the years between two dates. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Value** |date column |**[Items.PublicationDate]** | | ||
+ | |**Value** |date column |**1** | | ||
+ | |||
+ | <code java> | ||
+ | yearsBetween([Contacts.current date],[Contacts.Birthday]) | ||
+ | </code> | ||
+ | ==== monthsBetween ==== | ||
+ | |||
+ | Calculates the months between two dates. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Value** |date column |**[Items.PublicationDate]** | | ||
+ | |**Value** |date column |**1** | | ||
+ | |||
+ | <code java> | ||
+ | monthsBetween([Contacts.current date],[Contacts.Birthday]) | ||
+ | </code> | ||
+ | ([tag], [tag]) ### daysBetween | ||
+ | |||
+ | Calculates the days between two dates. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Value** |date column |**[Items.PublicationDate]** | | ||
+ | |**Value** |date column |**1** | | ||
+ | |||
+ | <code java> | ||
+ | daysBetween([Contacts.current date],[Contacts.Birthday]) | ||
+ | </code> | ||
+ | ==== hoursBetween ==== | ||
+ | |||
+ | Calculates the hours between two dates. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Value** |date column |**[Items.PublicationDate]** | | ||
+ | |**Value** |date column |**1** | | ||
+ | |||
+ | <code java> | ||
+ | hoursBetween([Contacts.current date],[Contacts.Birthday]) | ||
+ | </code> | ||
+ | ([tag], [tag]) ### minutesBetween | ||
+ | |||
+ | Calculates the minutes between two dates. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Value** |date column |**[Items.PublicationDate]** | | ||
+ | |**Value** |date column |**1** | | ||
+ | |||
+ | <code java> | ||
+ | minutesBetween([Contacts.current date],[Contacts.Birthday]) | ||
+ | </code> | ||
+ | ==== secondsBetween ==== | ||
+ | |||
+ | Calculates the seconds between two dates. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Value** |date column |**[Items.PublicationDate]** | | ||
+ | |**Value** |date column |**1** | | ||
+ | |||
+ | <code java> | ||
+ | secondsBetween([Contacts.current date],[Contacts.Birthday]) | ||
+ | </code> | ||
+ | ==== truncYear ==== | ||
+ | |||
+ | Truncates the date to the beginning of the year. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Value** |date column |**[Contacts.current date]** | | ||
+ | |||
+ | <code java> | ||
+ | truncYear([Contacts.current date]) | ||
+ | </code> | ||
+ | ^Before ^After ^ | ||
+ | |"July 22, 2022, 9:40 AM" |"January 1, 2022, 12:00 AM" | | ||
+ | |||
+ | ==== truncMonth ==== | ||
+ | |||
+ | Truncates the date to the beginning of the month. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Value** |date column |**[Contacts.current date]** | | ||
+ | |||
+ | <code java> | ||
+ | truncMonth([Contacts.current date]) | ||
+ | </code> | ||
+ | ^Before ^After ^ | ||
+ | |"July 22, 2022, 9:40 AM" |"July 1, 2022, 12:00 AM" | | ||
+ | |||
+ | ==== truncDay ==== | ||
+ | |||
+ | Truncates the date to the beginning of the day. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Value** |date column |**[Contacts.current date]** | | ||
+ | |||
+ | <code java> | ||
+ | truncDay([Contacts.current date]) | ||
+ | </code> | ||
+ | ^Before ^After ^ | ||
+ | |"July 22, 2022, 9:40 AM" |"July 22, 2022, 12:00 AM" | | ||
+ | |||
+ | ==== truncHour ==== | ||
+ | |||
+ | Truncates the date to the beginning of the hour. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Value** |date column |**[Contacts.current date]** | | ||
+ | |||
+ | <code java> | ||
+ | truncHour([Contacts.current date]) | ||
+ | </code> | ||
+ | ^Before ^After ^ | ||
+ | |"July 22, 2022, 9:40 AM" |"July 22, 2022, 9:00 AM" | | ||
+ | |||
+ | ==== truncMinute ==== | ||
+ | |||
+ | Truncates the date to the beginning of the hour. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Value** |date column |**[Contacts.current date]** | | ||
+ | |||
+ | <code java> | ||
+ | truncMinute([Contacts.current date]) | ||
+ | </code> | ||
+ | ^Before ^After ^ | ||
+ | |"July 22, 2022, 9:40:10 AM" |"July 22, 2022, 9:40:00 AM" | | ||
+ | |||
+ | ==== truncSecond ==== | ||
+ | |||
+ | Truncates the date to the beginning of the second. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Value** |date column |**[Contacts.current date]** | | ||
+ | |||
+ | <code java> | ||
+ | truncMinute([Contacts.current date]) | ||
+ | </code> | ||
+ | ^Before ^After ^ | ||
+ | |"July 22, 2022, 9:40:10.991 AM" |"July 22, 2022, 9:40:10.000 AM" | | ||
+ | |||
+ | ==== now ==== | ||
+ | |||
+ | Gets the current timestamp. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |||
+ | <code java> | ||
+ | now() | ||
+ | </code> | ||
+ | ^Result ^ | ||
+ | |"July 22, 2022, 9:40:10.991 AM" | | ||
+ | |||
+ | ===== Date group functions ===== | ||
+ | |||
+ | Group functions calculate results based on all values in a table column. A list is created using each row in the table column; the group function is then applied to this list. E.g. ''%%avg([Items.Price])%%'' which returns the average of the prices in the table "Items". | ||
+ | |||
+ | In addition, all functions are available in the variant to return ''%%null%%'' if all values in the column were ''%%null%%''. These variants have the same name but are postfixed with "NoValue", E.g. ''%%minNoValue([Customers.Birthdate])%%''. For additional information see [[http://en.wikipedia.org/wiki/Null_(SQL)|the Wikipedia entry on SQL Null]]. | ||
+ | |||
+ | The date group functions can be used with the following actions: | ||
+ | |||
+ | * [[#calculate_value|Calculate value]] | ||
+ | * [[#set_label_with_calculated_date|Set label with calculated date]] | ||
+ | * [[#set_label_with_calculated_date_short|Set label with calculated date short]] | ||
+ | * [[#set_label_with_calculated_date_time|Set label with calculated date time]] | ||
+ | * [[#set_label_with_calculated_date_time_short|Set label with calculated date time short]] | ||
+ | * [[#set_label_with_calculated_time|Set label with calculated time]] | ||
+ | * [[#set_parameter_with_calculated_value|Set Parameter with calculated value]] | ||
+ | |||
+ | ==== first / firstNoValue ==== | ||
+ | |||
+ | Returns the date value of the first row in the table with an existing value. If the value of the last row is empty the value of the row before with an existing value is taken. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Value** |date column |**[Contacts.current date]** | | ||
+ | |||
+ | <code java> | ||
+ | first([Contacts.current date]) | ||
+ | firstNoValue([Contacts.current date]) | ||
+ | </code> | ||
+ | ==== last / lastNoValue ==== | ||
+ | |||
+ | Returns the date value of the last row in the table with an existing value. If the value of the last row is empty the value of the row before with an existing value is taken. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Value** |date column |**[Contacts.Birthday]** | | ||
+ | |||
+ | <code java> | ||
+ | last([Contacts.current date]) | ||
+ | lastNoValue([Contacts.current date]) | ||
+ | </code> | ||
+ | ==== min / minNoValue ==== | ||
+ | |||
+ | Returns the smallest date value in the table. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Value** |date column |**[Contacts.Birthday]** | | ||
+ | |||
+ | <code java> | ||
+ | min([Contacts.Birthday]) | ||
+ | minNoValue([Contacts.Birthday]) | ||
+ | </code> | ||
+ | ==== max / maxNoValue ==== | ||
+ | |||
+ | Returns the greatest date value in the table. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Value** |date column |**[Contacts.Birthday]** | | ||
+ | |||
+ | <code java> | ||
+ | max([Contacts.Birthday]) | ||
+ | maxNoValue([Contacts.Birthday]) | ||
+ | </code> | ||
+ | ==== avg / avgNoValue ==== | ||
+ | |||
+ | Returns the average date value in the table. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Value** |date column |**[Contacts.Birthday]** | | ||
+ | |||
+ | <code java> | ||
+ | avg([Contacts.Birthday]) | ||
+ | avgNoValue([Contacts.Birthday]) | ||
+ | </code> | ||
+ | ==== sumToSelected / sumToSelectedNoValue ==== | ||
+ | |||
+ | Adds the date values from the beginning up to and including the current row . | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Value** |date column |**[Contacts.Birthday]** | | ||
+ | |||
+ | <code java> | ||
+ | sumToSelected([Contacts.Birthday]) | ||
+ | sumToSelectedNoValue([Contacts.Birthday]) | ||
+ | </code> | ||
+ | ==== sumFromSelected / sumFromCurrentNoValue ==== | ||
+ | |||
+ | Adds the date values from the current row up to and including the last row . | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Value** |date column |**[Contacts.Birthday]** | | ||
+ | |||
+ | <code java> | ||
+ | sumFromSelected([Contacts.Birthday]) | ||
+ | sumFromCurrentNoValue([Contacts.Birthday]) | ||
+ | </code> | ||
+ | ==== sum / sumNoValue ==== | ||
+ | |||
+ | Adds the date values from the table. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Value** |date column |**[Contacts.Birthday]** | | ||
+ | |||
+ | <code java> | ||
+ | sum([Contacts.Birthday]) | ||
+ | sumNoValue([Contacts.Birthday]) | ||
+ | </code> | ||
+ | ==== count ==== | ||
+ | |||
+ | Counts the entered non-empty date values in the table. | ||
+ | |||
+ | The funtion does not return a date value but a number. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Value** |date column |**[Contacts.Birthday]** | | ||
+ | |||
+ | <code java> | ||
+ | count([Contacts.Birthday]) | ||
+ | </code> | ||
+ | ==== row ==== | ||
+ | |||
+ | Does return the actual row number. | ||
+ | |||
+ | The funtion does not return a date value but a number. If no row is selected -1 will be returned. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Value** |date column |**[Contacts.Birthday]** | | ||
+ | |||
+ | <code java> | ||
+ | row([Contacts.Birthday]) | ||
+ | </code> | ||
+ | ==== noValue ==== | ||
+ | |||
+ | Returns an empty value. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Value** |date column |**[Contacts.Birthday]** | | ||
+ | |||
+ | <code java> | ||
+ | noValue([Contacts.Birthday]) | ||
+ | </code> | ||
+ | ===== Text operations ===== | ||
+ | |||
+ | The listed text operations can be used with the following actions: | ||
+ | |||
+ | * [[#calculate_value|Calculate value]] | ||
+ | * [[#set_label_with_calculated_currency|Set label with calculated currency]] | ||
+ | * [[#set_parameter_with_calculated_value|Set Parameter with calculated value]] | ||
+ | |||
+ | ==== lpad ==== | ||
+ | |||
+ | If you want all values to have the same length, you can use lpad to fill in the missing positions on the left with spaces or characters. | ||
+ | |||
+ | If you use it without a padding character, it will be used a single space for padding. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Value** |text, column, parameter |**[Orders.Order Number]** | | ||
+ | |**Target length** |number |**15** | | ||
+ | |**Pad character** |optional - single character (surrounded by quotes) |**'0'** | | ||
+ | |||
+ | <code java> | ||
+ | lpad({VALUE},15,'-') | ||
+ | lpad([Orders.Order Number],15,'0') | ||
+ | lpad({VALUE},15) | ||
+ | </code> | ||
+ | ^Before ^After ^ | ||
+ | |"12345" |"----------12345" | | ||
+ | |"15349" |"000000000015349" | | ||
+ | |"12345" |" ̺ ̺ ̺ ̺ ̺ ̺ ̺ ̺ ̺ ̺12345" | | ||
+ | |||
+ | ==== rpad ==== | ||
+ | |||
+ | If you want all values to have the same length, you can use rpad to fill in the missing positions on the right with spaces or characters. | ||
+ | |||
+ | If you use it without a padding character, it will be used a single space for padding. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Value** |text, column, parameter |**[Orders.Order Number]** | | ||
+ | |**Target length** |number |**15** | | ||
+ | |**Pad character** |optional - single character (surrounded by quotes) |**'0'** | | ||
+ | |||
+ | <code java> | ||
+ | rpad({VALUE},15,'-') | ||
+ | rpad([Orders.Order Number],15,'0') | ||
+ | rpad({VALUE},15) | ||
+ | </code> | ||
+ | ^Before ^After ^ | ||
+ | |"12345" |"12345----------" | | ||
+ | |"15349" |"153490000000000" | | ||
+ | |"12345" |"12345 ̺ ̺ ̺ ̺ ̺ ̺ ̺ ̺ ̺ ̺ " | | ||
+ | |||
+ | ==== ltrim ==== | ||
+ | |||
+ | Removes spaces from the beginning of a string. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Value** |text, column, parameter |**[Orders.Order Number]** | | ||
+ | |||
+ | <code java> | ||
+ | ltrim({VALUE}) | ||
+ | ltrim([Orders.Order Number]) | ||
+ | </code> | ||
+ | ^Before ^After ^ | ||
+ | |" ̺ ̺ ̺ ̺ ̺12345 ̺ ̺ " |"12345 ̺ ̺ " | | ||
+ | |" ̺ ̺15349 ̺ ̺ " |"15349 ̺ ̺ " | | ||
+ | |||
+ | ==== rtrim ==== | ||
+ | |||
+ | Removes spaces from the end of a string. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Value** |text, column, parameter |**[Orders.Order Number]** | | ||
+ | |||
+ | <code java> | ||
+ | rtrim({VALUE}) | ||
+ | rtrim([Orders.Order Number]) | ||
+ | </code> | ||
+ | ^Before ^After ^ | ||
+ | |" ̺ ̺12345 ̺ ̺ ̺ ̺ ̺ " |" ̺ ̺12345" | | ||
+ | |" ̺ ̺15349 ̺ ̺ " |" ̺ ̺15349" | | ||
+ | |||
+ | ==== trim ==== | ||
+ | |||
+ | Removes spaces from the beginning and the end of a string. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |**Value** |text, column, parameter |**[Orders.Order Number]** | | ||
+ | |||
+ | <code java> | ||
+ | trim({VALUE}) | ||
+ | trim([Orders.Order Number]) | ||
+ | </code> | ||
+ | ^Before ^After ^ | ||
+ | |" ̺ ̺12345 ̺ ̺ ̺ ̺ ̺ " |"12345" | | ||
+ | |" ̺ ̺15349 ̺ ̺ " |"15349" | | ||
+ | |||
+ | ==== user ==== | ||
+ | |||
+ | Gets the current logged on user. | ||
+ | |||
+ | ^Parameter ^Description ^Example ^ | ||
+ | |||
+ | <code java> | ||
+ | user() | ||
+ | </code> | ||
+ | ^Result ^ | ||
+ | |"admin" | | ||