Hi,
I have got the Mobile Sample Contacts solution working fine on my mobile phone and it is takes photos and displays them fine on the mobile app.
The mobile solution uses a bean to display the photo and because the mobile solution does not yet handle media fields, the actual byte data is stored in a text field (UDM.Contacts.Contact_Notes).
I am now developing a back end for this solution. The standard servoy form does not have the same bean as the mobile solution so I am unable to just cut and paste the code from the mobile solution.
I am led to believe that I will need to use an HTML area but I do not know any HTML - I am sure that this is very trivial and really would appreciate some help.
I have seen references on the forum about using the Servoy Blob Loader but again I can not use this as the data is not stored in a blob - the mobile solution stores it in a text field.
I am sure it is just a matter of cutting and pasting some of the onLoad and onShow code from the mobile solution into the HTML area of the new standard back end form.
Here are the onLoad and onShow methods on the mobile solution.
function onLoad(event) {
elements.bean_photo.text = '<img id="image" height="300" width="100%" src="">'
elements.bean_URI.text = '<img id="imageURI" height="300" width="100%" src="">'
elements.bean_photo.visible = false;
}
function onShow(event){
var image = document.getElementById('image');
image.src = "";
elements.bean_photo.visible = false;
if(foundset.contact_notes && foundset.contact_notes.length > 50){
elements.bean_photo.visible = true;
image.src = "data:image/jpeg;base64," + foundset.contact_notes;
}
else
{
elements.bean_photo.visible = false;
}
}
function onPhotoDataSuccess(image64) {
var image = document.getElementById('image');
image.src = "data:image/jpeg;base64," + image64;
elements.bean_photo.visible = true;
foundset.contact_notes = image64;
}
Thanks in advance