Skip to content

Commit 2e241a8

Browse files
akoclaude
andcommitted
fix: set Editable to Conditional and fix Visible xpath expression
patchConditionalSettings now sets the Editable BSON field to "Conditional" when ConditionalEditabilitySettings is populated, fixing mx check validation failure. Also restore $currentObject/ prefix in the Visible xpath example that was dropped during the syntax refactor. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent f9878ea commit 2e241a8

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2277,7 +2277,7 @@ CREATE PAGE PgTest.P040_ConditionalProps
22772277
ROW row1 {
22782278
COLUMN col1 (DesktopWidth: 8, TabletWidth: 6, PhoneWidth: 12) {
22792279
DATAVIEW dv1 (DataSource: MICROFLOW PgTest.DS_GetFirst) {
2280-
TEXTBOX txtName (Label: 'Name', Attribute: Name, Visible: [Name != empty])
2280+
TEXTBOX txtName (Label: 'Name', Attribute: Name, Visible: [$currentObject/Name != empty])
22812281
TEXTBOX txtCountry (Label: 'Country', Attribute: Country, Editable: [true])
22822282
}
22832283
}

sdk/mpr/writer_widgets.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ func patchConditionalSettings(doc bson.D, w pages.Widget) bson.D {
123123
if elem.Key == "ConditionalEditabilitySettings" && bw.ConditionalEditability != nil {
124124
doc[i].Value = serializeConditionalEditability(bw.ConditionalEditability)
125125
}
126+
if elem.Key == "Editable" && bw.ConditionalEditability != nil {
127+
doc[i].Value = "Conditional"
128+
}
126129
}
127130
return doc
128131
}

0 commit comments

Comments
 (0)