I have a bunch of tables that expand/contract at the click of a button in their respective header rows.
The problem I'm having is when a table breaks to another page the button doesn't work properly in the repeated header - the scripted value isn't making it to the repeated button (I've also tried checkboxes).
Is there any way to make this happen? Should I try using variables to store a flag or something like that?
https://acrobat.com/#d=m7zuQYiUoFrtz5isD7rErQ
Solved! Go to Solution.
Views
Replies
Total Likes
You can use the layout methods to tell you if your table spans two pages or one and if it does you can change the + to a - for all occurances of that button. The code woudl look like this on the Initialize event.:
if
(xfa.layout.pageSpan(this.parent.parent) > 1){
this.resolveNode("caption.value.#text").value
= "-";
}
This works great but if I click the - button on the second page then the 1st page button is out of sync and needs to be reset as well.
Paul
Views
Replies
Total Likes
This issue is that the second header is an instance of the first, so all unmanaged relative code breaks. I would hazzard a guess to say that your add code looks like "$.parent.row1.instanceManager.addInstance(1)." This will break, as the "second" header row no longer sees the 'table' element as it's parent.
Changing to code to a static reference will fix it... i.e. xfa.form.form1.table1.row1.instanceManager.addInstance(1).
This should solve it for you... if not, let me know.
- Scott
You can use the layout methods to tell you if your table spans two pages or one and if it does you can change the + to a - for all occurances of that button. The code woudl look like this on the Initialize event.:
if
(xfa.layout.pageSpan(this.parent.parent) > 1){
this.resolveNode("caption.value.#text").value
= "-";
}
This works great but if I click the - button on the second page then the 1st page button is out of sync and needs to be reset as well.
Paul
Views
Replies
Total Likes
Thanks guys! I knew it had something to do with instances but wasn't sure how to proceed.
Scott - it's a little more involved than that, I'm passing the table's somExpression to a script object which handles hiding and showing rows. Probably complicating the fact is that the tables are instances as well for a prePrint script I have that runs through the tables and hides rows if they aren't used.
Paul - that did the trick. I made it an if/else and put it on the layout:ready event, the initialize event wasn't working for the if/else.
Views
Replies
Total Likes
Well, it's almost working...I think I'm going to have to go with the set-a-flag technique to monitor whether a table is expanded or not.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies