Solved TD-21776: SalGridSetCellPicture doesn't work properly

Report TD 5.x and 6.x bugs and possible workarounds.
Nicolas D
France
Posts: 100
Joined: 25 Jun 2018, 12:24
Location: St Pierre, France

TD-21776: SalGridSetCellPicture doesn't work properly

Post by Nicolas D » 12 Nov 2012, 12:04

Hello,
I try to use the grid to change pictures in cells
(the goal is to click on a cell to set it read/unread)
So
1) I use SalGridSetCellPicture to put a green icon in the cell, ok

Code: Select all

Call SalGridSetCellPicture(grid1,GRIDAREA_Cell, grid1.col2, SalTblQueryContext( grid1 ), CellProp_Image_Header,pic2)
2) then I use SalGridSetCellPicture to change the cell picture by a blue icon when the user click on it but all the cells in the grid are updated !

Please Note that If I don't do 1) (don't put the first icon) that works: only the cell of the row selected is udpated

Please run the sample attached and click on the SalTblInsertRow button
Image

then click i.e on the Read cell in the second row: all rows are updated
Image

then click on the SalTblPopulate button: the grid is populated but SalGridSetCellPicture in the SAM_FetchRowDone doesn't work anymore and the icon stay blue
Image

Regards
You do not have the required permissions to view the files attached to this post.

Mike Vandine

Re: TD-21776: SalGridSetCellPicture doesn't work properly

Post by Mike Vandine » 29 Nov 2012, 04:35

Hi Nicolas,

Not a very good testcase! I don't have your database that the application uses.

Try again with a testcase that connects to the ISLAND database.

Thanks!

Nicolas D
France
Posts: 100
Joined: 25 Jun 2018, 12:24
Location: St Pierre, France

Re: TD-21776: SalGridSetCellPicture doesn't work properly

Post by Nicolas D » 12 Dec 2012, 06:18

Not a very good test case ?
What a good will !
You just have to replace LOCAL1 by ISLAND and CIMADM by SYSADM
As I do every times with your samples since the beginning because I don't use sqlbase
Thanks for all your efforts

satyavangala
United States of America
Posts: 37
Joined: 24 Sep 2017, 17:25
Location: Chantilly, virginia usa

Re: TD-21776: SalGridSetCellPicture doesn't work properly

Post by satyavangala » 19 Feb 2015, 17:45

Has this been resolved? I'm having problems with cell instances in 6.2 and the behaviour is similar to this.

Thanks,
Satya

VEspinal

Re: TD-21776: SalGridSetCellPicture doesn't work properly

Post by VEspinal » 20 Feb 2015, 23:32

Hi Satya:

Just to let you know that I was able to reproduce the issue and I've logged a defect: TD-21776: SalGridSetCellPicture function doesn't work properly.

We will keep you posted on any updates.

Thanks,
Victor Espinal

satyavangala
United States of America
Posts: 37
Joined: 24 Sep 2017, 17:25
Location: Chantilly, virginia usa

Re: TD-21776: SalGridSetCellPicture doesn't work properly

Post by satyavangala » 21 Feb 2015, 16:15

Thanks for the update. Looks like there are problems with several runtime calls to column instances ( cells). This is not limited to just setting picture. As I stated in my other post, I can create a class based on column and add a property called - bEnable. I wanted to use that to set the appropriate pictuer. What I found was that setting the bVisible during row insert, sets the bVisible to all cells of the column. This pretty much makes Button Type cells not usable. If we can't control the behaviour during runtime like enabling/disabling etc at a row/cell level, it is better to go with the old approach - setup button on the toolbar or somewhere and enable/disable using the grid's rowclick event. We were hoping to take advantage of the Button Type cells to crate modern looking grids. While we really like the feature, we just can't use until we know what happens behind the scenes.
1) Does Gupta create a new instance of the Column class for each cell?
2) If a custom class is created for the column, how do we set the instance variables? If we set during row insert, all cells are getting changed
3) Are there any undocumented functions that we can use to tap into the base class values - Any SAM_Messages?

Since several users have been trying to use these new cell controls, I really appreciate if someone can answer the questions. We do not need a solution or fix right now. Additional clarification on how this works. Normally, this would be added to the help file. There isn't much in the help file.
BTW - dlgCustomizer from the sample apps is really useful. It demonstates all the new grid cell controls and their attributes settings well. In fact, I used that app to discover the problem.

Regards,
Satya

User avatar
markus.essmayr
Austria
Posts: 892
Joined: 06 Mar 2017, 06:07
Location: Austria

Re: TD-21776: SalGridSetCellPicture doesn't work properly

Post by markus.essmayr » 24 Feb 2015, 08:08

Hi,

please always upload your images directly to the forum.
I'm not allowed to access www.hostingpics.net through our proxy and thus cannot see them at all! :(

Thank you!

Max
Markus Eßmayr
teamdeveloper@t-mx.com

frevelundfey

