Search on Interger values in mendix Auto Complete widget

Hi I have used The mendix Auto Complete widget number of times in my projects. But now I am developing a project that needs to search on a Product Code. This product code is an Interger Value stored in an Entity along with the product details.  But when I try to put the mendix Auto Complete widget on it, I found out that this widget only let's you search on string values..  Is there any way I can use my product code in an auto complete? So that when a user types halfway, it gives you suggestions and complete the code in the search box?   Please help Dylan
2 answers

I guess you are referring to not being able to select an integer attribute. You could try (test thoroughly) to add the type to the widget configuration - specially in AutoCompleteForMendix.xml


<property key="searchStringAttribute" type="attribute" required="false">
            <caption>Search String Attribute</caption>
            <category>Search - Microflow</category>
            <description>Attribute to store the search term while searching via a microflow</description>
                <attributeType name="String"/>
                <attributeType name="Integer"/>
                <attributeType name="Long"/>


Hi Dylan,

I am probably stating the obvious here but the simplest solution would be to create an additional attribute sProductCode with type string and set it everytime you set the product code (or in a before commit microflow).

Its a bit of extra memory but not something I would worry about unless I had a trillion products (thats probably more than what Amazon has).

Hope this helps,