Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Please ask technical questions in the appropriate category. Thank you!

Custome Template

zoulfikar fahsJul 4 2023

Hi , I'm currently working on a custom template where I'm attempting to display information in a specific manner. I have two tables with a one-to-many relationship, and my goal is to display the main row first, followed immediately by all related rows from the child table. However, I'm struggling to figure out how to achieve this.

You can think of it as a table that should display, for example, each doctor with their corresponding patients.

The issue I'm currently facing is that if a doctor has five patients, the template displays the doctor five times, each time with only one patient.

info:

  1. I am using Oracle APEX 23.1.0.
  2. The SQL query you i am using is a simple query with a join
  3. The custom template is a Card Template.
<li class="t-Cards-item #CARD_MODIFIERS#">

   

  <body>
    <button id="showDetailsButton" type="button">#BOTTONE#</button>

    <div class="z-main-region z-overflow-container">
      <div class="z-region z-region-1">
        <div class="z-sub-region-1">
          <div class="z-inner-region z-inner-region-1 z-con-1">
            #NOME_ATTIVITA#
          </div>
          <div class="z-inner-region z-inner-region-1 z-con-2">
            <span class="z-title-attivita">#TITOLO_TIPO_ATTIVITA#</span>
            <span class="z-risultato-attivita">#TIPO_ATTIVITA#</span>
          </div>
          <div class="z-inner-region z-inner-region-1 z-con-3">
            <span class="z-title-concessione">#TITOLO_CONCESSIONE#</span>
            <span class="z-risultato-concessione">#CONCESSIONE#</span>
          </div>
          <div class="z-inner-region z-inner-region-1 z-con-4">#TOTALE#</div>
          <div class="z-inner-region z-inner-region-1 z-con-5">
            <span class="z-title-concessione"
              >#TITOLO_DESCRIZIONE_CONCESSIONE#</span
            >
            <span class="z-risultato-descrizione-concessione"
              >#DESCRIZIONE_CONCESSIONE#</span
            >
          </div>
          <div class="z-inner-region z-inner-region-1 z-con-6">#LINK_1#</div>
          <div class="z-inner-region z-inner-region-1 z-con-7">#LINK_2#</div>
          <div class="z-inner-region z-inner-region-1 z-con-8">#ALLEGATI#</div>
        </div>
      </div>

      <button
        type="button"
        class="z-button collapsible toggleButton"
        id="z-button-details"
      >
        <span class="icon-button-detail">#ICON_BUTTON_DETAILS#</span>
        <span>#TESTO_DETAILS# <strong> #NOME_ATTIVITA# </strong></span>
      </button>

      <div id="REGION_#MAIN_CONTENT_DETAILS" class="z-content z-main-details">
        <div id="#VOCE_#REGION_VOCE#" class="z-region z-region-2 z-details">
          <div class="z-header-region z-header-region-2">
            <div class="z-header z-h-1">#HEADER_NOME_VOCE#</div>
            <div class="z-header z-h-2">#HEADER_DATA_VOCE#</div>
            <div class="z-header z-h-3">#HEADER_DESCRIZIONE_VOCE#</div>
            <div class="z-header z-h-4">#HEADER_IMPORTO_VOCE#</div>
          </div>

          <div class="z-sub-region-2">
            <div class="z-inner-region z-inner-region-2 z-voce-1">
              #NOME_VOCE#
            </div>
            <div class="z-inner-region z-inner-region-2 z-voce-2 z-data">
              <span class="z-title z-data-inizio"
                >#TITOLO_DATA_INIZIO_VOCE#</span
              >
              <span class="z-risultato">#DATA_INIZIO_VOCE#</span>
            </div>
            <div class="z-inner-region z-inner-region-2 z-voce-3 z-data">
              <span class="z-title z-data-fine">#TITOLO_DATA_FINE_VOCE#</span>
              <span class="z-risultato">#DATA_FINE_VOCE#</span>
            </div>
            <div class="z-inner-region z-inner-region-2 z-voce-4 z-data">
              <span class="z-title z-giorni">#TITOLO_NUMERO_GIORNI_VOCE#</span>
              <span class="z-risultato z-risultato-giorni"
                >#NUMERO_GIORNI_VOCE#</span
              >
            </div>
            <div class="z-inner-region z-inner-region-2 z-voce-5">
              #DESCRIZIONE_VOCE#
            </div>
            <div class="z-inner-region z-inner-region-2 z-voce-6">
              #IMPORTO_VOCE#
            </div>
          </div>
        </div>

      </div>
    </div>
  </body>

      
 
</li>

The result you are currently getting is the main row from the parent table being repeated multiple times, once for each related row from the child table

What you are trying to achieve is to display the main row from the parent table once, followed by all the related rows from the child table in the inner region of the template, without duplicating the main row for each related row.

Comments
Post Details
Added on Jul 4 2023
0 comments
56 views