Search code examples
orbeon

Migrate autocomplete field to dynamic dropdown


I’m using Oberon forms version 2019.2 CE.

I want to migrate autocomplete field to dynamic dropdown. As resource (Resource URL) I'm using address: <my_service_address>/name={$fr-search-value}&param2={../c_field_name}

c_field_name is other dynamic dropdown.

When I’m using autocomplete everything is fine (correct response from service), but when I switch to dynamic dropdown the response is incorrect (empty response). It looks like {../c_field_name} is empty value.

When I pass some test value to my service (instead of {../c_field_name}), for example:

<my_service_address>/name={$fr-search-value}&param2=1

everything work fine, so my service working well.

I tried to use $c_field_name instead of {../c_field_name}, but it is not worked.

Do you have any suggestions?


Solution

  • Instead of ../c_field_name, use xxf:instance('fr-form-instance')//c_field_name.

    Also see the form attached to this message, which uses this technique to create chained dropdowns, where each dropdown passes to the service the value selected by the user in the previous dropdown. And ideally, you should be able to just write $c_field_name, which is covered by request for enhancement #309.