How to show specific options in a dropdown depending on prior input

0
Within my Mendix app, I am tracking training courses and the individuals who register for those courses. I have multiple locations, whose course names are the same, but the cost to register is different depending on the location. Cost will also vary depending on if you are "entry level" or "advanced".  I am able to go in and add my courses with their locations and costs, however, when I go to my "NewEdit" page where I would enter the students info and select their location, if I have twenty courses offered over two different locations, the location dropdown gives me 20 locations (10 repeated locations x 2 locations). How do I get it so that the logic is: IF location X is selected for student type A (ENUM_Seat) then only X courses show up for A (ENUM_seat) student type and then I have a drop down of those class names.   Including a screenshot of my Domain Model if it helps.   
asked
4 answers
1

In your TrainingEvent you have an ENUM_Location (location of trainingsevent) and an ENUM_SeatPosition (specific place)

You want to select the TrainingEvent based on Location and SeatPositon type filled at an entity?

 

For this example you have an entity called $Student with attributes Location (Enum_Location) and SeatPosition (Enum_SeatPosition).

 

If you use Xpath Constraints you can return the TrainingEvent with

[Location = $Student/Location]

[SeatPositon = $Student/SeatPosition]

 

Be aware then the Enumerations in both entity's must match, if not you must take this into account in your Xpath.

answered
1

You are looking for the constrained by function. See the documentation here: https://docs.mendix.com/refguide/reference-selector/#constrained-by

 

Regards,

Ronald

 

answered
0

Thanks, I followed the documentation for the constrained by function and it is not working. When adding the constrained function it won't pull back any records.

answered
0

Here are the screenshots. 

 

image.pngimage.png

answered