Hi,
I am trying to figure out to attach an image from my database to a label using the solution model.
During one of the webinars Bob Cusick said to use the blob loader to achieve this. I have tried several things but I still can’t seem to figure it out.
Here is my string for the blob loader:
“media:///servoy_blobloader?servername=testsvr&tablename=buttons&dataprovider=mainimage&rowid=1”;
I tried using a label on a form and setting it’s imageMedia to that path and it worked ok, so I think I have the string above ok.
It’s when setting the label I create on using the solution model that I get into trouble. I can create my new form fine, and create a new label but I either can’t get the image to show or it throws an error.
I have tried it so many different ways so this code may be way off.
var myForm = solutionModel.newForm('form1', 'tstsvr', 'buttons', tstsvr', false, 800, 600)
var btn1 = myForm.newLabel('Btn',200,21,100,100)
var btnimage = solutionModel.getMedia("media:///servoy_blobloader?servername=testsvr&tablename=buttons&dataprovider=mainimage&rowid=1")
btn1.imageMedia = btnimage
application.showFormInDialog('form1',-1,-1,-1,-1,'test',false,false,'test',true)
The form opens but the image is not shown
Thanks!