Refresh drop-down list according to another selected field

Hi everyone,

I want to create a code that permits to refresh a list when we select data from another field of the form.
I have found through the internet this code but i don’t know how to use it in scriptcase:

" sub relationheberzone

DIM ltierheber as Object , ltierzone AS Object
DIM var_tierheber as integer

ltierheber = ThisComponent.DrawPage.Forms.getByName(“Standard”).getByName(“tierheber”)
ltierzone = ThisComponent.DrawPage.Forms.getByName(“Standard”).getByName(“tierzone”)

var_tierheber = ltierheber.SelectedItems(0)

ltierzone.ListSource() = array(“SELECT nom_zones, idzones FROM zones WHERE fk_idhebergement =” & var_tierheber)
ltierzone.refresh

end sub "

I would be grateful if anyone can point me!!!

Your code is VB, and I doubt you can integrate, unless you are under IIS.

Otherwise, what list do you want to refresh? a combobox? Example: update poblation list when country is selected?

If this is your case, you can use AJAX processing to do this.

Captura.JPG

Yes it’s a combobox. Could you tell me please how i can do it in Ajax please!!
I am just a girl who wants to perform in men’s world.

capture.jpg

Look at this video, how Ajax Processing property is used.

https://www.youtube.com/watch?v=jU0D9ilv_WY

Thanks Gui!! it’s working

The video is now private…
I would like do the same thing

hello, the video link is set to private, could you publish it and let us view?

no need to code anything for this. it is a standard option for the lists/combos. They allow you to set up other controls to be refreshed when a value changed.

under form settings/fields/ajax processing

image