Update List Event -> back to TABLE 2 (edit event).Hope that makes sense.Any help is much appreciated.Kind Regards"> Pass parameter to different events - Forums

Forums

Pass parameter to different events

ctrlmedia 26 Apr, 2017
Hi,
I was wondering how I would keep a parameter which needs to be passed to an event which then redirects (after save) to another event.

I have a table of records. (TABLE 1) You can click on view which takes the user to the "EDIT" event based on the ID parameter.

In the "EDIT" event you can see a table of records linked to the ID parameter.(TABLE 2) You can edit a field within that table and click "update" to save the updates. This sends you to "update_list" event which saves the changes and then redirects you back to TABLE 2 ("EDIT" event ) where I want to see the same records based on the same ID parameter.

So I need to pass the ID parameter between TABLE 2 (edit event) -> Update List Event -> back to TABLE 2 (edit event).

Hope that makes sense.
Any help is much appreciated.
Kind Regards
GreyHead 26 Apr, 2017
Hi ctrlmedia,

Typically you can do this in two ways.

+ add the ID into a hidden input in the Edit form and then add it to the redirect link, or

+ save it to the user session and retrieve it from there when needed. You need to be a little careful with the house-keeping here and delete the value from the session when it is no longer needed.

Bob
ctrlmedia 26 Apr, 2017
Hi Bob,
Thanks for your quick reply.
How do I add it to the redirect link?
It currently looks like this:

{redirect:edit}

Regards
GreyHead 26 Apr, 2017
Hi ctrlmedia,

Sorry, No idea - I'm still finding out how v6 works :-( I guess you can add a manual URL somehow

Bob
ctrlmedia 26 Apr, 2017
Hi Bob,
I have worked out that I can pass the parameter just using the Toolbar Button that I was using. But I still cant work out how to add it to the redirect without having to do it manually.

Thanks for your help.
Regards
ctrlmedia 26 Apr, 2017
1 Likes
Hi,
Just in case people want to know how to pass the parameter within a redirect you can do this:

{redirect:edit:id={data:id}}


Regards
Max_admin 26 Apr, 2017
Answer
1 Likes
Hi ctrlmedia,

Adding nested shortcodes is not supported, at least for now, you better create a redirect function and call it instead, you can then add your parameter in the redirect url in the redirect function.

Best regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
ctrlmedia 27 Apr, 2017
Hi Max,
The nested shortcode does actually work, possibly better than the redirect function for some people. The page seems to not refresh when using the nested shortcode so it looks very quick.

In my instance I needed the page to refresh so that the records re-order themselves on re-load.

So actually your answer works better for me!
Thanks
Regards
This topic is locked and no more replies can be posted.