Alpha Video Training
Results 1 to 4 of 4

Thread: Two list record counts on same page

  1. #1
    Member
    Real Name
    Giancarlo Fiorentini
    Join Date
    Oct 2019
    Location
    New Jersey
    Posts
    25

    Default Two list record counts on same page

    This is a bit of a newbie question: How can I adjust the List Record Count HTML so that it can appear twice on the same UX component page? The default method defines a span ID, which of course can only appear once. Any other attempts appear blank. I simply need a way to display the list record count as static text twice in the same page.

  2. #2
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    7,865

    Default Re: Two list record counts on same page

    Probably a lot of ways to do this... and the method may depend on what you're doing with the List... what affects the record count.
    Duplicate the List record count static text control and then change the id... e.g. dupCount.
    In the List afterRenderComplete event...

    Code:
    var recCnt = $("{dialog.componentname}.LISTCUST.RECORDCOUNT").innerHTML;
    $("dupCount").innerHTML = recCnt;
    Last edited by Davidk; 02-14-2020 at 01:01 PM. Reason: fixed name of List event

  3. #3
    Member
    Real Name
    Giancarlo Fiorentini
    Join Date
    Oct 2019
    Location
    New Jersey
    Posts
    25

    Default Re: Two list record counts on same page

    David, thank you so much for the really helpful response. This looks like a promising approach that makes sense, but unfortunately seems to return 0 instead of the correct record count. A few more details:

    - The list ("New_Tickets") is in its own panel card. I inserted the following code in its afterRenderComplete event.
    var recCnt = $("{dialog.componentname}.New_Tickets.RECORDCOUNT").innerHTML;
    $("NewTicketCount").innerHTML = recCnt;
    - The duplicated record count would appear in the panel header. The HTML reads
    <font size="4"><strong>New Tickets</strong></font> &nbsp &nbsp &nbsp <span id="NewTicketCount"></span> tickets
    - The original default record count HTML is inside a list ("Ticket_Menu_List") which is a flyout menu inside another panel card ("MENULEFT").
    <span id="{dialog.componentname}.New_Tickets.RECORDCOUNT"></span>
    Thank you again very much for your time and help.

    2020-02-14_9-33-01.png

  4. #4
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    7,865

    Default Re: Two list record counts on same page

    Is your New_Tickets List to Delay Render? The List afterRenderComplete isn't really what it says. This event runs even though Delay Render is set... and an error occurs for the Defined Control List-Record Count. It's not really Delay Render of the Control... it's more Delay Render of the data. The error occurs because there is no RECORDCOUNT to get.

    If you have Delay Render set, then you may want to re-think what's going on. You can't get a second record count to show if the first isn't set yet.

    If this isn't what is happening, then more detail from you is needed.

    You could use the List event onPopulate, but with Delay Render set you still get the RECORDCOUNT error. You can do away with the Defined Control altogether and just set 2 of your own record counts.

Similar Threads

  1. Replies: 15
    Last Post: 11-21-2019, 06:04 PM
  2. Record Counts in Reports
    By gitpicker in forum Application Server Version 10 - Web/Browser Applications
    Replies: 7
    Last Post: 10-22-2014, 07:46 PM
  3. counts and summaries
    By dik_coleman in forum Alpha Five Version 8
    Replies: 10
    Last Post: 01-14-2008, 09:55 AM
  4. Report w/1 record/page repeated 3 times on 1 page
    By joshuajantz in forum Alpha Five Version 8
    Replies: 4
    Last Post: 07-28-2007, 12:34 AM
  5. Conditional Counts
    By Jim VanGelder in forum Alpha Five Version 4
    Replies: 2
    Last Post: 05-17-2000, 05:34 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •