Media fields

I have a several fields on a form that can be edit in a review process. The previous values are saved in another table for historical value. When a field is edited I have a media field that is set with a image, as a visual que that that field has been edited.

Here is the problem. The images don’t alway render correctly. The image is 20X20 and the media field is 20X20. Sometimes when I move off the record and return these flag images become distorted (streched out). This happens randomly and not to all the flag images. If I toggle between records, images that were distorted, render correctly and formally correct images render incorrectly. If I toggle between records 5 or 6 times then all the images will render correctly,(once). Does anyone know what I can do to correct this.

One other thing. I set the flag media field form an image from an images table. Is there a better way to do this.

I still very new to Servoy

Thanks in advance.

I fixed the issue by increasing the field size to 23X23 up from 20X20

It sounds like you could fix it also by setting the margin to 0,0,0,0.

Hope this helps.

Hi aalonzo,

First of all welcome to the Servoy family :slight_smile:

aalonzo:
One other thing. I set the flag media field form an image from an images table. Is there a better way to do this.

When those flag images are such an intricate part of the solution I suggest you import them as media into the solution.
After that you can use an (unstored) calculation fields like this:

if ( valueChangedFlag )
{
    return "media:///nameOfImportedMedia.ext";
} else {
   return null;
}

When you don’t want the images to be part of the solution but in a separate table like you have now I suggest you use the blob-loader approach. This is more efficient then just linking directly to a BLOB column because it uses a cache. (less heavy queries)

if ( valueChangedFlag )
{
    return "media:///servoy_blobloader?servername=myNamedServerConnection&tablename=myTableName&dataprovider=myColumnName&rowid=myRowID";
} else {
   return null;
}

Make sure that in both approaches you set the calculation to type Media.
Hope this helps.