Jump to content

Show/Hide Rule for Text Frame


tbone56

Recommended Posts

Can somone tell me how to get a Text Frame to be shown or hidden based off of a value in the data sheet?

 

For instance: if the value was "On" then the Text "This is what is in my text frame" would appear. Vice versa.

 

I have seen the text switch rule but the text in my frame is formatted a cerain way and not just straight text.

 

 

Thanks ahead of time.

Edited by tbone56
Link to comment
Share on other sites

If you want to hide the entire text frame, just do this in OnRecordStart:

FindTextFrame("YourTextFrameName").suppress = true;

Or, if you only want to suppress some specific text, put it in a Formatted Text Resource and apply any formatting you want to it, then have a rule (either JavaScript, Switch Wizard, or Drag-and-Drop Wizard) which conditionally returns either that resource or an empty string.

 

Of course, you can always apply the formatting through tags as well, something like this:

return '<f name="Arial"><z newsize=20><color name="Red">This is what is in my text frame';

You can also apply formatting in the Drag-and-Drop Rule Wizard.

 

So there are lots of ways to accomplish this; you can pick whichever one is right for you.

Link to comment
Share on other sites

  • 2 years later...

FindTextFrame("YourTextFrameName").suppress = true;

 

Am I missing something? I did this and it works but to show the text frame I have to physically write "false". I'm trying to make it a yes/no radio button the user selects.

 

Also, what is the best method of making the text or text frames flow, so if I hide one text frame the other moves up or down and not leave a gap?

Link to comment
Share on other sites

FindTextFrame("YourTextFrameName").suppress = true;

 

Am I missing something? I did this and it works but to show the text frame I have to physically write "false". I'm trying to make it a yes/no radio button the user selects.

Right, if you say "true", then the frame is suppressed. If you say "false", then the frame is NOT suppressed.

 

Although you can specify any value that evaluates to a Boolean (true or false).

Also, what is the best method of making the text or text frames flow, so if I hide one text frame the other moves up or down and not leave a gap?

If you want to do that, you don't need to suppress any frames at all. Just have a rule which returns either the first part of the text, or nothing at all, and insert that rule into the text frame, above any other text. If the rule returns nothing, the rest of the text will "move up" to the start of the frame.

Link to comment
Share on other sites

  • 5 months later...

I was reviewing this thread and having the similar issue. Can someone further explain how to make your text frames will "move up"?

If you want to do that, you don't need to suppress any frames at all. Just have a rule which returns either the first part of the text, or nothing at all, and insert that rule into the text frame, above any other text. If the rule returns nothing, the rest of the text will "move up" to the start of the frame.

 

I have a highly variable form that needs to move up when data fields are left empty.

Link to comment
Share on other sites

I was reviewing this thread and having the similar issue. Can someone further explain how to make your text frames will "move up"?

FusionPro does not support "flex" (as you named it in a separate thread). Instead, you would put all your text in a single frame, but generate the contents of the frame with a rule which builds the contents and returns only what is needed to display. If 'name' does not have a value, the rule could ignore it (and any associated static text) and begin contents with 'address'.

 

In 8.x you have the ability to change frame position via JavaScript which might work to suppress/move related frames. I'm not sure that's applicable or worth the time in your scenario though.

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...