cancel
Showing results for 
Search instead for 
Did you mean: 

Button in Master page

Former Member
0 Kudos

Hi All,

I have 2 buttons in MASTER PAGE, upon clicking first button , the second button should be hidden. This works fine only for the first BODY PAGE and for rest of the BODY PAGES the second button is still visible. How to make button invisible in all the BODY PAGES?

Thanks

Gopal.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Master page is primary use is to place static content like, company logo and address like.

Its not good approach to do dynamic functionality in master page.

To archive your functionality place 2 buttons in each page of form, when click on first button,in first button "click" method call 2 button "initialize" method. In second button"initialize" method write java script according u r requirement.

Regards

malli...

Former Member
0 Kudos

Hello,

Thats fine... i can have the buttons in the BODY PAGES ... but say... i have some 15 BODY PAGES and the button in all the BODY PAGES performs the same functionality... then we can go for a MASTER PAGE? at that time how to achieve?

Why the MASTER PAGE should have only the static object? Is there any specific reason around that?

Thanks

Gopal.

former_member189058
Active Contributor
0 Kudos

Gopal,

Try this:

on click of button, write this peice of code...


//get number of pages displayed
var pgs = xfa.layout.pageCount()
for i=0 upto pgs do
  xfa.form......Button1<i>.presence = "hidden"
endfor

Regards,

Reema

Former Member
0 Kudos

Hi,

The given code doesnt work for this scenario...

And another thing is that if i click the 1st button in any of the BODY PAGE, the 2nd button on the corresponding BODY PAGE get invisible. But my requirement is if i click 1st button in any of the BODY PAGE, 2nd button in all the BODY PAGE should be invisible.

Thanks

Gopal.

former_member189058
Active Contributor
0 Kudos

I don't understand why you have written that question. shouldn't the same code work for it....

On Click of Button1 write this code:


//get number of pages displayed
var pgs = xfa.layout.pageCount()
for i=0 upto pgs do
  xfa.form......Button2<i>.presence = "hidden"
endfor

makes sense????

Reema.

Former Member
0 Kudos

Hello Reema,

i have worked on your code...

i had a single master page MPage1, two Body Page Bpage1, Bpage2 , two buttons Button1, Button2 in Master Page Mpage1. If i Click on Button1 , the Button2 in all the Body Pages should be hidden.

And the form name is form1.

Script is JavaScript...

On Click event of Button1 ( which is in Master Page MPage1), i have the following code

var pgs = xfa.layout.pageCount();

for(i=0;i<pgs;i++)

{

xfa.form.form1.pageSet.Mpage1.Button2<i>.presence = "hidden";

}

Is the above syntax is right? or Can you give me the exact script please ?

Thanks...

Gopal

former_member189058
Active Contributor
0 Kudos

Hi Gopal,

In order to find how to access a particular button,

simply select that button and goto the script of any event on that button, eg click

you will find the entire path of that button along with the event name..

Reema.