Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Refresh data in iframe

Questions related to using nuBuilder Forte.
Post Reply
frank
Posts: 3
Joined: Sat Oct 19, 2019 5:01 pm

Refresh data in iframe

Unread post by frank »

I have a launch form where te user can select with some dropdown boxes the year and month of a period.
The year and month are concatenated to a string like "2019-10" and put in a hidden box on the form with id afs_jrmnd.
Inside the form is an iframe with a browse form with multiple records for each period of a month. The name of the hidden box is set as the filter (#afs_jrmnd#) for the iframe.
I would like to refresh the data in the iframe whenever the user changes the month or year of the period, so that only the data of the selected period is shown.
How can I invoke the refresh of the iframe from the JavaScript attached to an onchange event of the hidden text box?
kev1n
nuBuilder Team
Posts: 4307
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 448 times
Contact:

Re: Refresh data in iframe

Unread post by kev1n »

Hi,

Add an onchange event to your hidden box afs_jrmnd and call nuSearchAction(1); to to refresh the browse form.
Last edited by kev1n on Sat Oct 26, 2019 9:52 am, edited 1 time in total.
frank
Posts: 3
Joined: Sat Oct 19, 2019 5:01 pm

Re: Refresh data in iframe

Unread post by frank »

Thanks for your quick reply, but unfortunately it also seems to refresh the container launch form and the values in the dropdown boxes are cleared.
kev1n
nuBuilder Team
Posts: 4307
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 448 times
Contact:

Re: Refresh data in iframe

Unread post by kev1n »

Try this:

Code: Select all

$("#id_of_run_object")[0].contentWindow.nuGetBreadcrumb(0);
Replace id_of_run_object with the id of your run object.
frank
Posts: 3
Joined: Sat Oct 19, 2019 5:01 pm

Re: Refresh data in iframe

Unread post by frank »

Wow. It works. This is magic. :D
Thanks a lot.
Post Reply