Predictive search

Claire White shared this question 26 days ago
Answered

Hello, I'm simulating auto-complete results on a global search. My goal is to try to simulate the spotlight desktop application on a Mac - i.e. using datamasters containing different content types (users, computers, contacts etc). To achieve this, I've created four separate data masters - and displayed them below the input field. On key up, I've set the value of each data master using the conditions shown in the screenshot (as per the tutorial). What I'd like to do is once a data master set (i.e. users) contains no results, hide that data master and push up the other data masters which do contain results. Is this possible? The global search is a master entitled Masthead - option 3 in the attached file.

Comments (7)

photo
1

Yes that should be possible. Select all of the Data Lists, right-click and select 'Group in Dynamic Panel'. With the Dynamic Panel still selected, go to the Properties palette and find the 'Layout' section. Change the layout to 'Vertical' and add a bit of vertical spacing. With this layout, the Data Lists stack one above the other and will automatically move up if one is hidden.

Now you can add a condition to the filter event that should look something like the image below, with the Data Master, attributes, and Input field replaced to correspond to the information in your prototype. This condition first checks to see if the filter would return any results before it actually filters the Data List. You can then create an "Else" event that will hide the Data List. Since all the Data Lists are in a vertical layout dynamic panel, they should all shift up if one is hidden.

c53ad0bbdf80e74c9bcde924aa74d7ba


Hope this helps, and let me know if you have any questions!

photo
1

Hi Danielle! Thank you so much for your response. The vertical layout worked brilliantly. What I'm struggling with is how to create the condition - should it be four separate on key up events - and four separate conditions - as there are four separate data masters in the dynamic panel? Or should it be one long key up event to filter all four data masters (as I originally created it) and one long condition? And should this hide both the header row and current row within each data master? Hope this makes sense..... ad5002ab8c9b0fe38f9a00359e61a90908fa1e2966535a279d0a4708eb4b7bf3bbb8619b9899f5a4db9092a2a75f4472

photo
1

This is how it displays (without the condition and else event)

4f91dc93787a850b09adc9582bf1cdec

photo
1

The events you created look like they should work perfectly! You can hide the entire Data List for each interaction, so you'll only see the Data Lists that return any results after filtering.

photo
1

Thanks Danielle, sorry to be a huge pest but I still can't get the header rows to hide (even though I've selected the entire data master - see screenshots). f9a61ed29763db36a7e027b57ec1b3dd8a9bef8038b628b694116a05d324517faa5379d10f0633f83bbd94e763dc7d5d

photo
1

I think I see the issue - it looks like the condition is slightly incorrect, so the Hide event isn't triggering. The end of each condition should be ≥ 1, not ≠ 1.

photo
1

OK thanks Danielle I'll try this...