Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

changing content of master page using a button

Avatar

Level 3

Hi there,

I have a radio button set on one of my pages in a form. I can use the radio button set to show and hide a text field anywhnere within the form... however, I would much prefer it if this show/hide text box was on the master page instead - this I would only have to do it once for it to be repeated throughout.

Is this possible?

Here's my code (I tried it with a text box within the page and it worked fine... but this doesn work)

if (form1.Core1.core2flowed.nondisclosuretable.row1.disclosure.disclosureradio.rawValue == "Yes")

{

form1.#pageSet[0].COREMASTER.space.presence = "visible";

}

else if (form1.Core1.core2flowed.nondisclosuretable.row1.disclosure.disclosureradio.rawValue == "No")

{

form1.#pageSet[0].COREMASTER.space.presence = "hidden";}

I should mention that the COREMASTER is one of my masterpages and disclosureradio is the radio button set.

Anyone help?

3 Replies

Avatar

Level 4

Just a quick question: are the radio boxes set for hiding and showing? Like if I check the first it hides it and if I click the second it shows the field? If so very easliy you could just open the Action Builder, create a new action for showing the field by selecting the "yes" and then create another action for hiding the item if the "no" radio box is checked. But yes.....you can use the same functions of hiding or showing content on the master page as you can on the regulat page.

Avatar

Level 3

Hi there again,

Thanks Josh - that was helpful. However it didn't work on the form I've created. It did work with fresh form though which is really now beginning to confound me. I've tried a couple of ways.

The way you suggested posts this in the 'change' script event:

if (this.rawValue == "1") {

  this.resolveNode("#pageSet.Page1.TextField1[1]").presence = "hidden";

}

I've also done it this way:

if (this.rawValue === "2")

{

xfa.resolveNode("form1.#pageSet[0].Page2.TextField1").presence = "visible";

}

else

{

xfa.resolveNode("form1.#pageSet[0].Page2.TextField1").presence = "hidden";

}

this also works... but this is solely on a fresh form.

If I try exactly the same thing in my existing (and very lengthy and almost complete form it won't work:

if (this.rawValue == "2") {

  this.resolveNode("#pageSet.CoreMaster.TextField1").presence = "visible";

}

if (this.rawValue == "1") {

  this.resolveNode("#pageSet.CoreMaster.TextField1").presence = "hidden";

}

...and I have no idea why!

I'm assuming there's something I've set up with this particular master page. Does anyone have an idea why this doesn't want to work?

Avatar

Level 4

I just PMed you to shoot me a copy of your form so I can take a look at it.