Filter 4 combo box with a static entity

Filter 4 combo box with a static entity

  

Hi everyone i have a doubt using combo boxes and static entitys.

So here's the thing, i have "Necessities" entity and "Necessities Category" Static Entity with 4 records.

Each of thoses records is a Category and they will filter 1 of the 4 combo boxes correspondently. So here's where it get's tricky to me. How can i filter each combo box for Necessities with the correspondent Record of the static entity?. 



Nuno Raposo wrote:

Hi everyone i have a doubt using combo boxes and static entitys.

So here's the thing, i have "Necessities" entity and "Necessities Category" Static Entity with 4 records.

Each of thoses records is a Category and they will filter 1 of the 4 combo boxes correspondently. So here's where it get's tricky to me. How can i filter each combo box for Necessities with the correspondent Record of the static entity?. 



Hello

So first you should have a combobox where you pick the Category of the necessity linked to your static entity. To that ComboBox you will associate a variable, which will hold the ID of the selected Category.

Then you will have a second combo box linked to an aggregate that you will create in your preparation selecting your necessities. That aggregate should have a filter like this:

Necessity.CategoryID = ChosenCategoryID ( which will be the variable you used in the first combobox )

Now simply when you select the category you should use Ajax Refresh to update the values of your aggregate and refresh the second combobox so you have the correct values,

was that helpfull?

 

Cheers

VC



Thank you Vicent For your quick reply. I was implementing that solution has a 2nd choice already. I didn't want to pick 2 combo boxes every time but probably tha'ts the only way i recon? I was thinking about using 4 variables and depending on which ( using a Switch) i would have 4 agregates each filtered by each variable, but i think this might be too messy? Using 2 combo boxes might be the ideal ( altough it doesn't match the requirements i was asked for to do).

Here you can see what i used (2 combo boxes) and what i wanted ( 3 on the right)

Solution

Hi Nuno!
How are you?

If your requirement is to have 4 combo boxes, each one filtered by a special value, there isn't much you can do.
The two combos is not an option, because you don't want to select one each time.

So, you will have to deal with 4 aggregates, or, if this causes a performance penalty (because of the database), you can use a single aggregate, get everything, (ordered first by category and than by the other field) and than iterate copying the values to local lists that you will use as separated sources to the combo boxes.

Another option (just to take care of the mess), is to use web blocks and put the UI for each combo and the logic in there, using an input parameter to filter. (But I think your boss don't like web blocks... xD)

What do you think will be less messy? rs

Cheers,
Eduardo Jauch

Solution

Hey Edu!

 I'm Alright thank you! hehe.How about you?

 Yeah i adopted the 4 agregates option. It is a bit messy but does the trick, i hope my colleague agrees with me when he returns from holliday.

I'll think about using the webblocks when i have more time.

Cheers

I'm always here ;) hehe

A web block, in this case, would be nice because you would be able to do everything inside it, but would require notifies to the page.

Talked to your colleague about it, but I really think they don't like web blocks in there...

The local lists are also a valid possibility, reducing database access and the logic is very simple. But if the number of records is too high probably would not be a good approach...

Good luck!