Sodium: Türkiye'nin Programlama Dili
  • Sodium Home Page
  • Getting Started
    • Examples
      • Hello World Example
      • Datalist & Select Element Usage
  • Installation & Configuration
  • Frequently Asked Questions
  • How to
    • How to: use Recordset variable and to_json function for populating a tree node
    • How to: get selected tree node id
    • How to: create master detail relationship between data blocks
    • How to: use data list element for populating select elements
    • How to: define a lookup element for a select element
    • How to: use database sequence in data block element
  • Contributers
  • Roadmap
  • About Me
  • Version History
    • Change Log
    • Things To Do
    • Known Issues
  • LANGUAGE REFERENCE
    • Program Structure
      • Form File
      • Code Behind File
      • Controller File
    • Built-in Functions
      • Sodium Built-in Functions
        • Database Related Functions
          • commit
          • rollback
          • delete
          • create_postgresql_connection
          • create_oracle_connection
          • create_mysql_connection
          • get_database_type
          • get_database_name
          • run_sql_file
          • set_active_database_connection
        • REDIS Functions
          • create_redis_connection
          • close_redis_connection
          • (redis-variable-name).set
          • (redis-variable-name).get
          • (redis-variable-name).del
          • (redis-variable-name).ping
          • (redis-variable-name).incr
          • (redis-variable-name).incrBy
          • (redis-variable-name).decr
          • (redis-variable-name).decrBy
          • (redis-variable-name).strlen
          • (redis-variable-name).append
        • Other Functions
          • disable_column
          • enable_column
          • hide_block
          • hide_column
          • message
          • populate_datalist
          • prompt
          • refresh_block
          • show_block
          • show_column
          • show_page
          • populate_tree
          • to_json
          • refresh_tree_node
          • set_datablock_property
      • Built-in String Functions & Operands
        • instr
        • strlen
        • Concatanation Operator
        • replace
        • substr
        • The "sizeof" Operator
        • Like & Not Like Operators
      • File IO functions
      • Date/time Functions
    • Built-in Triggers
      • "item_modified" trigger
      • "connection_not_found" trigger
      • "page.access" trigger
      • "page_load" trigger
      • "post_query" trigger
      • "row_selected" trigger
      • "button_item_clicked" trigger
      • "pre_insert" Trigger
      • "pre_delete" Trigger
      • "pre_update" Trigger
      • "post_insert" Trigger
      • "post_delete" Trigger
      • "post_update" Trigger
      • "tree_node_expanded" Trigger
      • "tree_node_selected" Trigger
      • "user_session_end" trigger
    • TAGs
      • Data Block
        • Data Block: Form View Mode
        • Data Block: Grid View Mode
        • Data Block: Mix View Mode
      • Control Block
      • Data List
      • Tree Element
      • Table TAG
      • Inputs
        • Text Item
        • Radio Item
        • Select Item
        • Checkbox Item
        • Button Item
        • Image Item
        • Textarea Item
        • Magic Buttons
    • Native SQL support
    • Lexical Elements
      • Identifiers
      • Keywords
      • Constants
        • The Null Statement
        • String Constant
      • Operators
      • Separators
      • White Space
      • Variables
        • Variable Type: int
        • Variable Type: char
        • Variable Type: bool
        • Local variables
        • Page variables
        • Session variables
        • Predefined Variables
          • :Session.authenticated
          • :Session.user
          • :Session.Id
          • :Session.user
          • :Row.Id
      • Functions
        • Function Declarations
        • Calling Functions
        • Function Parameters
        • Recursive Functions
      • Statements
        • The "if" Statement
        • The while Statement
        • The do Statement
        • Code Blocks
        • The break Statement
        • The return Statement
      • Expressions And Operators
        • Expressions
        • Assignment Operators
        • Arithmetic Operators
        • Comparison Operators
        • Logical Operators
        • Function Calls as Expressions
        • Operator Precedence
        • Order of Evaluation
      • Escape Character
    • CSS Themes
    • Scopes
    • Connection
      • Active Database Connection
      • Connection Types
        • Database Connections
        • REDIS Connection
  • Development
    • IDE
    • Debugging
  • SODIUM DEVELOPMENT
    • Sodium Development Home Page
    • Getting Started
      • Sodium Architecture
      • Development Environment
        • Source Code
        • Applications Required
        • Compiling C Projects
        • Compiling NodeJs Project
        • Troubleshooting
