I'm not sure if I'm doing this right. I'm allowing the user to edit an existing records. I want to show the existing field's value in an autocomplete control. I connect the smart object to the control. I set the method of the smart object and the value (integer) and the text field in the display. When the control loads, the autocomplete field shows the integer value??? What should I do here/
Hi Taffey
I just tested this myself and it worked as expected. I created a item view based on a SmartObject and changed one of the fields to an autocomplete control. My autocomplete control is set to a Smartobject List method with the Value an ID (integer) field and the Display a text field. On a button click rule I run a the View read method and pass in the ID value to the autocomplete control and is displays the text value.
I believe the issue occurs when you have the Live Search option checked. In this case the control only seems to populate with display values when the user types in the control. If you use the read method of the view, or transfer data into the control, it will only display underlying value passed in, not the configured display values from the connected Smart Object. This makes the live search option useless except for creating new items.
Hi Taffy, no I did not have the live search option selected. When I enabled this option it displayed the integer, so it seems oremac is correct.
A bit late to the party here, but I'd like to mention a solution I found to this issue. In my case I was loading a view as a subview, and trying to load data into the autocomplete. Due to the size of the data source behind it, live search was enabled. I took the approach of transferring the string value into the control instead of the ID value, and then I used the "Execute a control's method" rule to execute the "focus" method. This method places the user's cursor into the box, so, as soon as they click somewhere else (even directly to the "update" button), it trigger's the control to resolve.
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.