Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

hide textfield in masterpage

Avatar

Level 4

hello I have a problem 

in the master page I have a textfield 

this textfield must be visible within the pdf document 

and up to here no problem 


within the document there is a button that makes a series of checks 
if these checks are successful the textfield, in the masterpage, has become invisible 



if I write this script 
form1.pageSet.Page1.TextField2.presence = "hidden"; 

The textfield is not shown for only the first page 

for all other pages can be seen 

how can I do ????? 

forgive me for my English 

thank's

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

Each TextField1 on each page is unique based on an occurance number. If no occurance number is used the 1st occurance is assumed. So the one on th esecond page woudl be:

form1.pageSet.Page1[1].TextField2.presence = "hidden";

And on the 3rd page"

form1.pageSet.Page1[2].TextField2.presence = "hidden";

So the easiest way is to get set up a for loop like this:

for (j=0; j< xfa.layout.pageCount();j++){

     xfa.resolveNode("form1.pageSet.Page1[" + j + "]").TextField2.presence = "hidden"

}

Paul

View solution in original post

9 Replies

Avatar

Correct answer by
Former Community Member

Each TextField1 on each page is unique based on an occurance number. If no occurance number is used the 1st occurance is assumed. So the one on th esecond page woudl be:

form1.pageSet.Page1[1].TextField2.presence = "hidden";

And on the 3rd page"

form1.pageSet.Page1[2].TextField2.presence = "hidden";

So the easiest way is to get set up a for loop like this:

for (j=0; j< xfa.layout.pageCount();j++){

     xfa.resolveNode("form1.pageSet.Page1[" + j + "]").TextField2.presence = "hidden"

}

Paul

Avatar

Level 4
hello paul, there is a strange thing

If you put it

for (j = 0 j <xfa.layout.pageCount () j + +) (

      xfa.resolveNode (form1.pageSet.Page1 [ "+ j + "]"). TextField2.presence =" hidden "

)

without further instructions to the event click of a button, everything works ok



if I post another statement at the event click of a button, for example:

for (j = 0 j <xfa.layout.pageCount () j + +) (

      xfa.resolveNode (form1.pageSet.Page1 [ "+ j + "]"). TextField2.presence =" hidden "

)
xfa.form.form1.pag2.comun.verifica.presence = "hidden";

not function
you can help me??

Avatar

Level 4

hi

In your opinion is correct as I did???

Avatar

Former Community Member

The script is fine but You cannot hide the object that is executing the script. There woudl be no place to put the cursor. If you put the cursor in another field before changing the presence of the object then that will work. I modified your sample (amended the script object).

Hope that helps

Paul

Avatar

Level 1

Hi,Paul:

How to set the Default Vaule of  TextField1 likes "vertical" ?

I opened your pdf file ,  I am interesting  for the "WaterMark" direction.

thank you for your sharing.  ^_^

Eric

Avatar

Former Community Member

Do you want to change the value (the text) that TextField1 displays or the direction in which the field is displaying?

Paul

Avatar

Level 1

Hi, Paul:

I want ,the latter , to change the direction in which the field is displaying.

Ha, thank you! 

Eric

Avatar

Former Community Member

On the layout tab beside the Anchor point you can click the icons there to casue th efield to rotate buy 90 degree increments.

Paul

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----