Conditional behavior for the same field on the same screen?

Use this board to ask questions or have discussions with other Genie users.
Post Reply
rmarsh
Profound User
Posts: 56
Joined: Tue Jan 20, 2015 4:28 pm
First Name: Raymond
Last Name: Marsh
Company Name: Cracker Barrel Old Country Sto
Phone: 615-235-4215
Address 1: PO Box 787
City: Lebanon
State / Province: Tennessee
Zip / Postal Code: 37088
Country: United States
Contact:

Conditional behavior for the same field on the same screen?

Post by rmarsh »

I have a display screen for some 3rd party software that shows information on the intro screen then replaces that information with menu options on subsequent menus. I would like to modify this screen so that it behaves differently for the intro page than it does for the menu. The trouble is Genie identifies the fields as the same on all the screens. In reality they are probably the same and the software is just replacing the screen content.

My question is: Can I get Genie to show the same field as output for the intro screen and be a hyperlink with a .js for the menu screens without having to customize a bunch of different screens? If I identify the menu generically enough, Genie will treat them all the same way... I think.

Any suggestions?

Thank you.
User avatar
Alex
Profound Logic Staff Member
Posts: 233
Joined: Fri Jan 04, 2008 12:10 pm
First Name: Alex
Last Name: Roytman
Company Name: Profound Logic Software
Contact:

Re: Conditional behavior for the same field on the same screen?

Post by Alex »

You should be able to do this with some JavaScript on the onload event. You can test for content on the screen and based on that set any fields' properties.

For example:

Code: Select all

if (get("D_1_1") == "some value") {  // test for some value on the screen to determine if hyperlink transformation should occur
  applyProperty("D_3_3", "field type", "hyperlink");  // transform to hyperlink
  applyProperty("D_3_3", "onclick", "alert(''Clicked!)");  // attach onclick event
  // etc.
}
Of course, I am using generic id's and values in the code above. You will have to customize this to account for your requirements.

For more information on our JavaScript API, see here: http://www.profoundlogic.com/docs/displ ... +Reference
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests