This topic is locked
[SOLVED]

Filter panel not displayed

3/23/2022 2:39:48 PM
ASPRunner.NET General questions
Pete K author

This is a vexing problem. I have a list page which refuses to display the filter panel. It shows up in both the designer and editor in ASPR (I'm on 10.7, build 38856), but does not display in the generated app. When I look at the source code, I see the panel code is generated but it's empty:

<DIV data-itemtype="filter_panel" data-itemid="filter_panel" data-hidden data-pageid="1">
<DIV class="filterPanelContainer ">
<!-- Begin Filter panel content -->
<!-- End Filter panel content -->
</div>
</div></td>

I've tried doing the full rebuild, creating a new list page, adding/deleting filters, show/hide search panel in the generated app, even tried changing the page layout beween top/side menus. Nothing is working. Has anyone ever encountered this? Any ideas on what else to try? I'm stumped!

F
Frank R 3/23/2022

What happens when you set:

  • Hide Filter Panel until search = not checked
  • Freeze Search Panel = checked

Pete K author 3/23/2022

Update! I decided to look at all my custom code on events related to this table and discovered that if I disable my where tabs API code in the AfterTableInit() event, the issue goes away (the filter panel displays as expected.) Either this is a bug or there is something wrong with my code. The code does seem to work; it generates the tabs and displays them properly.

Here's the code:

// Add Where Tabs

dynamic data = XVar.Array();
dynamic record;
dynamic rs = DB.Query("select * from SchoolYear where ShowTab = 1 order by SchoolYear ;"); // Table containing tab names and IDs
while(record = rs.fetchAssoc())
{
WhereTabs.addTab(table, "SchoolYear=" + record["SchoolYear"].ToString(),record["Caption"].ToString(),record["SchoolYear"].ToString());
WhereTabs.setTabShowCount(table,record["SchoolYear"].ToString(),true); // Show count on tab
WhereTabs.setTabHideEmpty(table,record["SchoolYear"].ToString(),true); // Hide tab if zero records
}

Like I said, the code compiles and runs and dispays the tabs as expected. Also, I can add the tabs at design tab in the GUI and they don't interfere with the filter panel. So it's not the tabs per se, but the code causing the issue. Very strange!

Pete K author 3/23/2022

Thanks, Frank. I did try those settings. But as you can see, I've now narrowed it down to my where tabs code, although I don't see anything wrong with it.

Pete K author 3/23/2022

I don't know what I did, but the problem has disappeared. I tried putting my where tabs code back, but hard-coded the values rather than pulling them from the database and that worked. Okay, I thought, something wrong with my database code. I could see the queries were running in SQL though and nothing seemed amiss. But when I went back to the orginal code, it suddenly started working again. I have no idea why, but all is well now.