Hi everyone
Now as most who have read my posts will realise, I am a simple old soul. Well when I get to grips with something I then write a note for myself so I can remember how to do something in later months.
If there is somewhere better than this forum, then please let me know.
Here goes. - And it will be simple! I will give examples of code rather than just theory so that people like myself can just replace the example bits with thir own equivalents.
The Scenario
1) I needed to create a panel set with a menu and Content.
2) A parameter is passed to the panel set page when it is first opened.
3) Each state of the content panel needed this parameter in order to work.
Initial findings
1) The default content state opened correctly
2) Clicking any other menu item did not pass the parameter
3) Clicking the default state from the menu after visiting another content state did not pass the parameter.
4) Refreshing the page caused results that confused me (and I think the computer!!)
Solution to the problem
Note: When the Panel page is first accessed the parameter is received and the Default content state works. So the Parameter value is there in the first place.
1) Create a variable from the parameter
eg parameter looks like ?id=3826
parameter 'collected' as $_GET['id']
variable made using the following code at the beginning of the file
<?PHP
if (isset($_GET["id"])) {
$The_ID = $_GET["id"];
}
?>
2) This was then used as a parameter for each of the AJAX links in the menu.
<p align="center"><a id="<?php echo $ctrl->link_id() ?>" href="<?php
$ctrl->setParamValue("id", $The_ID);
echo $ctrl->link("Rooms", "For_Business");
?>">For Business</a></p>
Notes
This means that the Original Parameter is trapped within the Menu default state and clicking up and down the menu items always produces the required result.
Hope that this is of use.
Chris