Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

Hide a button in the Table Header on subsequent pages

Avatar

Level 1

I have a button to add a row in the table header of a LiveCycle dynamic form and would like to hide that button after someone clicks a 'Lock' button.  The individual table elements are fine as are items in the master page.  But, I don't see where I hide the Table elements that are repeated to subsequent pages (header/footer). 

Can anyone help?

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

On the button add the code  app.alert(this.somExpression)     This is only a temporary measure to allow you to see the expression that you must reference in your for loop. Now render your form and have the table span across multiple pages. Hit the button on a coupe of different pages. It ill diosplay the somExpression for the button that you have hit. Note the similarities in the name ...you will see that the Expressions are the same except for the Page Name occurance marked by [n]. This repeated occurance is what you need to find out ....so you can use the instanceManger,count to find out how many there are and then construct your for loop to loop through each occurance and change the presence of the button.

make sense?

Paul

View solution in original post

5 Replies

Avatar

Former Community Member

Either move the button out of the header (so it is not repeated on each page) or use a for loop to hide all ofthe occurances of the button starting at occurance 1 and ending at Header.instanceManager.count

Paul

Avatar

Level 1

But, how do I reference the repeated button in each header?

It is in the first column of a table, called Table1, and is repeated on each page.

Avatar

Correct answer by
Former Community Member

On the button add the code  app.alert(this.somExpression)     This is only a temporary measure to allow you to see the expression that you must reference in your for loop. Now render your form and have the table span across multiple pages. Hit the button on a coupe of different pages. It ill diosplay the somExpression for the button that you have hit. Note the similarities in the name ...you will see that the Expressions are the same except for the Page Name occurance marked by [n]. This repeated occurance is what you need to find out ....so you can use the instanceManger,count to find out how many there are and then construct your for loop to loop through each occurance and change the presence of the button.

make sense?

Paul

Avatar

Level 1

Makes perfect sense.  I'll give it a try.  Thanks.

Avatar

Level 1

I got it working, but it wasn't using Header.instanceManager.count.  Header.instanceManager.count seemed to be counting the number of header rows in the table, not the number of pages it rendered on.  When I added enough table rows to get to 5 pages, it still only counted 1.

I used xfa.host.numPages to itterate throught the pages, now that I know where the button is stored.

It is working great.  Thanks for your help.

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----