70
rated 0 times
[
72]
[
2]
/ answers: 1 / hits: 41464
/ 9 Years ago, wed, february 18, 2015, 12:00:00
I'm preparing some variables in JavaScript (in my specific case, I'd like to get GPS location):
function getVars() {
// ...
var x = locationInfo.lng;
var y = locationInfo.lat;
}
I'd like to send them to my managed bean via the below command button:
<h:commandButton value=submit onclick=getVars() action=#{bean.submit(x,y)} />
public void submit(int x, int y) {
// ...
}
How can I send x
and y
variables from JavaScript to JSF managed bean action method?
More From » jsf