Hi all,
I’m trying to get a remote file and to put it into a media field.
In the detail I’m trying to put a file into a dataset but I think that an example explain better my scenario:
var _file = plugins.file.convertToRemoteJSFile('/myremoteImage.jpg')
var _dataset = databaseManager.createEmptyDataSet(0,0)
_dataset.addColumn('myid',1,JSColumn.INTEGER)
_dataset.addColumn('myimage',2,JSColumn.MEDIA)
_dataset.addRow(new Array(1,_file.getBytes()))
_dataset.setValue(1,2,_file.getBytes()) //I've tried to use this in add(I know that is useless because the previus line but I've put it to make me sure that the field was filled)
var _datasource = _dataset.createDataSource('mydatasource')
var _jForm = solutionModel.newForm('image_form',_datasource,'dmo_blue',false,640,420)
_jMediaObject = _jForm.newImageMedia('myimage',50,50,500,500)
Now if I try to put this new form into a tab,the field is blank
like in this screenshot:
[attachment=0]result screenshot.JPG[/attachment]
Here if I inspect the dataset before datasource creation:
[attachment=1]datasetContent before datasource creation .JPG[/attachment]
and after datasource creation
[attachment=2]datasetContent after datasource creation .JPG[/attachment]
Offcourse the remote image exist,is accessible in read/write mode and in any other way I’m able to use it(with a design form).
We are talking about the smart client.
Thank you for your attention
Marco