Displaying Photos Taken In Mobile Sample Contacts Solution

Home for older / inactive topics

Displaying Photos Taken In Mobile Sample Contacts Solution

Postby anil » Tue Oct 22, 2013 4:41 pm

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
anil
 
Posts: 22
Joined: Tue Jul 17, 2012 11:42 am

Re: Displaying Photos Taken In Mobile Sample Contacts Soluti

Postby anil » Wed Oct 23, 2013 2:41 pm

Hi Guys,


Nobody able to help at all?


Thanks


Anil
anil
 
Posts: 22
Joined: Tue Jul 17, 2012 11:42 am

Re: Displaying Photos Taken In Mobile Sample Contacts Soluti

Postby anil » Thu Oct 24, 2013 10:52 pm

Hi,

There must be someone who could possibly help.

Would be so grateful.

Thanks
anil
 
Posts: 22
Joined: Tue Jul 17, 2012 11:42 am

Re: Displaying Photos Taken In Mobile Sample Contacts Soluti

Postby paronne » Fri Oct 25, 2013 12:03 pm

Hi Anil,

in the backend solution you can display the image in a HTML area in the same way you do it in the mobile solution.
you just need an <img > element which will contain the text

var html = ' <html> <img id="imageURI" height="300" width="100%" src="data:image/jpeg;base64,' + foundset.contact_notes + ' "> </html>'

the html var will be the dataprovider for your HTML area


In the latest release of Servoy, 7.3, is also possible to transfer High Quality pictures to the application server in binary format; Using phonegap FileTransfer on mobile and the the multipart POST in the ws_create server-side
paronne
 
Posts: 202
Joined: Fri Nov 02, 2012 3:21 pm

Re: Displaying Photos Taken In Mobile Sample Contacts Soluti

Postby anil » Wed Oct 30, 2013 5:00 pm

Hi Paronne,


Thanks for the pointer - I tried it and it works for the MOBILE CLIENT ONLY. On the Smart Client the photo is not displayed - any ideas?

With reference to the latest release of Servoy 7.3 where you state that it 'is also possible to transfer High Quality pictures to the application server in binary format; Using phonegap FileTransfer on mobile and the the multipart POST in the ws_create server-side', I couldn't find any references to that on the Wiki.

Anyone have any ideas why the Smart Client would not work?


Anil
anil
 
Posts: 22
Joined: Tue Jul 17, 2012 11:42 am


Return to Archive

Who is online

Users browsing this forum: No registered users and 1 guest

cron