Page 1 of 1

Program Progress

Posted: Wed May 09, 2012 12:16 pm
by ozrodz
Is there a way that every time the json data is loaded from the backend displaying a format, is there a way to automatically simulate a button click.

Re: Program Progress

Posted: Thu May 10, 2012 12:57 pm
by David
PUI does provide screen-level and global "load" events that can be used to call code on screen render, see here:

http://www.profoundlogic.com/docs/displ ... load+event

And here:

http://www.profoundlogic.com/docs/displ ... pui.onload

Also, an API is provided to simulate button clicks, see here:

http://www.profoundlogic.com/docs/displ ... %28+id+%29

Re: Program Progress

Posted: Thu May 10, 2012 4:26 pm
by ozrodz
David
Thanks for your reply.

I reviewed the links you provided in reference to the pui.onload, but the example from the link is very basic.

Not sure if you could provide an example of how to implement the pui.onload event when a format is displayed on the browser.

Re: Program Progress

Posted: Fri May 11, 2012 9:29 am
by David
Are you using Genie? Or not? I'm asking because the process is slightly different if you are running outside of Genie.

Let me know and I can explain how to implement the function.

Re: Program Progress

Posted: Fri May 11, 2012 5:00 pm
by ozrodz
No not using genie.

Re: Program Progress

Posted: Mon May 14, 2012 7:57 am
by David
Profound UI includes a facility for automatically loading JavaScript files onto the page. You can create a JavaScript file and place directory /www/profoundui/htdocs/profoundui/userdata/custom, or any sub-directory. You can create sub-directories if you want.

Profound UI will read through /custom and link any JS or CSS files onto the page.

You can implement the function in your file like this:

Code: Select all


pui.onload = function() {

}

PUI will call the function automatically each time a record format is rendered. Is this what you were looking for?

Re: Program Progress

Posted: Mon May 14, 2012 11:42 am
by ozrodz
that's pretty much what I was looking for. Is there a way to get the Id of a particular format.

For example if I have a program that has the following formats
fmt1
fmt2
fmt3

Is there a way to determine when fmt2 is loaded

Re: Program Progress

Posted: Mon May 14, 2012 12:02 pm
by David
Yes, the function can accept a parameter which has all this information, see here:

http://www.profoundlogic.com/docs/displ ... pui.onload

So, you could code it like this:

Code: Select all


pui.onload = function(info) {

  if (into.name == "FMT2") {

    // Do something.

  }

}