1
0
-1

Hi,

I'm trying to implement a countries auto suggest widget. For this, I've created a custom component which has an autocomplete field and have added a component property to define the countries as a CSV.

I've configured the autocomplete field as below:

  • Data Source: Reference Data (Prepop)
  • Reference Data Name: item.$$parent.properties.countriesCsv

However, this does not work, but if I try:

$("Form").scope().Form.items.autocompleteField.$$parent.properties.countriesCsv - there is a CSV being returned.

If I instead set the countries from a form load rule: eg data.$countries = "COUNTRY1, COUNTRY2", and then point the Reference Data Name to data.$countries, it works.

Is it possible to use the list of countries defined as a component property in the autocomplete widget?

https://maestro.avoka.com.au/maestro/secure/design/8661

Cheers,

Dan

    CommentAdd your comment...

    1 answer

    1.  
      1
      0
      -1

      Currently the Reference Data Name property of the Automcomplete widget accepts only a data path, you can't refer directly to item properties. So to get the equivalent of what you are trying to do with the component item property, instead add a data field to your component, and refer to that data field in the Autocomplete. You can then override the calculation rule of the data field in your form to either (a) supply the raw values, as you're currently doing in that test form or (b) dynamically derive the values based on some other data in the form, if you want to get more advanced. 

      1. Daniel Carlier

        Thanks Tim, I've implemented it with a data field for now.

      CommentAdd your comment...