Page 1 of 1

Modal View (again!)

Posted: 2021-01-22 15:22
by ckebbell
Hi Jan

Sorry to bother you with this. I still can't get my buttons to work in the child modal view since the Firefox upgrade.

I am using the Helper Library to create buttons in a "tablename-dv.js" file with the code below (which worked perfectly in Firefox v81!)

Code: Select all

//var dv = new AppGiniDetailView();
var actionbuttons = dv.actionbuttons;
var group = actionbuttons.addGroup("Accounts");

group.addButton("Create PO", function () {
	var selectedID = $j('input[name=SelectedID]').val();
	var supplierid = $j('#supplier').val();
	var jobid = $j('#jobid').val();
	var url_open = 'POrder.php?jobid=';
	window.open(url_open + jobid + '&supplierid=' + supplierid + '&jobitemid=' + selectedID + '&clear_session=1');
});
This no longer opens the url from the child modal view of the record, i.e. where I have the parent record open and am adding child records (the button url points to a PHPWord processing file).

I have to now go the relevant child table, open each individual child record in Detail view and click on the buttons from there (instead of just opening each child record in modal view from the parent record, as I used to do).

I thought it might be the "var selectedID" as Firefox is perhaps not reading the selectedID from the modal?

I was hoping you might have a quick fix for this, as I have no idea what has gone wrong!

Thank you for any pointers you can give me and have a lovely weekend :D

Re: Modal View (again!)

Posted: 2021-01-22 15:58
by jsetzer
Please, first of all, tell me if there is a problem with display of custom AppGini Helper (action-) buttons or if there is a problem with your code.

I recommend adding more console.log() lines for narrowing down which line of your code does not evaluate correctly. Also, debugger; command can help you debugging line by line in dev tools of your browser

Re: Modal View (again!)

Posted: 2021-01-22 16:01
by jsetzer
Concat the url into a separate variable and validate the value.

Instead of window.open function you can try window.location.href property which I am using for redirecting. From my experience the href property is compatible with different browsers.

Re: Modal View (again!)

Posted: 2021-01-22 16:53
by ckebbell
Hi Jan

The buttons display, but they just open a blank tab rather than the Word document. I will try the .href over the weekend, and will also see if I can narrow down the section that does not work (from prior experience, the debug tools in firefox did not show anything, but I will have a try!)

Thank you for your swift response :)