Powered by GitBook
On this page
  • Description
  • Declaration
  • Example
  • Properties
  • data-block-name property
  • key-column-name property
  • data-source-name property
  • data-schema-name property
  • connection-name property
  • where-clause property
  • order-by-clause property
  • master-data-block-name property
  • join-condition property
  • record-count property
  • insert-allowed property
  • update-allowed property
  • delete-allowed property
  • show-hide-mode property
  • auto-generated-columns property
  • Triggers
  • "post_query" trigger
  • "row_selected" trigger
  • "pre_insert" Trigger
  • "pre_update" Trigger
  • "pre_delete" Trigger
  • "post_insert" Trigger
  • "post_delete" Trigger
  • "post_update" Trigger
  • Allowed Inner HTML Elements
  • Built-in Functions
  • See also

Was this helpful?

  1. LANGUAGE REFERENCE
  2. TAGs

Data Block

PreviousTAGsNextData Block: Form View Mode

Last updated 5 years ago

Was this helpful?

Description

Data block is the main visual element corresponding to tables/views in database.

With data blocks, end users can:

  • see

  • sort

  • filter and

  • manipulate

the data in tables/views.

  • Defined in .

  • Data blocks can not be nested.

  • Supports two type of view modes. , and .

  • Data block must only have one element as inner element.

Declaration

<datablock
    data-block-name     = ""
    data-source-name    = ""
    data-schema-name    = ""
    key-column-name     = ""
    connection-name     = ""
    auto-generated-columns="*|comma separated column names"
    where-clause        = ""
    order-by-clause     = ""
    master-data-block-name = ""
    join-condition      = ""
    record-count        = ""
    insert-allowed      = "{yes|no}"
    update-allowed      = "{yes|no}"
    delete-allowed      = "{yes|no}"
    show-hide-mode      = {display|visibility}>
</datablock>

Example

<datablock data-block-name="deps" data-source-name="deps" data-schema-name = "htsql"
    where-clause="" order-by-clause="dep_id" record-count="11">
 
    <table>
        <thead>
            <tr>
                <td>DEP ID</td>
                <td>DEP NAME</td>
                <td>EMP.CNT.</td>
                <td>LOGO</td>
                <td>OPS</td>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>
                    <input name="dep_id" data-type="number" column-name="dep_id"
                        type="text" size="3" sequence-name="HTSQL"></input>
                </td>
                <td>
                    <input name="dep_name" data-type="char" column-name="dep_name"
                        size="15px" type="text"></input>
                </td>
                <td>
                    <input name="employee_count" data-type="char" size="5px"
                        type="text"></input>
                </td>
                <td>
                    <input name="dep_logo" type="image" height="25px"
                        width="25"></input>
                </td>
                <td>
                    <input name="show_dep_name" type="button" value="Show"></input>
                </td>
            </tr>
        </tbody>
    </table>
 
</datablock>

Properties

data-block-name property

Mandatory : yes Unique : yes Data Type : char Default Value: - Predefined Values Allowed: -

key-column-name property

Description

Hold the table/view key column name.

If not set, database default key column name is assigned if exists (for oracle, default value is "rowid")

Mandatory : no Unique : no Data Type : char Default Value: For oracle, default value is "rowid" Predefined Values Allowed: -

data-source-name property

Description

Data source name is the table/view name.

