Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

How to get to the master page objects?

Avatar

Level 6
Hi,



I have a floating field in a text object on a master page of a document.

What is the path to, in javascript, I set the properties of that floating field. I´m only able to get the fields on the page1 object.



Thank you
8 Replies

Avatar

Former Community Member
Something like this could work:



xfa.form.formName.pageSet.masterPageName.fieldName...



Chris

Adobe Enterprise Developer Support

Avatar

Level 6
Hi Chris,



Thank you for your help.

I would like to make one more questions related to this one.

Wiht that line of code, I pretend to fill a floating field with a value. I´m doing something like this:



xfa.form.formName.pageSet.masterPageName.fieldName.rawValue = "Test"



However this only works if the floating field is defined out of the master pages. If it is in the master page the floating field will not be filled with that value. Is this due to the time the masterpages are rendered?



Thank you

Avatar

Former Community Member
What event are you trying to do it in?



Chris

Adobe Enterprise Developer Support

Avatar

Former Community Member
I have similar problem. I have a picture on master page and by clicking a button on a body page i want to get rid of that picture. The problem i s thah the MP with picture repeats 5 times becouse of 5 body pages and when I add a script to a button

xfa.form.MP.pageSet.Page2.SubWithImage.presence = "invisible";

the image will dissapear only from the first page, the left 4 still have the image. How can I access the other fields and make them invisible?

Thanks for reply.

Avatar

Former Community Member
Is it possible to put a script into a fillable field on a master page to set the focus to that field when the document opens? The field I'm trying to set the focus to is on the first master page with a max occurrence of 1, this is the script I'm using in the initialize event and it's not working. The form is dynamic.



xfa.host.setFocus("xfa[0].form[0].form1[0].mp[0].Page1[0].h1[0].caseNum[0]");

Avatar

Former Community Member
I just read in the Adobe help that you can't use the setFocus method in the initialize event, I moved my script to the docReady event and still having no luck.

Avatar

Former Community Member
Hi,



I can't seem to get this code to work (xfa.form.[formName].pageSet.[masterPageName].[fieldName].presence = "Invisible"). I have a set or radio buttons which determines whether a static text on the master page should be visible or invisible; if value less than 9 then text should be invisible and if value = 9 then text should be visible.

Thanks

Avatar

Former Community Member
Dealing with master page objects is quite buggy -- at least in LiveCycle 7.x. I learned a lot of new... curses, when I tried to script fields within the master page.

http://www.adobeforums.com/cgi-bin/webx/.3bc38abc