Condtional combobox source

Condtional combobox source

  

Hi,

Given:

  • Entity Car, Attributes: id, name, isOnlyToSellByManager 
  • Entity Salesman, Attributes: id, name, isManager 
  • Entity Car_Salesman, Attributes: Id, SalesmanId, CarId

How do I populate a combobox (to add cars to the Car_Salesman entity) when I want to show all cars if a the salaesman is a manager and if he/she isnot then only show cars where isOnlyToSellByManager is False?   

Regards, Harry

Hi Harry,

I think you can still have one source for the combobox, rather you add these conditions into your query. You can pass these values as Input parameters in your query. You may use advance query instead.


Shashank...

Solution

Or, use an If statement, use an appropriate Aggregates for each path of the If, and assign the output to a common List that you use in the combo box.

Solution

Thank you. I'll go for Kiian's solution (and will look into Shasank's later on - needs a little more SQL)

Regards, Harry

hi de Broer:

Given:


Find:


Solution:

1. create server action:

 with filtering on aggregate GetCarwithSalesmen:

2. assign that function to car widget combobox:


3. Ajaxize when you change the Saleman widget value to both widgets - saleman and car:

For your convenience, i attached the Oml:

 

regards,

bb

Thanks BB!

Harry

BB Nice and clear explanation of conditional use of combobox!!