We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi trying to use mobile action -> take photo
the camera opens, takes picture, picture is displayed, but not saved as serverAttribute on the device.
using default code
`// Function body to process image obtained as a result of mobile action (take photo, take image from gallery, etc.). // - imageUrl - image URL in base64 data format showImageDialog('Photo', imageUrl); //saveEntityImageAttribute('image', imageUrl); function showImageDialog(title, imageUrl) { setTimeout(function() { widgetContext.customDialog.customDialog(imageDialogTemplate, ImageDialogController, {imageUrl: imageUrl, title: title}).subscribe(); }, 100); } function saveEntityImageAttribute(attributeName, imageUrl) { if (entityId) { let attributes = [{ key: attributeName, value: imageUrl }]; widgetContext.attributeService.saveEntityAttributes(entityId, "SERVER_SCOPE", attributes).subscribe( function() { widgetContext.showSuccessToast('Image attribute saved!'); }, function(error) { widgetContext.dialogs.alert('Image attribute save failed', JSON.stringify(error)); } ); } } var imageDialogTemplate = '<div aria-label="Image">' + '<form #theForm="ngForm">' + '<mat-toolbar fxLayout="row" color="primary">' + '<h2>{{title}}</h2>' + '<span fxFlex></span>' + '<button mat-icon-button (click)="close()">' + '<mat-icon>close</mat-icon>' + '</button>' + '</mat-toolbar>' + '<div mat-dialog-content>' + '<div class="mat-content mat-padding">' + '<div fxLayout="column" fxFlex>' + '<div style="padding-top: 20px;">' + '<img [src]="imageUrl" style="height: 300px;"/>' + '</div>' + '</div>' + '</div>' + '</div>' + '<div mat-dialog-actions fxLayout="row">' + '<span fxFlex></span>' + '<button mat-button (click)="close()" style="margin-right:20px;">Close</button>' + '</div>' + '</form>' + '</div>'; function ImageDialogController(instance) { let vm = instance; vm.title = vm.data.title; vm.imageUrl = vm.data.imageUrl; vm.close = function () { vm.dialogRef.close(null); } } `
The text was updated successfully, but these errors were encountered:
Hi @t0mZ4, To save the attribute, you need to uncomment the line of code: //saveEntityImageAttribute('image', imageUrl);
//saveEntityImageAttribute('image', imageUrl);
Sorry, something went wrong.
No branches or pull requests
Hi
trying to use mobile action -> take photo
the camera opens, takes picture, picture is displayed, but not saved as serverAttribute on the device.
using default code
The text was updated successfully, but these errors were encountered: