Conditional events?

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
Bryan641
Profound User
Posts: 72
Joined: Fri Oct 01, 2010 5:07 pm
First Name: Bryan
Last Name: Leaman
Company Name: InVue Security
Phone: 704-752-6513 x221
Address 1: 15015 Lancaster Hwy
City: Charlotte
State / Province: North Carolina
Zip / Postal Code: 28277
Contact:

Conditional events?

Post by Bryan641 »

I have an application that generated JSON in a file on the IFS, then redisplays the screen. The file name is variable (based on user, job, etc). Provided the creation of the JSON file was successful, when the screen is redisplayed, I'd like to invoke a javascript function, passing in the file name as a parameter, so that function can load the JSON data and act on it.

However, it seems I cannot bind any display format or element events to a program field so that I could set it to "myfunction('filename.json')" for when the page is redisplayed.

I tried searching for ways to do this on the forum but came up empty. I tried placing <script>myfunction('filename.json');</script> in an html container, but apparently it doesn't execute javascript. Also, the amount of data (size of my json file) will exceed the maximum variable size on the display format. Otherwise I could load the data in an html or other container and invoke javascript to pull the field value and act on it.

--Bryan
Bryan641
Profound User
Posts: 72
Joined: Fri Oct 01, 2010 5:07 pm
First Name: Bryan
Last Name: Leaman
Company Name: InVue Security
Phone: 704-752-6513 x221
Address 1: 15015 Lancaster Hwy
City: Charlotte
State / Province: North Carolina
Zip / Postal Code: 28277
Contact:

Re: Conditional events?

Post by Bryan641 »

Oh, I think I figured out a way. I could put an output field on the screen with my JSON name, then give it an onload even handler that checks if the value isn't blank, and if not, run my function. I'll give that a try.

--Bryan
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: Conditional events?

Post by Scott Klement »

Let us know how that works out, Bryan. If it doesn't work, I have some other ideas we could try.
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests