tips on how to transfer values from PHP to Javascript? will there be a way to access the proxy from the custom button click PHP event? apparently in the PHP part of the click event of the custom button the following expression is not legal: $ pageObject-> setProxyValue ($ name, $ value) ... is a major lack of functionality ... don't you think?
IF $data array is available you can and should use it. A common mistake I saw is where developers try to access a field, but the field is excluded from the main query.
Ok! it's very intriguing but... what if you want hide or show a Custom Button depending on the value of one or more fields on the same record? Can PageObject help with one of its properties or methods?
@@PHPRunnerTipsAndTricks ok... but if I want decide wether hide or show based on some fileld values belonging in the same row/record of the custon_button may I use $data (or $rs). By an example : if ($data["Numero"]>=6) $pageObject->hideItem("button_prenota"); else $pageObject->showItem("button_prenota"); is correct? Thanks a lot!
@@amadiosacripanti5293 I think your button is in the grid. This will work in the "after record processed" event. Use $data. $row is an array representing a row on the page. If the field Numero is on the page, then you can use $row. But if the field is not on the page then use $data.
@@PHPRunnerTipsAndTricks Yes! custom buttom belongs into a grid row: further, in the grid as in the underlying database table there is an integer field named "Numero" (italian of Number in english...). So I would want see or not the button based on then "Numero" field value... as it was already clear I think. Thanks for patience and kind attention...
evidently there are several versions (overloads) of hideItem: with and without $ recordId. Does the version without $ recordId affect the whole page and that one with $recordId only on the current row (the one identified by $ recordId to be precise)? Either way, this code seems to work: function BeforeMoveNextList($data, $row, $record, $recordId, $pageObject) { // Place event code here. // Use "Add Action" button to add code snippets. if ($data["Numero"] >= 6) {$pageObject->hideItem("button_dosomething", $recordId);}; return true; } in event: List page: After record processed Version 10.2 pro