Refresh Issue with Grid Image Column

PlatinumGrid - Full version

Refresh Issue with Grid Image Column

Postby garymwilson67 on Fri Jun 02, 2017 8:00 am

Hi,

I have a grid with a column as below:
===========================================
$imageStepExpColumn = new JTPlatinumGridImageColumn( $this->imageGrid );
$imageStepExpColumn->Caption = 'Expected Screenshot';
$imageStepExpColumn->DataType = FileName;
$imageStepExpColumn->DataField = 'rs_step_exp_screen';
$imageStepExpColumn->FileNameFormat = $screenshot_diry . '{FILENAME}-exp.png';
$imageStepExpColumn->Name = 'istepExpColumn';
$imageStepExpColumn->CanEdit = false;
$imageStepExpColumn->Width = 250;
$imageStepExpColumn->VerticalAlignment = 'agTop';
======================================

The $screenshot_diry variable is defined at the top:
========================================
<?php
$_SESSION = array();
session_start();
if (!isset($_SESSION['authorised']))
{
header("Location: invalid_login.php");
exit();
}

set_include_path( "." );

require_once('../../grid_v12/vcl/platinumgrid/lib/Spreadsheet_Excel_Writer.php');
require_once('../../grid_v12/grid.inc.php');

use_unit( 'components4phpfull/jttoolbar.inc.php' );

include_once("../../php/functions.php");
include_once("../../php/connection.php");

$num_rows=0;
$num=rand(1, 1000);

$test_set_id = $_GET['test_set_id'];
$test_set_name= $_GET['test_set_name'];
$release_id = $_GET['release_id'];
$release_name= $_GET['release_name'];

if (substr(php_uname(), 0, 7) == "Windows")
{
$screenshot_diry = "..\\..\\selenium_scripts\\Release_" . $release_id . "_" . $release_name . "\\TestSet_" . $test_set_id . "_" . $test_set_name . "\\Screenshots\\";
}
else
{
$screenshot_diry = "../../selenium_scripts/Release_" . $release_id . "_" . $release_name . "/TestSet_" . $test_set_id . "_" . $test_set_name . "/Screenshots/";
}
========================================
I pass this global variable into the function that defines the grid above.

The issue I get is that if I view some screenshots belonging to one screenshot directory (e.g. Release 5, test set 4) it works fine. If I then open the grid with slightly different values (e.g. Release 5, test set 5), I can echo the variable and see it changing to point to the right screenshot directory but the screenshots are not displayed in the detailed grid. It seems that the FileNameFormat attribute is not being updated. I even force a browser refresh and reload the frame. Nothing seems to help.

Thanks

Gary
garymwilson67
 
Posts: 19
Joined: Fri Apr 01, 2016 3:15 pm

Re: Refresh Issue with Grid Image Column

Postby jomitech on Fri Jun 09, 2017 8:12 am

Make sure that you sent the FileNameFormat on the column after the call to init(). init() pulls the values back out of the session, and will override the default values, so you need to set it after init().
Jon
jomitech
Site Admin
 
Posts: 1889
Joined: Wed Oct 08, 2008 12:23 am

Re: Refresh Issue with Grid Image Column

Postby garymwilson67 on Sun Jun 11, 2017 4:36 pm

Thanks Jon. That's sorted it.

Excellent !!! :D
garymwilson67
 
Posts: 19
Joined: Fri Apr 01, 2016 3:15 pm


Return to General

cron