Re: TD-21776: SalGridSetCellPicture doesn't work properly

Post by frevelundfey » 24 Feb 2015, 11:32

Hi,
of course this is a bug.
But there is also a workaround:

When using images from Resource-Section (with the "hidden" constant CellProp_Image_HeaderFromRes)
you can switch cell-images individually.
You will not find this constant in the help-file.
(Shame on you Gupta - this is just one of hundreds of flaws there).

Sample is in the attachment.

Regards Thomas
You do not have the required permissions to view the files attached to this post.

frevelundfey

Re: TD-21776: SalGridSetCellPicture doesn't work properly

Post by frevelundfey » 24 Feb 2015, 11:37

satyavangala wrote:...As I stated in my other post, I can create a class based on column and add a property called - bEnable. I wanted to use that to set the appropriate pictuer. What I found was that setting the bVisible during row insert, sets the bVisible to all cells of the column...
Hi Satya,

you must not use a bEnable-variable on column level.
Instead you should use an additional hidden column which stores the state of your button.
Only then you are able to store information on cell-level.

Regards Thomas

satyavangala
United States of America
Posts: 37
Joined: 24 Sep 2017, 17:25
Location: Chantilly, virginia usa

Re: TD-21776: SalGridSetCellPicture doesn't work properly

Post by satyavangala » 24 Feb 2015, 18:07

Max,

I think you are referring to the pictures shown in the original posting by Nocolas. I had the same problem and I used the file he attached to test the issue. As you can read in my post, issue is bigger than just setting pictures. You can eitehr check the code I posted or create a Column Class with some instance variables and try to change those values for each cell as rows are inserted. What I found was that instances of the column class aren't created. Those instace variables are acting like class variables. So, whatever value is set during the last row insert is being applied to all cells in the column. I was trying to find out how Gupta intenally creates Column Class instances for each cell and haven't seen any reply yet. If you do know and would like to share, I really appreciate it. I just don't wan to setup buttons either on the toolbar of a Grid Window or somewhere. Want to create columns using button type and enable/disable them based on the other values in a row. Just cant' do it. May be there is a trick or hidden method that I'm missing. I'm sure someone is using buttons on the grid as I want to use.

Regards,
Satya

satyavangala
United States of America
Posts: 37
Joined: 24 Sep 2017, 17:25
Location: Chantilly, virginia usa

Re: TD-21776: SalGridSetCellPicture doesn't work properly

Post by satyavangala » 24 Feb 2015, 22:13

Thomas,

Thanks a million for the reply. Could you please let me know the number for CellProp_Image_HeaderFromRes? When I compile the sample, it is complaining that the constant could not be found. Regarding the other suggestion to use hidden column(s) instead of the column classe's instance variables, we do that now and it works well. We have several base classes for the columns, tables etc and were trying to add one for the button type column and move the logic to class. Looks like we have to wait for a while before we can implement it. For now, we are going with the curent design which displays button on teh grid's toolbar. However, with the trick you just provided, we should be able to move some to the cells and switch text and images on the fly. Actual click event decides what to do anyway.

Once again, I appreciate your help.

Regards,
Satya

User avatar
markus.essmayr
Austria
Posts: 892
Joined: 06 Mar 2017, 06:07
Location: Austria

Re: TD-21776: SalGridSetCellPicture doesn't work properly

Post by markus.essmayr » 25 Feb 2015, 07:47

Satya,

thanks for your answer.
Yes, I can read your post. :)

What I mean is more generally, because external images are always problematic:
  • If hosted on blocked providers, especially viewers in corporate networks cannot see them.
  • If the external images are removed, the forum entry is "damaged" forever.
  • If the link to the images break, the forum entry is also damaged.
  • The images are not contained in any backup of the forum and thus are not restorable.
As I currently don't have an ISLAND up and running, I have to prepare my environment first before I can have a look at this issue.
The images would have helped, to get a quick idea of it! :P

Max
Markus Eßmayr
teamdeveloper@t-mx.com

frevelundfey

Re: TD-21776: SalGridSetCellPicture doesn't work properly

Post by frevelundfey » 25 Feb 2015, 12:18

Hi Satya,
satyavangala wrote:Could you please let me know the number for CellProp_Image_HeaderFromRes? When I compile the sample, it is complaining that the constant could not be found.
CellProp_Image_HeaderFromRes = 73
But I didn't define it myself. TD6.2 SP2 can just compile it.

Regards Thomas

satyavangala
United States of America
Posts: 37
Joined: 24 Sep 2017, 17:25
Location: Chantilly, virginia usa

Re: TD-21776: SalGridSetCellPicture doesn't work properly

Post by satyavangala » 27 Feb 2015, 19:12

Thomas,

Thanks for the sample. I have SP2 installed on a different machine and it worked there. There must be some internal change that Gupta coded in SP2 that added/enabled the constant.

Thanks,
Satya

Return to “Bug Reports”

Who is online

Users browsing this forum: [Ccbot] and 6 guests