Skip to content

Commit 126268f

Browse files
akoclaude
andcommitted
docs: add VISIBLE IF, EDITABLE IF, TabletWidth/PhoneWidth documentation
- Quick reference: widget property table with all three features - Skills (create-page.md): column width table, conditional visibility and editability section with examples - Site docs (language/pages.md): responsive widths, VISIBLE IF, EDITABLE IF sections - Doctype tests: page example with all three features Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 6a0b41f commit 126268f

File tree

4 files changed

+99
-3
lines changed

4 files changed

+99
-3
lines changed

.claude/skills/mendix/create-page.md

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,9 +251,17 @@ LAYOUTGRID gridName {
251251
}
252252
```
253253

254-
**Width Values:**
255-
- Numeric: `1` through `12`
256-
- Auto: `AutoFill`, `AutoFit`
254+
**Column Width Properties:**
255+
256+
| Property | Values | Default | Description |
257+
|----------|--------|---------|-------------|
258+
| `DesktopWidth` | 1-12 or `AutoFill` | `AutoFill` | Desktop column width |
259+
| `TabletWidth` | 1-12 or `AutoFill` | auto | Tablet column width |
260+
| `PhoneWidth` | 1-12 or `AutoFill` | auto | Phone column width |
261+
262+
```sql
263+
COLUMN col1 (DesktopWidth: 8, TabletWidth: 6, PhoneWidth: 12) { ... }
264+
```
257265

258266
Example:
259267
```sql
@@ -737,6 +745,25 @@ ALTER PAGE Module.Customer_Edit {
737745

738746
See the dedicated skill file: [ALTER PAGE/SNIPPET](./alter-page.md)
739747

748+
## Conditional Visibility and Editability
749+
750+
Any widget can have conditional visibility. Input widgets can also have conditional editability.
751+
752+
```sql
753+
-- Conditionally visible widget
754+
TEXTBOX txtName (Label: 'Name', Attribute: Name, VISIBLE IF '$currentObject/IsActive')
755+
756+
-- Conditionally editable input
757+
TEXTBOX txtStatus (Label: 'Status', Attribute: Status, EDITABLE IF '$currentObject/Status != ''Closed''')
758+
759+
-- Combined
760+
TEXTBOX txtEmail (Label: 'Email', Attribute: Email,
761+
VISIBLE IF '$currentObject/ShowEmail',
762+
EDITABLE IF '$currentObject/CanEdit')
763+
```
764+
765+
The expression is a Mendix expression string using `$currentObject/AttributeName` syntax. Single quotes within the expression must be doubled (`''`).
766+
740767
## Known Limitations
741768

742769
The following features are NOT implemented in mxcli and require manual configuration in Studio Pro:

docs-site/src/language/pages.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,34 @@ CREATE PAGE MyModule.Customer_Edit
7676
| `Folder` | Organizational folder within the module | `Folder: 'Pages/Customers'` |
7777
| `Variables` | Page-level variables for conditional logic | `Variables: { $show: Boolean = 'true' }` |
7878

79+
## Widget Properties
80+
81+
### Responsive Column Widths
82+
83+
Layout grid columns support responsive widths for desktop, tablet, and phone:
84+
85+
```sql
86+
COLUMN col1 (DesktopWidth: 8, TabletWidth: 6, PhoneWidth: 12) { ... }
87+
```
88+
89+
Values are 1-12 (grid units) or `AutoFill`. TabletWidth and PhoneWidth default to auto when omitted.
90+
91+
### Conditional Visibility
92+
93+
Any widget can be conditionally visible using a Mendix expression:
94+
95+
```sql
96+
TEXTBOX txtName (Label: 'Name', Attribute: Name, VISIBLE IF '$currentObject/IsActive')
97+
```
98+
99+
### Conditional Editability
100+
101+
Input widgets can be conditionally editable:
102+
103+
```sql
104+
TEXTBOX txtStatus (Label: 'Status', Attribute: Status, EDITABLE IF '$currentObject/Status != ''Closed''')
105+
```
106+
79107
## Layouts
80108

81109
Layouts are referenced by their qualified name (`Module.LayoutName`). Common Atlas layouts include:

docs/01-project/MDL_QUICK_REFERENCE.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,16 @@ CREATE PAGE MyModule.Customer_Edit
423423
}
424424
```
425425

426+
**Widget Properties:**
427+
428+
| Property | Syntax | Notes |
429+
|----------|--------|-------|
430+
| DesktopWidth | `COLUMN col (DesktopWidth: 8)` | 1-12 or AutoFill |
431+
| TabletWidth | `COLUMN col (TabletWidth: 6)` | 1-12 or AutoFill (default: auto) |
432+
| PhoneWidth | `COLUMN col (PhoneWidth: 12)` | 1-12 or AutoFill (default: auto) |
433+
| VISIBLE IF | `TEXTBOX txt (VISIBLE IF '$obj/IsActive')` | Conditional visibility expression |
434+
| EDITABLE IF | `TEXTBOX txt (EDITABLE IF '$obj/Status != ''Closed''')` | Conditional editability expression |
435+
426436
**Supported Widgets:**
427437
- Layout: `LAYOUTGRID`, `ROW`, `COLUMN`, `CONTAINER`, `CUSTOMCONTAINER`
428438
- Input: `TEXTBOX`, `TEXTAREA`, `CHECKBOX`, `RADIOBUTTONS`, `DATEPICKER`, `COMBOBOX`

mdl-examples/doctype-tests/03-page-examples.mdl

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2258,6 +2258,37 @@ ALTER PAGE PgTest.P033b_DataGrid_ColumnProperties {
22582258
SET Layout = Atlas_Core.Atlas_TopBar;
22592259
};
22602260

2261+
-- MARK: Conditional Visibility/Editability and Responsive Widths
2262+
2263+
-- =============================================================================
2264+
-- LEVEL 9: Conditional Visibility, Editability, and Responsive Column Widths
2265+
-- =============================================================================
2266+
2267+
/**
2268+
* Level 9.1: Page with conditional visibility and editability
2269+
*/
2270+
CREATE PAGE PgTest.P040_ConditionalProps
2271+
(
2272+
Title: 'Conditional Properties',
2273+
Layout: Atlas_Core.Atlas_Default
2274+
)
2275+
{
2276+
LAYOUTGRID lg1 {
2277+
ROW row1 {
2278+
COLUMN col1 (DesktopWidth: 8, TabletWidth: 6, PhoneWidth: 12) {
2279+
DATAVIEW dv1 (DataSource: MICROFLOW PgTest.DS_GetFirst) {
2280+
TEXTBOX txtName (Label: 'Name', Attribute: Name, VISIBLE IF '$currentObject/Name != empty')
2281+
TEXTBOX txtCountry (Label: 'Country', Attribute: Country, EDITABLE IF 'true')
2282+
}
2283+
}
2284+
COLUMN col2 (DesktopWidth: 4, TabletWidth: 6, PhoneWidth: 12) {
2285+
DYNAMICTEXT sidebarText (Content: 'Sidebar')
2286+
}
2287+
}
2288+
}
2289+
};
2290+
/
2291+
22612292
-- MARK: Move Examples
22622293

22632294
-- =============================================================================

0 commit comments

Comments
 (0)