It cannot contain the schema name if the connected/current user is not the owner of the table/view.

It cannot be a sub select/query.

Mandatory : yes Unique : no Data Type : char Default Value: - Predefined Values Allowed: -

data-schema-name property

Description

Schema name of the the table/view name.

It can be empty if the current schema/user is the the owner of the table/view.

Mandatory : yes Unique : no Data Type : char Default Value: - Predefined Values Allowed: -

connection-name property

Description

Property is not mandatory.

If it is not specified, "default" is used as connection name.

Mandatory : no Unique : no Data Type : char Default Value: - Predefined Values Allowed: -

where-clause property

Description

Do not write "where" keyword in the property value.

Can contain any legal SQL WHERE condition statement(s) (etc database functions, sub selects)

Mandatory : no Unique : no Data Type : char Default Value: - Predefined Values Allowed: -

Examples:

emp_name = 'john'  
emp_name = 'john' and emp_surname is not null
getAge() > 25

order-by-clause property

Description

It is SQL "order by" clause.

Do not write "order by" in the property value.

Can contain any legal "order by" statements

Mandatory : no Unique : no Data Type : char Default Value: - Predefined Values Allowed: -

Examples

emp_name 
emp_name, emp_surname
getAge() 
(select count(*) from cars where car_id = emp_id)

master-data-block-name property

Description

Mandatory : no Unique : no Data Type : char Default Value: - Predefined Values Allowed: -

master-data-block-name="deps" join-condition="dep_id = :deps.dep_id" 

join-condition property

Description

Mandatory : no Unique : no Data Type : char Default Value: - Predefined Values Allowed: -

record-count property

It is the number of records to be displayed on the screen.

Mandatory : yes Unique : no Data Type : number Default Value: - Predefined Values Allowed: > 0

insert-allowed property

Not implemented yet.

Mandatory : no Unique : no Data Type : bool Default Value: yes Predefined Values Allowed: {yes|no}

update-allowed property

Not implemented yet.

Mandatory : no Unique : no Data Type : bool Default Value: yes Predefined Values Allowed: {yes|no}

delete-allowed property

Not implemented yet.

Mandatory : no Unique : no Data Type : bool Default Value: yes Predefined Values Allowed: {yes|no}

show-hide-mode property

CSS show/hide method

Mandatory : no Unique : no Data Type : char Default Value: visibility Predefined Values Allowed: {display|visibility}

auto-generated-columns property

Use auto-generated-columns property in order to declare which columns will be shown in data block.

Mandatory : no Unique : no Data Type : char Default Value: no Predefined Values Allowed: { * | comma separated column names}

Example

<datablock data-block-name="table" auto-generated-columns="*" record-count="10">
</datablock>
 
<datablock data-block-name="emps" auto-generated-columns="emp_id, emp_name" record-count="10">
</datablock>

Triggers

Allowed Inner HTML Elements

Built-in Functions

See also

It is used to implement master-detail relationship between data blocks. It is the master data block name of the current data block. A data block can only have one master data block but can have many detail data blocks. Master data block must be defined in the before the current data block. It works together with

It is used to implement master-detail relationship between data blocks. It is a "where" statement. It should conform the SQL specification One of the operands used in join condition statement must reference to the item name of the master data block Master data block must be defined in the before the current data block. It works together with

Must be empty if is set.

form file
Data Block: Grid View Mode
Data Block: Form View Mode
Data Block: Mix View Mode
Table TAG
"post_query" trigger
"row_selected" trigger
"pre_insert" Trigger
"pre_update" Trigger
"pre_delete" Trigger
"post_insert" Trigger
"post_delete" Trigger
"post_update" Trigger
refresh_block
show_block
hide_block
set_datablock_property
Data Block: Form View Mode
Data Block: Grid View Mode
Data Block: Mix View Mode
Form File
join-condition property
Form File
master-data-block-name property
Table TAG
auto-generated-columns property