1
0
-1

I would like to use the auto-complete widget to perform type-ahead on a single field, for example perform a look up of company names while the user is typing in the field so that they can choose from a list of known companies.

In this scenario it doesn't make sense to display both a 'search' and a 'result' field (i.e. avoid displaying 2x 'Company Name' fields). The search field would need to be displayed so that the user can redo the search if necessary.

 

In a positive scenario (user selects a match from the suggestion list), the trigger field (search field) is updated with the selected item as expected.

However, when testing a negative scenario, I find that the auto-complete trigger field (search field) is always being cleared, even if the component ''Clear Trigger Field When Not Matched" property is set to false.

I've attempted to resolve this by ensuring that the clear trigger field setting ${clear.trigger.field} is being passed into the sfcGenerated.autoSuggestResultHandler() and sfcGenerated.autoSuggestSelectHandler() functions, but this does not seem to have any effect.

 

How can I prevent the auto-complete widget from clearing the trigger field in this situation?

 

Here's an Maguire form section containing my current experiment: autoComplete-example.xml

The Composer environment is Composer 4.4.

    CommentAdd your comment...

    1 answer

    1.  
      1
      0
      -1

      Hi Matthew the current widget does not allow you to customize this behaviour when selecting the not found option. The existing 'Clear trigger field...' option controls whether or not to blank out the field if you try to leave (blur) out of the field with an invalid option selected. If you log a JIRA we can add this capability in a future service pack.

      For you current widget I suggest you just remove the not found option by setting the property to blank

       <setproperty name="notInList.message" value=""/>

        CommentAdd your comment...