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
Conditional events?
-
- 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:
-
- 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?
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
--Bryan
-
- 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?
Let us know how that works out, Bryan. If it doesn't work, I have some other ideas we could try.
Who is online
Users browsing this forum: No registered users and 2 guests