Mobile Camera
axMobileCamera
Description
axMobileCamera allows a mobile device's camera to set the image to be displayed on the 5250 screen.
Usability
|
Context |
Supported |
|---|---|
|
Input screen fields |
No |
|
Output screen fields |
Yes |
|
Input subfile fields |
No |
|
Output subfile fields |
No |
|
New screen elements |
Yes |
|
Axes Mobile Execution |
Only |
Properties
|
Name |
Description and Comments |
JavaScript |
Shipped default |
|---|---|---|---|
|
allowsEditing |
Indicates whether the editing function of the camera will be enabled. The editing features are device specific. |
Yes. Must return a Boolean. |
True |
|
caption |
Specifies the text that is to appear on the image. The text will be displayed depending on the device. |
Yes. Must return a string. |
Mobile Camera |
|
enableAnnotation |
Indicates whether taking a photo from the existing gallery and functionality to do annotation is enabled. When set to false, only taking photo using the camera will be enabled. |
Yes. Must return a Boolean. |
True |
|
enabled |
Indicates whether this element is enabled. TS2 only. |
Yes. Must return a Boolean. |
True |
|
imagePath |
Path to save the image file |
Yes. Must return a string. |
/media |
|
imageName |
Name of the image file |
Yes. Must return a string. |
None |
|
onClick |
Javascript code to be executed when the user clicks on this eXtension or on some specific part of this eXtension. |
Yes |
None |
|
onMouseOut |
Javascript code to be executed when the mouse point moves out of this eXtension. |
Yes |
None |
|
onMouseOver |
Javascript code to be executed when the mouse pointer hovers on this eXtension. |
Yes |
None |
|
saveToPhotoGallery |
Indicates whether any photo chosen or taken using the camera will be saved to the device’s gallery or not. |
Yes. Must return a Boolean. |
False |
|
sizeToField |
Indicates whether the image should be sized to fill its containing field or automatically sized to match its content. |
Yes. Must return a Boolean. |
True |
|
style |
Additional style properties that should be applied to the button. |
Yes. Must return a valid style object. |
None |
Notes, Comments and Warnings
Some of the functionality of this extension is dependent on the device (for example allowsEditing and caption) just like the operation and screens. So these functions vary from device to device.
The extension display is very similar to the axImage component with added functionality similar to the axPushButton. Touching/Clicking the image will automatically launch the Camera application of the device.
When saveToPhotoGallery is true and enableAnnotation is true, even choosing an existing photo from the Gallery will automatically save another copy of that photo in the Gallery.
When enableAnnotation is set to false, it will not be possible to choose an existing photo from the Gallery when the camera application is launched. Only taking pictures using the camera will be allowed.
The imagePath is a local folder on the device in which the imageName will be saved. When an image is taken or selected using the axMobileCamera extension, the image will be saved locally to the imagePath + “/” + imageName location. Therefore, when viewing it on the PC, any saved images will not be viewable. Note that the imagePath should not contain any trailing slash (“/”) characters.
The function to capture video is not currently available.
In Application, appStylesTheme property = JQueryUI
When JQueryUI is selected from Application->Styling->appStylesTheme property, a border will appear around the image when the mouse is hovered over it. The style of the border will be based on the theme that was set in the Application’s jqueryTheme property.
The following shows the aXes logo image when the mouse is hovered over it:

In Application, appStylesTheme property = Material Design
When Material Design is selected from Application->Styling->appStylesTheme property, an overlay will appear on the image when the mouse is hovered over it.
The following shows the image when the mouse is hovered over it:

Examples
Just like the axImage extension, the location of the image to be displayed can be set using the imagePath and imageName properties.

Using the final output screen of the eXtensions Tutorial 3 – Advanced Screen Enhancement, in Developer mode, set the name of the employee ID field to EmpID.

Replace the axImage extension with the axMobileCamera extension.

Set the imageName property with this code:
FIELDS("EmpID").getValue() + ".jpg";
Access the definition set you used above using aXes Mobile and tap on the axMobileCamera image.
Choose or take a photo and use it. The photo will be displayed inside the axMobileCamera extension.
Log out and view the screen again. The photo you have set will still be displayed inside the axMobileCamera extension.
See Also
Tutorial 6 - Advanced Screen Enhancement
Application Style Collection for Application themes
