Hide Object on Page > 1

dpz_

04-03-2016

Hi,

i want to hide an Object with

object.presence = "hidden";

only when its not on the first page. How can i manage this?

In Event initialize xfa.layout.page(this) is not available.

In Event layout:ready its too late to hide the Object.

Is there a fitting Event for my need?

Regards

dpz

Accepted Solutions (0)

Answers (5)

Answers (5)

_Bruce_Robertson

MVP

07-03-2016

Hi Daniel,

It's hard to know without looking at your form, is the object you are setting as hidden in a table?

If you can upload your form to google docs, dropbox, or similar and post a link to your form, I'm happy to have a look.

Bruce

dpz_

06-03-2016

Hi Bruce,

you are right, this.presence works better but i reached still not the wanted result.

Now i get

1st Page. Correct. Obejct in shown

2nd and 3rd Page: Object is not shown but there is a white space instead of the object. I would expect this when using "invisible".

Perhaps this is because the form is already rendered and so i get white gaps when hiding elements?

Regards

Daniel

_Bruce_Robertson

MVP

05-03-2016

Hi Daniel,

I think the line "data.MAIN.Tabelle1.Kopfzeile_First.Kopf_Main.Kopf_Main_1.presence = "hidden";" needs to be something like "this.presence = "hidden";" .  The this object will be set to the target of the event, and the specific occurrence of the target, you have a absolute reference which will always resolve to the first occurrence.

Regards

Bruce

dpz_

05-03-2016

I tried this:

data.MAIN.Tabelle1.Kopfzeile_First.Kopf_Main.Kopf_Main_1::ready:layout - (JavaScript, client)

page = xfa.layout.page(this);

if (page == 1 ) {

xfa.host.messageBox("First " + page.toString());

}

else {

xfa.host.messageBox("Hide " + page.toString());

data.MAIN.Tabelle1.Kopfzeile_First.Kopf_Main.Kopf_Main_1.presence = "hidden";

}

Result with 3 Pages is:

First Page: Instead of Kopf_Main_1 there is an empty space (as i would expect using invisible)

Page 2 & 3: Kopf_Main_1 is shown.

I can see 3 Popups 1,2,3 as expected.

Kopf_Main_1 is a Table.

Whats wrong here?

Regards

Daniel

_Bruce_Robertson

MVP

04-03-2016

Hi,

I think layout:ready is the one you want, setting the presence in this event will cause it to fire again, is that the problem do you get some flickering?

Bruce