Items
An item is a named session-state variable, usually shown as a form field. Items live on a page, optionally inside a region. Name them P<page>_<NAME> (uppercase letters, digits and _); refer to them as :P3_ENAME in SQL and &P3_ENAME. in HTML.
Item types
| Type | Renders as | Stored value |
|---|---|---|
text | text field | text |
textarea | multi-line text (always full width) | text |
number | number field (numeric keyboard on phones) | e.g. 1250.50 |
date | a text field in the item's date format mask, else the application's date format, else YYYY-MM-DD, with pgkiln's date picker (sprint 84; was the browser's); typed dates are read back in the format | YYYY-MM-DD |
datetime | date-time picker | YYYY-MM-DDTHH:MM |
email, tel, url | typed fields with the matching phone keyboard | text |
password | password field; never shown back, empty = unchanged | text |
color | colour picker | #rrggbb |
select | select list | the chosen return value |
popup_lov | a field and a search button that opens a dialog searching the list of values on the server (Popup LOV) | the chosen return value |
radio | radio group | the chosen return value |
checkbox | a single checkbox | true / false |
switch | on/off switch | true / false |
checkbox_group | several checkboxes | colon-separated return values, e.g. 10:30; (137) {"switches": true} shows each as a switch, one per line |
multiselect | multi-select list | colon-separated return values |
shuttle | (140) two lists, Available and Selected, with buttons to move values across and put the chosen ones in order (Shuttle); a multi-select list without JavaScript | colon-separated return values, in the chosen order |
select_one | (140) a search field over the list of values: typing filters a list under it (Select One); a select list without JavaScript | the chosen return value |
select_many | (140) as select_one, for several values shown as chips with a remove button; a multi-select list without JavaScript | colon-separated return values |
display | read-only text (shows the display value for list items) | whatever was set |
hidden | not rendered: the value stays on the server; (167) {"value_protected": false} renders a hidden input the browser may set (Hidden items) | set by URL (with checksum), fetch, processes or server-side dynamic actions; unprotected also by browser-side dynamic actions, JavaScript and a submit |
file | file upload (chapter 16); on phones the camera with {"capture": "environment"}, photos made smaller with {"max_px": 1600} (chapter 17) | the id of the uploaded temporary file (a uuid) |
location | a text field with Use my location (chapter 17) | latitude,longitude, e.g. 52.01160,4.35710 |
richtext | rich text editor (toolbar; a plain HTML textarea without JavaScript), full width | sanitised HTML, see below |
markdown | Markdown textarea with a toolbar; shown formatted when read-only | the Markdown text |
rating | star rating (radio buttons drawn as stars) | 1 … max (default 5) |
combobox | free text with suggestions from the list of values; several values become tags | colon-separated values, e.g. SQL:Sales |
daterange | two date fields, From and To, in the date format with the date picker (the picker keeps From on or before To) | from:to, e.g. 2026-01-01:2026-06-30 |
qrcode | display only: the value as a QR code (SVG drawn on the server) | whatever was set |
image | display only: a picture from a URL in the value, or a BLOB from a query (Display image) | a URL, or nothing |
address | a text field with Check address: the installation's geocoder offers matching addresses (Geocoded address) | the address as text |
image_upload | (158; APEX: Image Upload) a file item for pictures: image/* only, a preview, cropping before upload ({"crop": "free"} by default; "1:1", "4:3", "3:4", "16:9", "3:2", "2:3") and a maximum size applied in the browser ({"max_px": 1600}); column settings as a file item's | as a file item |
autocomplete | (158; APEX: Text Field with autocomplete) a text field with suggestions from the list of values; any text may be typed (a one-value combobox) | text |
percent_graph | (158; APEX: Percent Graph) display only: a 0–100 value as a bar (a <progress> element, read out as the number); values above 100 show a full bar, other text nothing | whatever was set |
display_map | (158; APEX: Display Map) display only: a small map of lat,lng with a pin, from the map regions' tile server (MAP_TILE_URL), and a Show map link. The position is the value, or another item's: {"coordinates_item": "P3_LOCATION", "zoom": 15} | lat,lng, or nothing |
signature | (239) a pad to sign on with a finger, a pen or the mouse, a Clear signature button, and a PNG upload as the alternative (Signature) | as a file item: the id of a temporary file holding the PNG |
plugin | an item plug-in: a text field its JavaScript enhances; config: {"plugin": "char_counter", "attributes": {"MAX": "140"}} | text |
Use multi-value items in SQL with string_to_array:
select * from hr.emp where deptno::text = any (string_to_array(:P11_DEPTS, ':'))true/false values cast directly to boolean (:P3_ACTIVE::boolean). A date range splits the same way (either date may be empty unless the item is required):
where hiredate between nullif(split_part(:P20_PERIOD, ':', 1), '')::date
and coalesce(nullif(split_part(:P20_PERIOD, ':', 2), '')::date, 'infinity')The date picker
(sprint 84; APEX: the date picker) A date item, a date range item, an interactive grid's date cell and a faceted search's own date range and the task list's vacation rule are text in the date format: the item's date format mask, else the application's date format (Settings → Globalization), else YYYY-MM-DD. The calendar button next to the field (or Alt+↓ in it) opens a month of days under it: the chosen day marked, today outlined, the week starting on the language's first day. Arrow keys move a day or a week, Page Up and Page Down a month (with Shift a year), Home and End to the week's first and last day, Enter or Space choose, Escape closes; Today and Clear below. Typed dates are read back in the format (and YYYY-MM-DD always works), so the field works without JavaScript. Timestamp items and grid timestamp cells still use the browser's date and time field.
Properties
| Property | Meaning |
|---|---|
label | Field label (default: the name in title case); takes &ITEM. substitutions, see labels and placeholders |
placeholder | (sprint 241) Value placeholder: a hint inside the empty field, or a select list's empty choice, see labels and placeholders |
region_id | The region the item is shown in (empty = page level, above the regions) |
seq | Order within its region |
source_column | For form regions: the table column it maps to |
default_value | Shown when the item has no value |
required | Must have a value on submit ("Salary is required."); marked with * |
help | Help text under the field |
lov | List of values for select/radio/checkbox group/multi-select/popup/display items |
readonly_condition | SQL expression; when true the item is shown read-only and ignored on submit |
condition_type, condition_expr, condition_value | A server-side condition (sprint 154): when it doesn't hold, the item isn't rendered and takes no submitted value |
authz | Authorization scheme; unauthorized users don't see the item and can't set it |
config | Attributes, see below |
Attributes (config):
| Key | Meaning |
|---|---|
submit_on_change | true: submit the page when the value changes (typical for report filters) |
warn_unsaved | false: a change of this item doesn't count for the page's warn on unsaved changes |
null_label | Text of the empty option in select lists (default - Select -); false removes the empty option |
cascade_parents | Comma-separated items this list depends on, see cascading lists |
wide | true: take the full width of the form |
rows | Number of lines of a textarea (default 4), rich text or Markdown editor (default 8) |
max | rating: the number of stars, 3 to 10 (default 5) |
multiple | combobox: false for a single free-text value with suggestions (default: several values, as tags) |
ecc | qrcode: error correction L, M (default), Q or H |
size | qrcode: width and height in pixels (64–1024; default 4 per module) |
show_value | qrcode: true also prints the text under the code |
reveal | password: true adds a Show/Hide button (shown only when JavaScript runs) |
format_mask | number, display: a number format mask such as 999G999G990D00; the value is shown in the language's notation and read back into a plain number on submit (see number formats) |
Labels and placeholders
(Sprint 241.) An item's label takes &ITEM. substitutions, like region texts and help: a form whose labels an administrator keeps in a table needs no static region per field. Give the label &P5_PHONE_LABEL. and fill P5_PHONE_LABEL (a hidden item) with a before header computation from that table. The value is escaped, so a label shows <b> as text. The messages that name the item ("Your name is required.") use the label as shown. A label is translated before its substitutions are made.
The Value placeholder (placeholder, Page Designer → item → Appearance; APEX: Value Placeholder) is a hint shown inside the empty field: text, number, e-mail, telephone, URL, password, textarea, combobox, location and date items (a date item without one shows its date format, as before). For a select list, popup LOV and Select One it is the text of the empty choice; {"null_label": "…"} in the attributes still wins, and {"null_label": false} still leaves the empty choice out. It takes &ITEM. substitutions, is escaped, translated like a label, and at most 500 characters. A read-only item shows none. It is not a label: screen readers may not read it, so an item keeps its label.
The Advisor notes a placeholder on an item type that never shows one. HR page 68 Visitor sign-in (part 104) has both: labels from hr.kiosk_label, placeholders such as name@example.com and - Choose your host -.
Rich text and Markdown
APEX's Rich Text Editor stores HTML; pgkiln's richtext item does too, but never stores or shows HTML it did not rebuild itself. On submit and every time it is displayed, the HTML goes through a strict allow-list (src/richtext.ts): paragraphs, line breaks, headings, bold/italic/underline/ strikethrough, sub/superscript, lists, quotes, code, horizontal rules, links and (sprint 235) simple tables: table, thead, tbody, tr, th and td, without any attribute (no colspan, style or border; a cell only inside a row, a row only inside a table, other tags directly inside a table are left out with their text kept; on a phone a wide table scrolls on its own). Text is always escaped, and named character references show their character: ö is ö, ’ ’ (a name pgkiln doesn't know is left for the browser to read, as text, never as markup). Links keep only href (http, https, mailto, tel or a relative URL) and get rel="noopener noreferrer nofollow"; scripts, styles, event handlers, style attributes, javascript:/data: URLs, images, frames, SVG and comments are dropped. An empty editor stores nothing (NULL). The value may come from a table that other programs write: it is cleaned again when shown, so stored HTML is never trusted.
With JavaScript the textarea becomes an editable area with a toolbar (bold, italic, underline, strikethrough, heading, paragraph, lists, quote, code, link, remove link, clear formatting); the toolbar is one tab stop (arrow keys move between its buttons). What it produces goes through the same allow-list, in the browser and again on the server. Pasted or dropped content is cleaned before it reaches the page: formatting within the allow-list is kept, and styles, images and scripts from the other page are left out (pasted files are ignored).
The markdown item stores the Markdown text as typed. Read-only it is rendered on the server: headings, paragraphs, emphasis, strikethrough, inline and fenced code, lists (nested), quotes, horizontal rules, links and bare https:// addresses. HTML in the Markdown is shown as text, and the result passes through the same allow-list.
Star rating, combobox, date range, password reveal and QR code
- Star rating (
rating): radio buttons, so the keyboard (arrow keys) and screen readers work as for any radio group (“3 of 5”); CSS draws stars. A required rating has no No rating choice. The server accepts only whole numbers from 1 tomax. - Combobox (
combobox, APEX 23.2+): a text field with adatalistof the list of values. With several values (the default) JavaScript shows them as tags with a remove button; type and press Enter or comma, or pick a suggestion. Without JavaScript type the values separated by colons. The server trims the values and removes duplicates. A suggestion stores its return value; free text is stored as typed (a typed display value is turned into its return value in the browser). - Date range (
daterange): two date pickers with the item's name, stored asfrom:to. The server checks that both are real dates and that from is not after to; a required range needs both. A dynamic action that sets the item uses the samefrom:totext. - Password reveal:
{"reveal": true}on apassworditem adds a Show/Hide button (aria-pressed). The field is hidden again before the form is sent; the value is never sent back to the browser. - QR code (
qrcode): shows the item's value (set by a computation, a process or a form fetch) as an SVG QR code made on the server (byte mode, UTF-8, versions 1–40, no extra library), with the value as its accessible name. It cannot be submitted. Text longer than a QR code holds shows a message instead.
The HR example's page 20 Reviews (examples/hr/hr_20_items.sql) uses all of them.
Signature
Signature (signature) is a pad to sign on: a white drawing area as wide as the field (160 px high) that follows a finger, a pen or the mouse, and a Clear signature button. After each stroke the drawing goes into the item as a PNG picture (white background, dark ink, at the screen's resolution, at most twice the CSS size), so the page posts it as a file upload item does: it becomes a temporary file of the session, and the item's value is that file's id.
Storing it. With a
byteasource_columnin a form region, saving the form writes the PNG into the column (afilename_columnandmime_columnare optional: without them the file is<item>.png,image/png). Without a form column, read it in a process frommeta.temp_files, as for any file item:sqlupdate sales.orders set signature = (select content from meta.temp_files where id = :P3_SIGNATURE::uuid) where id = :P3_ID::intShowing it. Read only (a read-only condition, or a display page), the item shows the stored signature as a picture with a download link; editable, a stored signature is shown above the pad with Remove file.
Limits. One PNG of at most 1 MB (
{"max_mb": 0.5}may lower it) and 4096 pixels each way. The server reads the bytes: something else posted asimage/pngis refused (This type of file is not allowed), whatever the browser called it.crop,max_px,captureandmultipledon't apply.Phones and accessibility. The pad takes the field's width (390 px phones included) and doesn't scroll the page while you draw. The pad has the item's label as its accessible name; Clear signature is an ordinary button. Someone who can't draw (or a browser without JavaScript) uses the file input under Or upload a picture of the signature (PNG), folded away while the pad works.
requiredworks as for file items: the form needs a drawing (or a stored signature).
HR example: a leave request (page 7) is signed when it is submitted; the process Store the signature writes the PNG into hr.leave_request.signature, and an existing request shows it (examples/hr/hr_102_signature.sql).
Display image and geocoded address
Display image (image, APEX: Display Image) shows a picture and can't be submitted. Two sources:
- A URL in the item's value (a computation, a process or a form fetch sets it): an
https://URL, a path on this server (/a/hr/static/logo.png) or adata:image/png;base64,…URL. Other schemes (http:,javascript:, URLs with a user name) show nothing. The page's Content-Security-Policy allows pictures from exactly thehttpsorigins its image items show when it is rendered. - A BLOB from a query:
{"sql": "select photo, photo_mime from hr.emp where empno = :P43_EMPNO::int"}. The first column of the first row is the picture (bytea), the second its MIME type (else it is recognised from the bytes: PNG, JPEG, GIF, WebP). The browser loads it from/a/<alias>/<page>/image/<item>, which runs the query as the application's role with the session's item values, after the page's authorization and the item's own; it is never cached, sandboxed and at most 20 MB.
config: {"alt": "Photo of &P43_ENAME.", "width": 160, "height": 160} (the alternative text, &ITEM. substitutions allowed; it defaults to the label).
Geocoded address (address, APEX: Geocoded Address) is a text field with a Check address button. The server asks the installation's geocoder for the typed text and shows up to five matching addresses; the one chosen replaces the text, and with {"coordinates_item": "P43_LOCATION"} its position goes into that item as latitude,longitude (the format of a location item, so a map region can show it). {"country": "nl"} (or "nl,be") limits the search to those countries. The answers come in the user's language.
The geocoder is set per installation with GEOCODER_URL, any API that speaks Nominatim's search (?q=…&format=jsonv2): your own Nominatim, LocationIQ (https://eu1.locationiq.com/v1/search with GEOCODER_KEY) or, within its usage policy (an absolute maximum of one request per second, no heavy use), https://nominatim.openstreetmap.org/search. Each session may ask once a second. Without GEOCODER_URL an address item is a plain text item.
The HR example's page 43 Data and settings (examples/hr/hr_53_data_settings.sql) has both.
Keeping values per user
{"persist": "user"} on any item (APEX: Maintain session state: Per User) keeps its value for the signed-in user across sessions: when a page shows the item and the session has no value for it yet, the user's last value comes back; a submit of the page (also a plain submit, e.g. submit on change) saves the value the user could change, in the same transaction as the page's processes. The value is a user preference named like the item. Public pages and applications without sign-in keep nothing.
Lists of values
A list of values (LOV) provides the options of select lists, radio groups, checkbox groups, multi-selects, shuttles, Select One and Select Many items, popup LOVs, grid columns and display items. Three forms:
- A SELECT returning (display, return). Bind variables are allowed:sqlA single-column SELECT uses the same value for both.
select dname, deptno from hr.dept order by 1 - A static list:
STATIC:Display;Return,Other;OTHER. For exampleSTATIC:Low;LOW,Normal;NORMAL,High;HIGH. An entry without;uses the same value for both. - A shared list of values:
LOV:DEPARTMENTS, defined once under Shared Components → Lists of values and reusable in any item or grid column. A shared list can also read a web service: give it a REST data source and query the rows fromrest(chapter 19).
On submit, the value of a select list, radio group, checkbox group, multi-select, shuttle, Select One, Select Many or popup LOV (each value of a multi-value item), and of a grid column with a list of values, must be one its list returns at that moment, for that user: a list that leaves out departments a user may not pick also keeps a crafted request from choosing them. Otherwise the item gets "choose a value from the list". For a list that may legitimately miss the current value, set "any_value": true in the item's config. A combobox is free text and isn't checked.
Popup LOV
A popup_lov item shows the chosen value's display text and a Search button. The button opens a dialog with a search field: the server searches the item's own list of values (case insensitive, on the display column and any extra columns) and answers one page at a time. The next page loads as the list scrolls (APEX: infinite scrolling): when the end of the list comes into view the dialog fetches the next page_size rows and adds them, until the list of values has no more, so a list of thousands of rows scrolls to its end without a More button. A new search starts over at the first page. A browser without IntersectionObserver pages with ‹ and More instead.
- Several columns: the first column is the display value, the second the return value, and any further columns are shown in the dialog (and searched), for example:sql
select ename as name, empno, job, dname as department from hr.emp left join hr.dept using (deptno) order by 1 - Attributes:
{"page_size": 25}rows per dialog page (at most 100);max_rowslimits the select list the page itself renders (see below);null_labelandcascade_parentswork as for a select list. - Without JavaScript the item is a plain select list of the first
max_rowsrows. A value beyond them is still shown, looked up by its return value. - Security: the search runs as the application's database role, with the term as a bind parameter (never SQL text), only for an item the user may see and change on a page they may open. A submitted value must be one the list of values returns, or the page shows an error.
The HR example's page 26 (Pick an employee) has one with name, job and department columns; page 47 (Component details) one over 6,000 rows, 100 a page.
Shuttle, Select One and Select Many
(sprint 140; APEX: Shuttle, and 24.2's Select One and Select Many) Three list items for choosing from a list of values, each a plain select list without JavaScript (the page saves the same values):
- Shuttle (
shuttle): two lists side by side, Available and Selected (stacked on phones), with a filter field over the available values. Move values across with the buttons between the lists (Move all », Move ›, Remove ‹, Remove all «), by double-clicking one, or with the keyboard: Enter moves the marked values across, Delete removes them from Selected, and in Selected Alt+↑ / Alt+↓ move them up or down (with Shift: to the top or bottom; the buttons ⤒ ↑ ↓ ⤓ do the same). The value is the chosen return values in their order, colon-separated (7566:7902), sostring_to_array(:P50_MEMBERS, ':') with ordinalitykeeps the order. Without JavaScript the shuttle is a multi-select list (the chosen values first, in their order); a value posted from it comes in the list's order. - Select One (
select_one): a search field. Clicking it or typing opens a list box under it that shows the list's display values containing what was typed (case-insensitive); ↑ / ↓ move through it, Enter chooses, Escape closes. Emptying the field chooses no value.{"null_label": "- None -"}names the empty entry,falseleaves it out (a required item). - Select Many (
select_many): the same, for several values: the chosen ones are chips above the field, each with a remove button (named Remove … for screen readers); Backspace in the empty field removes the last one, Enter on a chosen value in the list removes it again. The value is colon-separated, like a multi-select.
Like the other list items they are checked against their list of values on submit, take cascade_parents (a cascading shuttle is reloaded with its new values), show their display values (comma-separated, in order) when read-only, and dynamic actions see the colon-separated value (Set value with A:B chooses those values). The list box searches the rows the page read (max_rows, 5,000 by default): for lists of tens of thousands of rows use a Popup LOV, which searches on the server. Texts such as Move all, Selected and Remove {value} are runtime messages (shuttle.*, lov.search, item.tag_remove) an application can replace with a text message of the same name.
HR page 50 (Project team, Administration) has a Select One of departments, a shuttle of that department's employees (cascading) and a Select Many of skills.
Cascading lists of values
A list that depends on another item, for example managers filtered by department:
- Write the child's LOV using the parent item:sql
select ename, empno from hr.emp where :P3_DEPTNO is null or deptno = :P3_DEPTNO::int order by 1 - Set the child's attribute
{"cascade_parents": "P3_DEPTNO"}.
When the parent changes, the browser sends the parent's value and the server re-renders the child's options (and clears its old value). Chains (A → B → C) work.
Read-only items
readonly_condition is a SQL expression evaluated on every page view, e.g. "dates can't be changed once the request exists":
:P7_ID is not nullA read-only item is shown as text (list items show their display value) and is never taken from the submitted form. If the condition raises an error, the item is treated as read-only (fail closed).
Setting item values
Items get their values from:
- the user (editable items, on submit);
- the URL:
/a/hr/3?P3_EMPNO=7839&cs=…sets items of page 3 (after clearing that page's items). Links that pgkiln generates (report links, buttons, cards, calendars,meta.page_url()) carry the checksumcsautomatically; - form fetch (form regions);
- processes and dynamic actions whose SQL returns columns named like items:sql
select hr.give_raise(:P3_EMPNO::int, 10) as p3_sal - application processes (application items).
Values persist in session state until changed. ?clear=1 in a URL clears the page's items.
Hidden items
A hidden item is value protected by default: it isn't rendered, its value never leaves the server, and a submit can't change it, so it is safe for keys and other values the user must not tamper with. The server sets it: the URL (with checksum), a form's fetch, processes, computations and the server-side dynamic actions (set_value and execute_sql set its session value, though the browser never sees it).
(167; APEX: Value Protected = No) {"value_protected": false} makes it a field of the page instead: a hidden input that browser-side dynamic actions (clear, set_value from a component event's value, current_position), execute_javascript functions and client-side conditions read and set, and whose value a submit (or a dynamic action's items to submit) sends back. A change event on it runs its change dynamic actions. Its posted value is user input, exactly like a text field's: check it in a validation before you trust it.
name: P5_SELECTED_NODE
type: hidden
config: {value_protected: false}