How to make ReferenceSelector dropdown as multi selection options

1
Hi Team, I have followed https://docs.mendix.com/refguide/reference-selector link to create one to many association. in this example I can select single products based on selected category. My project use case is to select multiple products at once based on the selected category. How can I acheive it.
asked
9 answers
7

Hi Amit Kumar,

You can use the Bootstrap Multi Select widget

https://appstore.home.mendix.com/link/app/2295/

 

Thanks !

answered
4

Amit,

Please find the below configuration,

Update your domain model with *-* association between Product and Orderline

 

Update configuration for Bootstrap Multi select 

Update the datasource for this widget as microflow (to display the products based on the category selected)

Add the below microflow as datasource

Then finally add a refresh microflow to the category selection reference selector to update the product dropdown based on the category

 

Hope this helps, Thanks!

answered
3

Hi Amit,

I hope you have selected the root entity instead of selecting the referenced entity. Please update your Multi Select Source configuration as your reference set entity

Thanks!

answered
2

Hello Amit,

If you want to select multiple product, you could try input reference set selector. In the selectable objects tab of input reference selector widget you can enter your XPATH constraints to filter on the products. Note: there is also a constrained by field you can use to filter if applicable.

https://docs.mendix.com/refguide/input-reference-set-selector

So per orderline you could select multiple Products. For the input reference selector you can generate a page which shows list of Products in a datagrid, where you can choose for multiple selection. 

Once you select the products, the list of products selected will be shown in the input text field. 

Although, your approach is slightly confusing me. 

  1. Per orderline you want to select multiple products but your domain model says, Orderline can have 1 product
  2. You have a field called quantity, which I assume is the number of items. 
  3. If you proceed in this direction, you might end up like entering only total quantity for all different products you selected. You will not be able to have specific quantity per product. For example
    1. User may choose Item A, Item B, Item C from product list
    2. In quantity they have to enter total of all items together (if this is what you intend to implement)
    3. If you want quantity per product selected, you have to change your approach.
answered
0

This is the error I am getting after configured bootstrap multi select widget. 

answered
0

Hi Ananthi,

I am new in mendix and didnt get you exactly. I am uploading my test App. please guide me what is wrong and need to correct.

answered
0

Dont see option to upload test project so sending screen with explanation.

Domina model

Page on which i need implement BoothStrap Multi selection

On the above page, product are coming based on the category selection. so first we have to add new categories & new products from the navigation links then add Orders from All Orders page of Navigation.

I want the feature wherein user should be able to add multiple products based on selected category so products dropdown should be multi selection dropdown.

Please help me to guide to acheive this implementation. 

 

answered
0

thanks u vry much Ananthi. i’ll follow this and update you.

 

answered
0

It’s working for me. Thanks a lot for your help. But wanted to know that, why do we have to created microflow to retrieve product list on bootstrap multi select. Why was not able to achieve it thru XPath?

answered