Two or more cloud connector links in the same DBGrid
VictorUlloa, Thu Aug 15 2024, 10:49AM
Hi,
Scenario: I have a DBGrid I like to link to two applications, using two image fields, each with their own cloud connector.
One of them will link to a chart and the other to a grid (same data, different visualization).
But, when I add two image fields to the DBGrid and set the cloud connector properties, I got runtime errors regarding the first of them
I discovered that's by design: the dbgrid class generated PHP resets the cloudconnector property on each field initialization.
Code in myapp_grid_1.php:
[b] $this->cloudconnector=array();[/b]
$this->cloudconnector['enlace_grafica'][]= array('key'=>'composicion_fkCompuesto','value'=>'compuesto_pkCompuesto','datasource'=>'gpf_compuesto_datasource_1','islinked'=>'true');
$this->customfields['enlace_grafica'] = array('type'=>'ftImage','image'=>'','link'=>'chart_topalimentosuncompuesto.php','form'=>'','formcommand'=>'','initialformmode'=>'none');
// next line overwrites the first definition
[b] $this->cloudconnector=array();[/b]
$this->cloudconnector['enlace_cuadricula'][]= array('key'=>'composicion_fkCompuesto','value'=>'compuesto_pkCompuesto','datasource'=>'gpf_compuesto_datasource_1','islinked'=>'true');
$this->customfields['enlace_cuadricula'] = array('type'=>'ftImage','image'=>'','link'=>'ged_composicion.php','form'=>'','formcommand'=>'','initialformmode'=>'none');
I guess either there could be a warning when adding a second cloud connector in the IDE to prevent runtime error, or maybe DBGrid can support more than one cloud connector?
Meanwhile I'm combining the detail grid and chart apps in just one app, so I can use only one cloud connector in the "master" grid.
Regards,
Re: Two or more cloud connector links in the same DBGrid
administrator, Thu Aug 15 2024, 12:43PM
I think that using multiple links should be possible, and because of that, I'll report this as a bug/feature request.
Re: Two or more cloud connector links in the same DBGrid
VictorUlloa, Fri Oct 11 2024, 11:08AM
Hi,
I'm adding to ftimage fields to a grid, each one of them to act as an application link with a CLOUD_CONNECTOR.
The dbgrid_1.php code initializes the $this->cloudconnector for each one of them, so the first link is overwritten:
Only workaround is to manually edit the generated file and comment or remove the second initialization, like this:
// $this->cloudconnector=array();
Regards
Re: Two or more cloud connector links in the same DBGrid
administrator, Fri Oct 11 2024, 11:41AM
Thank you for your report, added to the buglist