Modal View (again!)

This sub-forum is for discussing all topics related to AppGini Helper JavaScript Library, provided by bizzworxx as a third-party AppGini plugin.
Post Reply
ckebbell
Veteran Member
Posts: 32
Joined: 2020-01-28 18:09

Modal View (again!)

Post by ckebbell » 2021-01-22 15:22

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

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Modal View (again!)

Post by jsetzer » 2021-01-22 15:58

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
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Modal View (again!)

Post by jsetzer » 2021-01-22 16:01

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.
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

ckebbell
Veteran Member
Posts: 32
Joined: 2020-01-28 18:09

Re: Modal View (again!)

Post by ckebbell » 2021-01-22 16:53

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 :)

Post Reply