5 Replies Latest reply on Mar 30, 2018 10:04 AM by fac586

    Row Template 1 Precedence Versus Row Template 2, 3, 4

    manningda

      Question:

      What is the relationship and/or precidence for the Row 1, 2, 3, 4 Template in the Classic Report:Card Templates?

      <or>

      Where is the detailed explanation for this in the Apex Documentation?

       

      I've reviewed the in-page help dialogue, and the View Documentation button however I'm not finding an explanation that explains the behavior I am trying to understand.  Likewise I've reviewed this page but am not seeing an explanation for the template field precedence.  I have also made a general search within the Oracle Developer Community on the keywords: "Row Template 1" and am not seeing a post that quite fits the behavior I am trying to understand.

       

       

      Behavior:

      Row 2 customizations appear to have precidence over Row 1.

       

      I would have expected that where customizations are indicated for Row 1 that they would apply to the 1st Db Record returned, then Row 2 for the next and each following record.  Row 3, and 4 would behave in the same precedence.

       

       

       

      Context:

      I've been customizing some card details to make a set of address cards.

       

       

      The original Card Template carries the following for Row 1 & 2:

      <li class="t-Cards-item #CARD_MODIFIERS#">

        <div class="t-Card">

          <a href="#CARD_LINK#" class="t-Card-wrap">

            <div class="t-Card-icon u-color #CARD_COLOR#"><span class="t-Icon fa #CARD_ICON#"><span class="t-Card-initials" role="presentation">#CARD_INITIALS#</span></span></div>

            <div class="t-Card-titleWrap"><h3 class="t-Card-title">#CARD_TITLE#</h3></div>

            <div class="t-Card-body">

              <div class="t-Card-desc">#CARD_TEXT#</div>

              <div class="t-Card-info">#CARD_SUBTEXT#</div>

            </div>

            <span class="t-Card-colorFill u-color #CARD_COLOR#"></span>

          </a>

        </div>

      </li>

       

       

      My customization (which is working precisely as expected) looks like:

      <li class="t-Cards-item #CARD_MODIFIERS#">

        <div class="t-Card">

          <a href="#CARD_LINK#" class="t-Card-wrap">

            <div class="t-Card-icon u-color #CARD_COLOR#"><span class="t-Icon fa #CARD_ICON#"><span class="t-Card-initials" role="presentation">#CARD_INITIALS#</span></span></div>

            <div class="t-Card-titleWrap">

                <h3 class="t-Card-title">#NAME#</h3>

                <div class="t-Card-info">#COUNTS#</div>

            </div>

            <div class="t-Card-body">

              <div class="t-Card-desc">#ADD01#</div>

              <div class="t-Card-desc" style="text-transform: capitalize;">#CITY#, #STATE#  #ZIP#</div>

              <div class="t-Card-info">#COUNTS#</div>

            </div>

            <span class="t-Card-colorFill u-color #CARD_COLOR#"></span>

          </a>

        </div>

      </li>

       

       

      That customization is applied ONLY to Row 1.

       

      In testing the template behaviors I initially applied my customizations to Row 1 & 2 simultaneously. = Success

       

      Then I tried returning Row 2 to the default <DIV> syntax above and leaving my customizations in Row 1. = Failure

      The cards showed no data and only the default substitution strings (ex: #CARD_TITLE#, #CARD_TEXT#, etc.)

       

      Then I reversed Row 1 (defaults) with Row 2 (customizations) and all data returned in the order expected by the customizations.

       

      Then I removed Row 2 and returned Row 1 to the customizations.  = Success

       

       

      So the good news is that I feel I am understanding much more clearly how to apply customizations using the template components, however as I mentioned above I would have expected Row 1 to have precedence and then Rows 2-4 to follow accordingly.

       

      Can someone help clarify this behavior and/or point me toward the documentation that applies?

       

       

      Thanks to all in advance.

       

      PS:

      ...btw...  If anyone also wanted to explain how to format my post questions to properly "highlight" code and/or quotations as I see other's doing that would also be appreciated.

      I do not see the "code" tag in the page RTF options above.

      Continued Thanks,

        • 1. Re: Row Template 1 Precedence Versus Row Template 2, 3, 4
          jariola

          manningda wrote:

           

          PS:

          ...btw... If anyone also wanted to explain how to format my post questions to properly "highlight" code and/or quotations as I see other's doing that would also be appreciated.

          I do not see the "code" tag in the page RTF options above.

          Continued Thanks,

          Oracle Community – How To FAQ > How do I format code?

          • 2. Re: Row Template 1 Precedence Versus Row Template 2, 3, 4
            fac586

            manningda wrote:

             

            Question:

            What is the relationship and/or precidence for the Row 1, 2, 3, 4 Template in the Classic Report:Card Templates?

            <or>

            Where is the detailed explanation for this in the Apex Documentation?

             

            I've reviewed the in-page help dialogue, and the View Documentation button however I'm not finding an explanation that explains the behavior I am trying to understand. Likewise I've reviewed this page but am not seeing an explanation for the template field precedence. I have also made a general search within the Oracle Developer Community on the keywords: "Row Template 1" and am not seeing a post that quite fits the behavior I am trying to understand.

             

            Behavior:

            Row 2 customizations appear to have precidence over Row 1.

             

            I would have expected that where customizations are indicated for Row 1 that they would apply to the 1st Db Record returned, then Row 2 for the next and each following record. Row 3, and 4 would behave in the same precedence.s using the template components, however as I mentioned above I would have expected Row 1 to have precedence and then Rows 2-4 to follow accordingly.

            The row template "precedence" is as would be expected 1 → 2  → 3  → 4, but the most important thing is that they are conditional. This is clearly covered in section 13.2.14.3.3 of the documentation:

            Row templates define the look of each column. You can define up to four row templates, each of which can be conditional.

             

            By creating conditions, you can create a report that displays rows differently depending on whether the specified condition is met. To specify a row template be used conditionally, select a condition type from the Column Template Condition list. Valid values include:

            • Use Based on PL/SQL Expression. Conditionally formats columns based on data in that row.
            • Use for Even Numbered Rows. Conditionally formats even numbered rows.
            • Use for Odd Numbered Rows. Conditionally formats odd numbered rows.

            In practice "can be conditional" is misleading. In order to use multiple row templates (or column templates in the other type of report template) all of them apart from the final default option must be conditional.

             

            The fact that you have not mentioned conditions in your post indicates that you have probably overlooked this aspect of things, leading to the unexpected and unpredictable behaviour you are observing. What condition types/expressions are defined?

             

            The built-in Cards template has two row templates, with the condition used to switch between them being of type PL/SQL Expression, using the expression :CARD_LINK is not null to render template 1 when the row contains a link URL, and template 2 when it does not.

            ...btw... If anyone also wanted to explain how to format my post questions to properly "highlight" code and/or quotations as I see other's doing that would also be appreciated.

            See the Code Formatting section in the Oracle Community Guide.

            I do not see the "code" tag in the page RTF options above.

            Odd, no? HTML contains a range of semantic elements that exist purely to represent the content of technical discussions relating to computing (code, var, samp, kbd) but Jive—the vendor of the forum software used by most big tech companies (Oracle, Apple, VMware etc)—completely ignores their existence.

            • 3. Re: Row Template 1 Precedence Versus Row Template 2, 3, 4
              fac586

              manningda wrote:

               

              I've been customizing some card details to make a set of address cards.

               

               

              My customization (which is working precisely as expected) looks like:

               

              <li class="t-Cards-item #CARD_MODIFIERS#">

              <div class="t-Card">

              <a href="#CARD_LINK#" class="t-Card-wrap">

              <div class="t-Card-icon u-color #CARD_COLOR#"><span class="t-Icon fa #CARD_ICON#"><span class="t-Card-initials" role="presentation">#CARD_INITIALS#</span></span></div>

              <div class="t-Card-titleWrap">

              <h3 class="t-Card-title">#NAME#</h3>

              <div class="t-Card-info">#COUNTS#</div>

              </div>

              <div class="t-Card-body">

              <div class="t-Card-desc">#ADD01#</div>

              <div class="t-Card-desc" style="text-transform: capitalize;">#CITY#, #STATE# #ZIP#</div>

              <div class="t-Card-info">#COUNTS#</div>

              </div>

              <span class="t-Card-colorFill u-color #CARD_COLOR#"></span>

              </a>

              </div>

              </li>

              Whilst this is a useful introduction to the huge range of possibilities offered by custom report templates, it's worthwhile pointing out that it's possible to achieve the layout and formatting desired in this case without having to create a new report template. These requirements can be met by combining the built-in Cards template with report column HTML Expressions and CSS: Multiple CARD_TEXT in APEX.

               

              Lamentably, column HTML Expressions are not covered in the documentation. See online help for this property in Page Designer.

              • 4. Re: Row Template 1 Precedence Versus Row Template 2, 3, 4
                manningda

                Thank you for your notes.  They are informative, thorough and helpful.

                 

                 

                I did overlook the conditional difference between Row 1 and Row 2.

                 

                 

                I do not quite agree that 13.2.14.3.3 reads to my question quite as clearly as you indicated, but I do certainly agree that it is on point when added to your more in-depth explanation(s).

                 

                 

                It is helpful to have this place to discuss these questions and learn from the experience, as I am sure was true when you were building your skills as well.

                 

                 

                Thank you for the Code Formatting reference as well.

                The friendly tenor of that response was very appreciated.

                • 5. Re: Row Template 1 Precedence Versus Row Template 2, 3, 4
                  fac586

                  manningda wrote:

                   

                  The friendly tenor of that response was very appreciated.

                  As are well-defined, comprehensive questions that don't simply consist of a load of random screenshots.