ae751438b669c74fd5809bfed90f725037f60417
braney
  Fri Jul 30 16:18:11 2021 -0700
add support for second page of help results to hgTables and hgVai. Move
"no results" printf to library.
Change comment in hgTables/identifiers.c to make more sense.

diff --git src/hg/hgTables/hgTables.c src/hg/hgTables/hgTables.c
index 9565b5b..bc7ecd8 100644
--- src/hg/hgTables/hgTables.c
+++ src/hg/hgTables/hgTables.c
@@ -1695,45 +1695,55 @@
     {
     getBackgroundStatus(backgroundStatus);
     exit(0);
     }
 
 char *backgroundExec = cgiUsualString("backgroundExec", NULL);
 if (sameOk(backgroundExec,"gsSendToDM"))
     {
     gsSendToDM();
     exit(0);
     }
 
 /* Init track and group lists and figure out what page to put up. */
 initGroupsTracksTables();
 struct dyString *dyWarn = dyStringNew(0);
+boolean noShort = (cartOptionalString(cart, "noShort") != NULL); // is this the second page of results
+char *range = windowsToAscii(cloneString(cartUsualString(cart, hgtaRange, "")));
 struct hgPositions *hgp = lookupPosition(dyWarn);
-if (hgp->singlePos && isEmpty(dyWarn->string))
+if (hgp->singlePos && isEmpty(dyWarn->string) && !noShort)
     {
     if (cartUsualBoolean(cart, hgtaDoGreatOutput, FALSE))
 	doGetGreatOutput(dispatch);
     else
 	dispatch();
     }
 else
     {
     cartWebStartHeader(cart, database, "Table Browser");
     if (isNotEmpty(dyWarn->string))
+        {
+        if (noShort) // we're on the second page of results
+            hgp->posCount = 0;  // hgFindSearch gives us a bogus hgp if the warn string is set
+        else
             warn("%s", dyWarn->string);
-    if (hgp->posCount > 1)
+        }
+    if ((hgp->posCount > 1) || noShort) // if we're on the second page we want to put out HTML even if there are no results.
+        {
         hgPositionsHtml(database, hgp, hgTablesName(), cart);
+        cartSetString(cart, hgtaRange, range); // we need to reset the position because lookupPosition above trashes it
+        }
     else
         {
         struct sqlConnection *conn = NULL;
         if (!trackHubDatabase(database))
             conn = curTrack ? hAllocConnTrack(database, curTrack) : hAllocConn(database);
         mainPageAfterOpen(conn);
         hFreeConn(&conn);
         }
     cartWebEnd();
     }
 
 textOutClose(&compressPipeline, &saveStdout);
 
 if (doGenomeSpace())
     {