Let's follow up this discussion at the Neptune Community

(this forum will be kept in read-only mode)
Solved

Camera Preview and Upload

Hello Neptune-Team,

first, let me say many thanks for your great work! This software greatly facilitates the development of mobile apps!


I have the following challanges:

- I want to use the camera on iPhone to take a picture and preview this picture. So I've included an image-object from sap.m and named it smallImage. According to my understanding should the onPhotoDataSuccess-function find this "object" and set image data (smallImage.src=...). Instead I get error "null ist not an object". So the document.getElementById(...) did not find my image-object. 

I also imported a Input-object and wrote the line "oInputImage.setValue("data:image/jpeg;base64," + imageData)" to function onPhototDataSuccess - no success!

Do I have to find object by getElement... or are the object known during runtime?


Next thing is, how do I send data to SAP? I've tried to bind smallImage.src to a string from my datamodel. Would this be the right way?


I'm looking forward for your help - Sven


Hi Sven,


Welcome to the Neptune forums and thank you very much for your kind words. :)


I see you are really close to the solution.   In Neptune Explored, you will find many app examples.  In the link below -> of how to take a picture and preview it:

https://template.neptune-software.com/neptune/sdk/explored.html#appEXP_SAMPLE_PLUGINS


How to send the data to SAP?

Using a string is perfectly fine.    Also in the example above, the image data is assigned to a string field which is sent to the back-end.


image



Please feel free to download the example and play with it on your system.    image


Have a nice day !  kind regards,


Julian







1 person likes this

Hello Julian,


thanks a lot for your help. Sometimes the solution is very easy, but we don't see it.

Works great!


kind regards - Sven

Hi Sven,


I am glad it works great !   We are here to help you ;)


Have a nice week, kind regards,

Julian

Login or Signup to post a comment