Welcome to the nuBuilder Forums!

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

Open a browse or browseedit in iframe?

Questions related to using nuBuilder Forte.
Post Reply
n9yty
Posts: 47
Joined: Thu Oct 15, 2020 8:43 pm

Open a browse or browseedit in iframe?

Unread post by n9yty »

I've tried to search, this is the closest I came, but it is even from v3:

https://forums.nubuilder.cloud/viewtopic. ... ame#p13417

For my legacy DB project, they have used a pattern where there are many tables of 1:N records in various formats. I thought it would be nice to be able to have a tab with buttons for the various kinds of data, and when they click on one it would open an iframe with the browse or browseedit table for that type of data. Clicking on another button should close that iframe or replace it's contents with the newly selected data.

Is that possible?

Just so I'm not asking without trying . . . It seems like I could put a button on the form to run some JavaScript that could get the record ID from nuGetProperty('record_id') and make a call to nuPopup('BrowseFormCode', record_id). However, I wonder if that would be trying to find that record in the table in the browse table which isn't right, I need it to show matching rows for the foreign_key using that record number so it shows matching rows, not a unique record.

While this seemed promising, I'm not sure it is the right directly, or at least not right in terms of passing in the record_id and getting the browse form to open with matching results.

Right now when I try that, I get a very small popup window, and when I doulbe-click the title to expand it the title is "null" and only a save button is on the form. I looked up the form_id in the DB tables and used that instead of the form code, and now the popup has the right title, but no indication that it has the right passed data, and still only a save button.

Can you all rescue me again? :)
n9yty
Posts: 47
Joined: Thu Oct 15, 2020 8:43 pm

Re: Open a browse or browseedit in iframe?

Unread post by n9yty »

Maybe this isn't the best way, but it seems to work...

Looking in PHP via nuHash() I saw that the id_code from the main record was in there. On the browse form I used the same BeforeBrowse PHP code to create a temporary table as in my last problem, referencing this #id_code# hash value to restrict it.

I also changed the JavaScript call to nuPopup to pass all three arguments with the last two being empty.

For some of these I only want a browse view, there is no more data, so I put this on that form in the JavaScript box:

function nuSelectBrowse(e){ };

That way they can not click on a row and attempt to get an edit screen.

I will test more, but this seems to be working.

Is there a better way?
kev1n
nuBuilder Team
Posts: 4307
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 448 times
Contact:

Re: Open a browse or browseedit in iframe?

Unread post by kev1n »

You could probably also use a Run Object (iframe), then use different (filter) buttons that set Hash Cookies and refresh the Browse with nuFilterRun()
https://wiki.nubuilder.cloud/ ... uFilterRun
Post Reply