I have to pass geolocation values got by using html5 geolocation to my managed bean ItemMb, here is my code to clarify things and i don't really know how to achieve this.
My managed bean
public class ItemMb {
private Item item = new Item();
// get/set
}
My dto Item
public class Item {
// private Double idCollect;
// login et password
private Double lat;
private Double lon;
private Double accuracy;
private String photo;
private String remark;
public Item(){
}
// getters and setters
Here is my .js file where i got geolocations values and innertext them in some primefaces tags
window.watchID = navigator.geolocation.watchPosition(function(position){
document.getElementById("xCurrentPosition").innerHTML = (Math.round(position.coords.latitude*100) / 100);
document.getElementById("yCurrentPosition").innerHTML = (Math.round(position.coords.longitude*100) / 100);
document.getElementById("accuracyCurrentPosition").innerHTML = position.coords.accuracy;
});
Now i want to pass those JavaScript generated geolocation values to my managed bean ItemMb. If you need more informations feel free to ask.