This topic is locked
[SOLVED]

Custom Button to grab current tab

12/9/2022 2:16:00 PM
PHPRunner Tips and Tricks
L
leon author

Hi,

I have a custom button that redirects to another page.

The Tab Id's on both forms are exactly the same. I am trying to open the other page on the same tab as the page I am redirecting from.

I can manage this from the events section with the following code but have no idea how to get the same result with a button.

$tab = $pageObject->getCurrentTabId();
header("Location: docs_list.php?".$tab);

ANY advice would be greatly appreciated.

Leon.

admin 12/9/2022

With buttons you need to use Jabascript in order to perform redirects.

Check Inserting button article in the manual.

My guess is that you need to get the Tab ID in the Server event, pass it to Client After event and then perform the redirect in ClientAfter event.