Text Box Search for List View, if empty dont show anything

1
Hello, i`m using a list view and a text box search. If i enter a number in the text box search, the List view shows me the accordingly position. But if i enter no number and leave the text box search empty, the list view shows me the entire list of positions. Is there a way, that the list view isn`t visible or the list view shows me nothing when there is nothing written in the text box search?
asked
4 answers
3

Hi Nils,

I think you should model this out using a helper entity object in which you can build your custom requirements. If you add a visibility constraint on the listview, which should be inside a dataview of the helper entity, than you can set the exact conditions for showing or hiding the listview.

You could check out the blog by Lennart Spaans https://medium.com/mendix/how-to-create-a-search-functionality-in-a-mendix-native-mobile-app-f6f48b59f1be or André Luijkx https://medium.com/mendix/filtering-lists-based-on-a-helper-entity-d96ccfd52c16 

Good luck!

answered
0

Hello Sjors,

thanks for your answer, it helps me a lot. I tried the approach of Lennart Spaans but i`m stucked at Point 8 of his plan. I don`t know, what to write in the decision in the nanoflow. 

Maybe i understand this wrong, but i transferred it to my use case and now i have an error

answered
0

Thanks for your help, it works perfetcly :) 

answered
0

I have one last question :D

Is there a command, to only return the exact number? In my use case, i have a list of order numbers and when the customer enters for example “3” in the text box, the orders 3,13,23,30,31,…. are also shown. I guess the reason is the “contains” command in the XPath constraint 

So is there a command to return only the exact same number?

answered