PDA

View Full Version : cWebColumnImage



Tom Murphy
25-Mar-2014, 08:49 PM
Hi DAW

I am struggling with the image column a little. Is it possible to show an image from a table, i.e. a list of inventory items?

Harm Wibier
26-Mar-2014, 03:42 AM
Hi Tom,

That is possible and you need to use pbDynamic combined with OnDefineImages and AddImage. If pbDynamic is true the OnDefineImages will be triggered when a row is generated (the global buffers will hold the right record). You can then use the AddImage procedure passing the image URL to display an image in the cell. If the image is outside of AppHtml you can use the DownloadUrl function to generate a file streaming url.



// If the image is inside the virtual directory (AppHtml\Images\*.jpg)
Object oDynamicImageCol2 is a cWebColumnImage
Set piWidth to 20
Set pbDynamic to True
Set psCaption to "Icons"
Set pbServerOnClick to True

Procedure OnDefineImages
Forward Send OnDefineImages

Send AddImage ("Images/" + String(Invt.Item_ID) + ".jpg")
End_Procedure
End_Object

// If the image is outside of the virtual directory (C:\ProductImages\*.jpg)
Object oDynamicImageCol3 is a cWebColumnImage
Set piWidth to 20
Set pbDynamic to True
Set psCaption to "Icons"
Set pbServerOnClick to True

Procedure OnDefineImages
String sUrl

Forward Send OnDefineImages

Get DownloadURL of ghoWebResourceManager ("C:\ProductImages\" + String(Invt.Item_ID) + ".jpg") to sUrl

Send AddImage sUrl
End_Procedure
End_Object


Regards,

Tom Murphy
26-Mar-2014, 09:41 AM
Great thanks Harm ill give that a go.

Cheers
Tom

Sent from my GT-I9505 using Tapatalk

Tom Murphy
26-Mar-2014, 09:35 PM
Hi Harm

I think I have found a problem ...

I created a web view with a list of inventory items, and when I go in I click on the Description column to sort by Description.

When I am not showing the image column this is the top of the grid and the bottom.

7563 7564

When I show the image I get the following.

7565 7566

When I go to the bottom I am not seeing the last record - even though I can see the top of the next item, also the scrollbar thumb should be smaller. Is this a calculation problem with the row height, and that the new row height when displaying an image isn't being taken it account?

Also what sort of control do I have over the image size? Can I display it smaller than the actual size? Is this CSS?

Harm Wibier
28-Mar-2014, 09:17 AM
There are properties piImageHeight & piImageWidth on cWebColumnImage. It is adviced to make sure that all rows have the height.

Tom Murphy
29-Mar-2014, 06:40 AM
Hi Harm

Setting those properties had no impact though I am using Alpha 2 will install the Beta later and try again.

Tom Murphy
6-May-2014, 07:00 PM
Hi

It's showing the right number of rows.

But the Image Height doesn't appear to being honoured.

Cheers
Tom

FrankValcarcel
6-May-2014, 07:56 PM
I agree with Tom the height and width do nothing. I also have problems with displaying a grid full of images in that the scroll bars are flaky. I am in 18B1 was anything done that I should switch to B3? Would you like a sample?

FrankValcarcel
7-May-2014, 03:34 PM
bump

John van Houten
7-May-2014, 08:16 PM
Frank / Tom

I think Harm has uncovered an issue with piImageHeight and piImageWidth that he is working on.

regards John van Houten

FrankValcarcel
8-May-2014, 07:30 AM
Thanks for the update. I will wait with submitting the scrolling issue till then as it is probably related.

chuckatkinson
8-May-2014, 07:51 AM
I suspect scrolling issues you have may be related to a posting I made about changing the size of text on a row and the bottom rows are not visible?

FrankValcarcel
8-May-2014, 07:53 AM
It probably is, though with images I either get scrolling and a lot of blank space on the bottom, or no scrolling. JvH posted that Harm is working on the image height stuff....