on 2019 Mar 07 8:26 AM
Hi,
Im building a fiori mobile application that captures a image from mobile camera the image uri is set to image tag using jsonmodel binding. but after binding the image tag gets blanked.
Below is the code :
_onOpenCamera : function(oEvent){
var options = {
quality: 20,
destinationType:
Camera.DestinationType.FILE_URI,
sourceType: Camera.PictureSourceType.CAMERA,
encodingType: Camera.EncodingType.JPEG, mediaType: Camera.MediaType.PICTURE, allowEdit: true, correctOrientation: true,
saveToPhotoAlbum: true
}
var path = oEvent.getSource().getBindingContext().getPath()
navigator.camera.getPicture(function cameraSuccess(imageUri) {
//vModel is a JSONModel already set to the view.
vModel.setProperty(path+"/defaultImgPath",imageUri);
}, function cameraError(error) { console.debug("Unable to obtain picture: " + error, "app"); }, options);
}
<Image src="{defaultImgPath}" mode="Image" height="50px" width="50px" visible="true" press="_onOpenCamera" densityAware="false"/>
Request clarification before answering.
User | Count |
---|---|
54 | |
10 | |
8 | |
6 | |
5 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.