Expand my Community achievements bar.

Renaming repeating forms bookmarks

Avatar

Level 1

Hello and thank you for looking:

I have repeating forms, created based on a bound table. This is all done with reader rights and a livecycle server connected to SAP (so called SIFbA). I want to create bookmarks and I defined them on the XML source level for the template subform. This works. But I’d like that the bookmarks themselves have different names, otherwise the user can’t know what he’s clicking. At the moment there are bookmarks and they all have the same name (Bookmark). It’s clear that we can’t add them in code, so I guess also renaming them is not possible in the code, since the object bookmarkRoot is not supported in the Designer (as shown here LiveCycle * JavaScript objects from Acrobat supported in Designer ). This has been already discussed here Repeating Subform Bookmarks

Is there a possibility however to use the BIND tag around the <text name=”name”>Bookmark</text> to rename the bookmark before it’s generated? I’d like to set a reference in the TEXT tag, property name, to a field from the data connection such as <bind match=“dataRef” ref=“FIELD”/>. But it didn’t work adding that line below the TEXT declaration or instead of the value of the TEXT name declaration.

1 Reply

Avatar

Level 10

I don't see a way to change the bookmarks value, since these are read from the template DOM, which is always read only.

Even a binding won't change that, since this will only take effect on the form DOM, which is the virtual representation of the form created from the template and data DOMs when the form is initialized.

Here an example: A subform (sf1) with a dynamic binding to the value of an embedded textfield (field1).

<subform w="197.3mm" h="284.3mm" name="sf1">

        <extras name="bookmark">

            <text name="name">My default bookmark name</text>

            <text name="color">0,0,0</text>

            <text name="style">normal</text>

            <text name="action">setFocus</text>

        </extras>

        <setProperty ref="!data.form1.sf1.field1" target="extras.#text.[name eq &quot;name&quot;]"/>

<field name="field1" y="6.35mm" x="9.525mm" w="62mm" h="9mm">

            <ui>

              <textEdit>

                  <border>

                    <edge stroke="lowered"/>

                  </border>

                  <margin/>

              </textEdit>

            </ui>

            <font typeface="Arial"/>

            <margin topInset="1mm" bottomInset="1mm" leftInset="1mm" rightInset="1mm"/>

            <para vAlign="middle" widows="2" orphans="2"/>

            <caption reserve="25mm">

              <para vAlign="middle"/>

              <value>

                  <text>Field 1</text>

              </value>

            </caption>

            <value>

              <text>My NEW bookmark name</text>

            </value>

        </field>

</subform>

The setProperty will change the value of the bookmark, but in the form DOM not the template DOM.

You can verify this from the JavaScript console by executing either

xfa.template.saveXML("pretty")

or

xfa.form.saveXML("pretty")

.

Only the latter is updated, but it's NOT the one to be used to create the bookmarks in the PDF viewer.