Open a browse or browseedit in iframe?

Questions related to using nuBuilder Forte.

Open a browse or browseedit in iframe?

Postby n9yty » Wed Oct 21, 2020 12:20 pm

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

viewtopic.php?f=13&t=8674&p=13417&hilit=open+iframe#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: 39
Joined: Fri Oct 16, 2020 4:13 am

Re: Open a browse or browseedit in iframe?

Postby n9yty » Wed Oct 21, 2020 12:40 pm

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?
n9yty
 
Posts: 39
Joined: Fri Oct 16, 2020 4:13 am

Re: Open a browse or browseedit in iframe?

Postby kev1n » Wed Oct 21, 2020 1:33 pm

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.net/nubuilderfor ... uFilterRun
If you like nuBuilder, please leave a review on SourceForge

nuBuilder Code Library (82)
Installation Guides
Updating nuBuilder

Join Discord to talk about nuBuilder!
kev1n
 
Posts: 1084
Joined: Mon Oct 15, 2018 2:13 am


Return to General



cron