Inserting a Reference Field with a theme or widget

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
TomM
New User
Posts: 6
Joined: Mon Nov 07, 2016 12:09 pm
First Name: Tom
Last Name: M
Company Name: Hal Leonard
Contact:

Inserting a Reference Field with a theme or widget

Post by TomM »

I want to insert a reference when a screen is converted using my custom theme.

For example, I want to insert the reference 'TTLPGM' into the tooltip property of an element when I am converting a screen.

If I just do:

Code: Select all

item["tool tip"] = "TTLPGM";
It just changes the tooltip to the plain text: "TTLPGM" as I would expect.

How do I tell the theme that I want this to use a referenced field?


Thanks
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Inserting a Reference Field with a theme or widget

Post by Scott Klement »

Do you mean that you want the "tool tip" property to be bound to a character field? If so, you'd do this:

Code: Select all

       item["tool tip"] = {
         dataType: "char",
         dataLength: "50",
         designValue: "[TTLPGM]",
         fieldName: "TTLPGM",
         formatting: "Text",
         trimLeading: "false",
         trimTrailing: "true"
       };
In this example, a character field, 50 chars long, will be created named TTLPGM that will be bound to the tool tip of the item. (I assume you know how to get the "item" var for the field you want to change, based on your message...) This bound field will be formatted as Text, and trailing blanks will be trimmed when the DDS variable is assigned to the tool tip.

The "designValue" property is what will display in the visual designer.

If by "reference" you mean that you're using a reference file (i.e. using the REF keyword, and want to pull the definition from the referenced file) then you do it very similarly, you just set the dataType to "reference", and do not specify the length.

Code: Select all

       item["tool tip"] = {
         dataType: "reference",
         designValue: "[TTLPGM]",
         fieldName: "TTLPGM",
         formatting: "Text",
         trimLeading: "false",
         trimTrailing: "true"
       };
Hope that helps
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests