You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Tobias Soloschenko <to...@gmail.com> on 2015/11/18 22:51:31 UTC
Wicket Mobile Components
Hi everyone,
I'm currently trying fo find out an easy way to implement simple HTML5
mobile components, which allows the user to take pictures / videos
across multiple devices. One way which is working on almost every
devices is to use the input tag with the "capture" and "accept"
attribute. Example:
<input type="file" accept="image/*" capture="camera"/> (Shows an input
field which opens the camera on the mobile device)
What I made so far is to build a light weight javascript in addition
which hides this input field, instead using a full customizable label
and if a picture is uploaded it is shown with a correct aspect ratio in
an img tag. A little documentation can be found here:
https://github.com/klopfdreh/wicket-components-playground/wiki/13.-HTML5-MediaUploadField-API
What I dislike that this is not a straight implementation, because it
requires the dynamic css generation in render header, the javascript may
also be handled in a better way and the java source also requires a lot
of invocations. (see git repository)
Any suggestions to improve it and wdyt of this approach in general?
kind regards
Tobias
Re: Wicket Mobile Components
Posted by Sven Meier <sv...@meiers.net>.
Hi Tobias,
use a CSS class selector and pass the component ids into the JavaScript
like AbstractAutoCompleteBehavior does it.
Have fun
Sven
On 18.11.2015 22:51, Tobias Soloschenko wrote:
> Hi everyone,
>
> I'm currently trying fo find out an easy way to implement simple HTML5
> mobile components, which allows the user to take pictures / videos
> across multiple devices. One way which is working on almost every
> devices is to use the input tag with the "capture" and "accept"
> attribute. Example:
>
> <input type="file" accept="image/*" capture="camera"/> (Shows an input
> field which opens the camera on the mobile device)
>
> What I made so far is to build a light weight javascript in addition
> which hides this input field, instead using a full customizable label
> and if a picture is uploaded it is shown with a correct aspect ratio in
> an img tag. A little documentation can be found here:
>
> https://github.com/klopfdreh/wicket-components-playground/wiki/13.-HTML5-MediaUploadField-API
>
>
> What I dislike that this is not a straight implementation, because it
> requires the dynamic css generation in render header, the javascript may
> also be handled in a better way and the java source also requires a lot
> of invocations. (see git repository)
>
> Any suggestions to improve it and wdyt of this approach in general?
>
> kind regards
>
> Tobias