The camera component allows JSF applications to access a mobile device camera. The component renders a simple button that, when pressed, launches the native camera application on the device. Once a picture has been taken and accepted, the user is returned to the web application. Image data captured by the device is inserted in the calling form and data is submitted to the server via a standard JSF form post.

The button label can be changed after a photo has been taken to notify the user. The 'buttonLabel' attribute is first displayed, and after a photo has been captured, the 'captureMessageLabel' attribute value is then shown as the button label.

Value binding is achieved via a Map object so that other important camera image data can be stored along with the image file data. A typical camera component setup looks as follows:

    <mobi:camera
      value="#{myBean.map}"
      buttonLabel="Camera"
      captureMessageLabel="Thanks"/>

When the containing form is submitted to the server the setter setMap() is called on the bean, making the camera image available to the application.

The camera is only accessible if the application is running in an ICEmobile device container or if ICEmobile SX has been registered, otherwise the component will display a file upload input component.