Dynamic Combo Box Values in editable table

Dynamic Combo Box Values in editable table

  

Hello All,


I'm currently making a new project where people will be able to make registrations of when they will be using a system in our network(eg. test server).


the user should be able to create multiple allocation at once so I'm using the editable table element.


When creating an allocation they must choose a system(which is related with the allocation entitie by id)
But systems are contained in enviroments(eg. sandbox, test etc).

On this table I have a combo box to choose one of the systems but instead of lisiting all the systems I want to list the systems associated to the envrioment that was choosen before(another combo box)

so how can I achive this?


Thanks.

Hi João,


You need to refresh the query and the dropdown (the second one) on the onchange event of the first dropdown.

So every time you change first one, you go to the server and refresh the query that populates the second one.

I added a sample oml that has an example of how it can be achieved.


PS: you need to fill in some data in order to test it, keep in mind the hierarchical structure.

Let me know if it worked.


Cheers,

Henrique

Hello Henrique,


Thank you for your reply.

I'm refreshing the query for the second combo box, on the change event of the first one.

The thing is that I store the value of the first cb on a enviromentID variable, when the refresh is called the value of the variable is 0 instead of the ID of the selected enviroment.

This variable is used to filter the agregator results by enviromentID.

PS: I'm using version 9.x so I'm currently unable to open the project you've attached. 


Thank you,

João

Ups, I'm so used to 10 nowadays that i don't remember to compile things on 9.

Can you download the 10 version and look at the code? Other option is to use your personal environment on 10.

From what you explain it seems that you're doing everything correctly, perhaps you're missing an assign? Onchange of the first dropdown you should assign to a screen variable the value of the current environmentID and then refresh the query.

If you're unable to test it on 10 let me know, i'll compile it in 9.1.


Cheers,

Henrique 

Hello Henrique,


Due to company policies won't be that easy for me to install version 10 right now...

If you could compile it to version 9.1 I would be very grateful since I'm sure I will be able to better understand what I'm doing wrong.

Regarding the value assigned I think I'm doing it correctly.

On the option "Variable" of the first dropdown I'm assigning the value to the variable that stores the enviromentID, but I might be wrong since I'm pretty new to Outsystems (3rd week woring with it).

Best Regards,

João Louro

Solution

Ok, I understand.

Please see attached the example. Please add some values to Entity 1 and Entity 2 to see the expected behaviour.

Let me know if it worked.

Cheers,

Henrique

Solution

Hello Henrique,

Thank you for your great support, I was able to get it done!

Your project was very simple and just by looking at it I was able to understand what I was doing wrong.


Now my only issue is that when I refresh the secod combo box the styles disappear but I guess I can get this sorted.


Many Thanks,

João Louro

Thanks, i'm glad it worked :D


Cheers,

Henrique

New doubt on this, so when I'm creating a new record using this control it all works fine but when editing records the second field never loads, what can I do?