Jump to content

Graphic Frame Suppression does not work


ReminderVDP

Recommended Posts

I have been trying to suppress a graphic frame that is on top of a text frame that will suppress when the QR Code is not present and the text will not wrap. I am using this JavaScript in the rule and it gives me the error that there is no graphic frame by that name. Do I just have the code written wrong? QRCode is the name of the Graphic Frame.

 

//Suppresses QR Code frame if empty

 

if (Field("QRCode") == "");

{

var qrcode = FindGraphicFrame("QRCode");

qrcode.suppress = true;

}

Link to comment
Share on other sites

Your screenshot shows the name as QRcodeFrame with the "c" being lowercase. In all the examples of code it is uppercase. The frame names are case sensitive.

Good eye, but that's not true. The frame names are NOT case sensitive.

 

Reminder, could you attach the template for us to look at?

Link to comment
Share on other sites

Is the frame on an Overflow or Template page? The FindTextFrame and FindGraphicFrame functions can find frames only on Body pages currently.

 

Dan,

It is on a Template Page. It is one of 22 pages that are like this that get inserted into a Body Layout. Is there another way to make the graphic frame on a Template page suppress?

Link to comment
Share on other sites

Dan,

It is on a Template Page. It is one of 22 pages that are like this that get inserted into a Body Layout. Is there another way to make the graphic frame on a Template page suppress?

Okay, mystery solved. We do have an enhancement for an upcoming release so that FindTextFrame and FindGraphicFrame will find frames on Template and Overflow pages. However, the current released versions do not support this. You can only find frames on Body pages, as the comments for these functions in the Building Blocks dialog note.

 

I would just create an alternate version of the Template page (the reusable component) that doesn't include the graphic frame, and conditionally output that one instead as appropriate. Or, add a second text frame to the template at a higher layer than the graphic frame, so that the text doesn't wrap around it, and populate the text in there instead.

Link to comment
Share on other sites

Dan,

I am trying to add a second text frame above the QR Code and the text frame that wraps around it. However, it won't suppress the wrapping text frame when I write the rule for it.

 

//Returns Text Frame if QR Code is not present

 

if (Field("QRCode") == "")

{

var textwrap = ("TOC-1-Front-Agent");

textwrap.suppress = true;

return ("TextNoQR");

}

 

Despite it validating that only the top text frame will appear (TextNoQR), both text frames are populated and it looks like a really bold line of text. Any ideas?

Link to comment
Share on other sites

Dan,

I am trying to add a second text frame above the QR Code and the text frame that wraps around it. However, it won't suppress the wrapping text frame when I write the rule for it.

 

//Returns Text Frame if QR Code is not present

 

if (Field("QRCode") == "")

{

var textwrap = ("TOC-1-Front-Agent");

textwrap.suppress = true;

return ("TextNoQR");

}

 

Despite it validating that only the top text frame will appear (TextNoQR), both text frames are populated and it looks like a really bold line of text. Any ideas?

What are you expecting these two lines of code to do?

var textwrap = ("TOC-1-Front-Agent");
textwrap.suppress = true;

You need to call the FindTextFrame or FindGraphicFrame function to return an object which has a "suppress" property. So I think you want to do this:

var textwrap = FindTextFrame("TOC-1-Front-Agent");
textwrap.suppress = true;

Also, modifying the properties of frames works only in OnRecordStart, not in regular, non-callback rules.

 

And again, it works only for Body page frames.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...