RESOStandards / transport

RESO Transport Workgroup - Specifications and Change Proposals
https://transport.reso.org
Other
18 stars 15 forks source link

Validation expressions and dynamic `SET_PICKLIST`/`RESTRICT_PICKLIST` #73

Closed bryanburgers closed 1 year ago

bryanburgers commented 1 year ago

I am interested in using RCP WEBAPI-019 to run client-side validations on a listing input project.

I'm reading through RCP - WEBAPI-019 Validation Exrpession in the WebAPI on Confluence and Validation Expression Grammer in darnjo/rcp019 (linked from RESOStandards/transport's web-api-validation-expression.md),

I'm looking right now at dynamic picklists based on other values, and I don't quite see how it works.

Let's say as the simplest case, I have the following two fields, "ExampleCategory" and "ExampleSubcategory". A user chooses a value from "ExampleCategory" and that changes what is available to select in "ExampleSubcategory".

ExampleCategory ExampleSubcategory
One One A
One One B
One One C
Two Two A
Two Two B
Three Three A
Three Three B
Three Three C

If the user chooses "Two" for ExampleCategory, I'd like the ExampleSubcategory options to be "Two A", "Two B".

It seems like the spec is close.

But how can they be combined?

I really love the idea of SET_PICKLIST/RESTRICT_PICKLIST if I can understand how to get it to work. What am I missing?