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

Issue With Hiding Pages Dyamically

Avatar

Level 1

This type of question has been asked many times already. Existing forum posts have been very helpful in getting me closer to the answer however I'm still running into an issue that I was hoping to get some help with.

I am using Livecycle designer version 11 along with SAP to create the label. The label has two content areas, one 8.5in x 11in, the other 4in x 6in. There are two pages, linked to their respective content areas...

1469976_pastedImage_2.png1469975_pastedImage_1.png

There is a parameter I pass to the form, IV_LETTER, which I am using to indicate whether to generate the Letter size or the Zebra size. When IV_LETTER = X, print the letter size, otherwise, generate the Zebra size.

I added the following Javascript to the initialization event for each page (I have also tried putting it in the FormReady event)....

PageLetter:

var lv_letter = xfa.resolveNode("$record.IV_LETTER").value;

if( lv_letter = "X" ){

  data.PageZebra.presence = "hidden";

}

PageZebra:

var lv_letter = xfa.resolveNode("$record.IV_LETTER").value;

if( lv_letter != "X" ){

  data.PageLetter.presence = "hidden";

}

When I test the label with IV_LETTER = X, the letter size only generates as expected. When IV_LETTER is blank, just a blank page generates.  

Does anyone have any ideas on what might be happening? Is there something with the multiple content areas that is causing a problem?

Any help would be greatly appreciated!

1 Accepted Solution

Avatar

Correct answer by
Level 4

The equals operator in JavaScript is "==" and not "=".

You actually assigned "X" to lv_letter.

So your line should be

if ( lv_letter == "X" ) {

Does it work now?

View solution in original post

2 Replies

Avatar

Correct answer by
Level 4

The equals operator in JavaScript is "==" and not "=".

You actually assigned "X" to lv_letter.

So your line should be

if ( lv_letter == "X" ) {

Does it work now?

Avatar

Level 1

Ulibaehr,

Thank you for your response. I don't know how I overlooked that but once I made the change, it worked as expected. Thank you!!!