Need to pass ID to a page with AppGini Helper Library

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
stefdefrance
Posts: 17
Joined: 2014-12-05 18:34

Need to pass ID to a page with AppGini Helper Library

Post by stefdefrance » 2025-04-10 19:29

Hello from France,

I am using the AppGini Helper JavaScript Library. I have integrated a button into a DetailView page to link to a page located in the templates folder.

My page uses the same structure as the print page of a DetailView page

The link works very well and I am very happy...
Now I need to pass the ID of the DetailView to display the variables as if I were using the Print Preview button.

My code :

Code: Select all

// Bouton supplémentaire
var dv = AppGiniHelper.DV;
var actionbuttons = dv.actionbuttons;
var group = actionbuttons.addGroup("Edition documents");
group.addLink("Demande infos DDFIP", "/templates/SATD_templatesDVP.html");
Could someone please help me?

stefdefrance
Posts: 17
Joined: 2014-12-05 18:34

Re: Need to pass ID to a page with AppGini Helper Library

Post by stefdefrance » 2025-04-10 20:31

When I read Bizzworxx blog I understand that to get de ID and pass it but I don't know where to put it in the code :

Code: Select all

var id = dv.getSelectedId();
var href = "calculations_tree.php?SelectedID=" + id;

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

Re: Need to pass ID to a page with AppGini Helper Library

Post by jsetzer » 2025-04-11 06:39

I need to pass the ID of the DetailView
Just append additional parameters to the URL

Code: Select all

// file: hooks/TABLENAME-dv.js
var dv = AppGiniHelper.DV;
var group = dv.actionbuttons.addGroup("Edition documents");
var id = dv.getSelectedId();
var href = 'YOUR_VALID_PATH/YOUR_SCRIPT.php?SelectedID=' + id; // HERE!
group.addLink('Your Button Caption', href);
If there are more parameters append each with &name=value, vor example:

Code: Select all

var href = 'YOUR_VALID_PATH/YOUR_SCRIPT.php?SelectedID=' + id + '&another_arg=123' + '&one_more_arg=abc';
---
[...] as if I were using the Print Preview button.
Now your script will receive the parameter named SelectedID. Next you need to know or to learn how to read and work with parameters in your own pages or scripts. But that's a completely different story.
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 25.10 + all AppGini Helper tools

stefdefrance
Posts: 17
Joined: 2014-12-05 18:34

Re: Need to pass ID to a page with AppGini Helper Library

Post by stefdefrance » 2025-05-05 12:56

Hello, I am sorry for the delay in response but I was traveling very, very far away.
I will try this method... All my attempts have failed!
Thank you again for the excellent work you do, dear German neighbor!
Best regards

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

Re: Need to pass ID to a page with AppGini Helper Library

Post by jsetzer » 2025-05-05 15:12

Thanks for your response and good luck, dear European friend!
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 25.10 + all AppGini Helper tools

Post Reply