Expand my Community achievements bar.

Problem in the master page

Avatar

Former Community Member

Hello,

I have a problem in my form.
I have buttons on the Master Page and I wish I could use these buttons to make visible or hidden subforms. Once a button is clicked, I would also change its color.
I do not understand why it does not work.
Forgiveness can someone take a look and help me.

3 Replies

Avatar

Level 10

Hi,

Because you are accessing objects on the design pages, from the Master Page you will need to resolve the nodes.

var oSubform = xfa.resolveNode("xfa.form.form1.page1.subform2");

Example is here: https://acrobat.com/#d=8AlfbIzPxwT2LV95*754cg

The objects on the left are all on the design page 1, so referencing them is easy.

The objects on the left are on different pages. The button is on the Master Page, whereas the subform is on page 1. The script above resolves the node, so that you can then use oSubform.

Hope that helps,

Niall

Avatar

Former Community Member

Thank you Niall for your response.

I do this but i have the same problem with the color of bouton. That is my form.

https://acrobat.com/#d=dehsafiUcSuIAIHM2EFYMQ

Thanks again

Avatar

Level 10

Hi,

It is strange that the initialize event is working for the first button.

If I was doing this, I would pass the SOM through to the function:

var oButton = this.somExpression;

if(init.value == 0){

fOnglet.fpanelChange(oButton, this.index, this.all.length);

init.value = "1";

}

Then I would resolve it in the function:

function fpanelChange(o_btn, n_numPanel, n_totalPanel)

{

var o_btn = xfa.resolveNode(o_btn);

...

Again this is working in the initialize event but not the click.

Here is the form: https://acrobat.com/#d=drzwPU-rDXl3wSAzRLK3Sg (not much different / not working).

Here is a sample when I change visual appearance in a function (where all the objects are on the design pages): https://acrobat.com/#d=XGj9UEk4lSbDSoArnQU8dQ

I will try and have a look again later,

Niall