Skip navigation
Jono Moore
Currently Being Moderated

Need some more scripting help

Jul 5, 2010 4:31 PM

 

[I'll be posting this over on the Google Group forum too.]

 

File is here: https://acrobat.com/#d=m7zuQYiUoFrtz5isD7rErQ

 

Form is a series of tables that can expand and contract their respective rows by clicking a button in the header - tables start out collapsed and filler can open the appropriate tables. I'm using + and - values on the buttons to check what they should do - they call a script object which handles looping through the table rows, etc (thanks Niall!).

 

I also have similar loops set up on prePrint and docReady (on the form1 root) events so that the tables collapse down to only used rows for printing or after the form is saved and re-opened.

 

I'm having a few issues that I'm having trouble figuring out. I'm thinking some of the problems might even have to do with which events I'm using but not sure.

 

Resetting the value of the +/- button in the header rows:

Unless a table is expanded and has rows that are empty showing I want the button caption to be a +. I've been trying to explicitly set this as part of the different loops but seem to be having issues.

 

Problem with repeating header button caption:

If a table breaks across a page, the button in the repeated header row doesn't reflect the caption of the button in the parent header row. I kind-of fixed this with some code from Paul Guerett which sets the caption based on xfa.layout.pageSpan and it works but if you click the repeated button again to collapse the table the main button caption doesn't update (should change back to a +), unless you click on the main button.

 

Related to this one is when the file is saved and re-opened table headers that had been repeated show random multiple time (2-5 generally).

 

I also ran into some trouble with Reader when using Unicode characters for the button caption. Instead of +/- I was trying to use \u25BC and \u25B2 (down and up triangles) but Reader seemed to choke on it.

 

This form is ready to go except for these couple of issues that I can't seem to track down.

 

  • Currently Being Moderated
    Community Member
    Jul 6, 2010 4:59 AM

    Hi Jono,

     

    Here is the form with a few mods: https://acrobat.com/#d=rXwdoCcfDC0pWQz-39KWjg

     

    In relation to the repeating headers, I think the main problem is that the HeaderRow was set to repeat in the Object > Binding tab. I have deselected this. However you would need to test. I have seen this before and to get over it I have wrapped the header in a separate subform. I don't want to do it here because of the scripting, but see how you get on.

     

    On the reset button, I have included a execEvent for the docReady event in the form1 node. This resets the "+".

     

    Where a table spans more than one page (generating another "-" button). I have included another line to reset the original button back to "+":

     

     

    xfa.resolveNode("HeaderRow[0].Button1.caption.value.#text").value = "+"; 

     

     

    This seems to work.

     

    I haven't looked at the unicodes. I would stick with the +/-, as these are self evident and you will be less likely to have compatibility problems.

     

    Form looks good!

     

    Good luck,

     

    Niall

    |
    Mark as:
  • Currently Being Moderated
    Community Member
    Jul 6, 2010 10:31 AM

    How about this... Wingdings 3 font (with tooltips). Would depend on availability of this font, however it is shown as built-in.

     

    Acrobat.png

     

    Sample here: http://dl.dropbox.com/u/8257540/2010-07-06%20Wingdings%203%20font.pdf (can't get into Acrobat.com)

     

    Niall

    |
    Mark as:
  • Currently Being Moderated
    Community Member
    Jul 6, 2010 2:26 PM

    More, LP 

    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points