CCALI / a2jauthor

CALI A2JAuthor document automation authoring and viewing platform
https://www.a2jauthor.org
Other
4 stars 1 forks source link

Advanced Navigation: previous Navigation Panel labels are not static #255

Closed normon66 closed 2 years ago

normon66 commented 2 years ago

If dynamic text (macro) is included in the labels that are created for the Navigation Panel entries, previous labels can change as the value in the macro changes.

Sample interview is attached (same as in #254)

In this example, the loop counter (Qctr) is included in the page text, so it also gets included in the label used in the Navigation Panel (first image below). This works great during the first time through the loop, which includes "Loop 1" (second image). image

image

However, if we go to a second loop, Qctr is incremented, and all of the previous labels, which should still show "Loop 1", are updated to reflect the new value and Qctr and instead show "Loop 2" image

Advanced Navigation loop test 1.zip

janebitovi commented 2 years ago

This is related to https://github.com/CCALI/a2jviewer/issues/158

The logic functions were built assuming they'd only need to represent the current state and not each individual context, it's not an easy fix without taking on the full logic refactor... will investigate if this can be patched the same way we did ORDINAL

janebitovi commented 2 years ago

fixed it more generically image and ordinal still works image

Specifically when it's rendering the title of a visited page in the advance nav or dropdown, any (specifically) inner/outer loop vars being rendered in the text will first check the visited page for corresponding saved loop values. Otherwise it will fall back to previous global behavior if the vars aren't a match or aren't set. The way logic renders text should not have changed anywhere else in the app.

This should match author expectations over 99% of the time without introducing new macros or changing what the author has to consider.

if rendering text for the adv nav or dropdown
  and the text is rendering an inner or outer loop var
    and the current visited page being rendered has a value for that loop var
      use the visited page's loop var value instead of using the global app value
      Otherwise, in all other cases, continue using the usual global app values