Data Block

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.

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

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 Form File before the current data block. It works together with join-condition property

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

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 Form File before the current data block. It works together with master-data-block-name property

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

Must be empty if auto-generated-columns property is set. Table TAG

Built-in Functions

refresh_block show_block hide_block set_datablock_property

See also

Data Block: Form View Mode Data Block: Grid View Mode Data Block: Mix View Mode

Last updated