0

The following is not working...

I have two div's like

<div id="lat">30.0</div>
<div id="lng">1.0</div>

And then I have a JSF-Command button like

<h:commandButton value="Continue" action="#{generalHandler.read(parseFloat(document.getElementById('lat').innerHTML), parseFloat(document.getElementById('lng').innerHTML))}"/>

In the backend I have a method read like

public void read(float a, float b){

    // do stuff

}

But the values from the div's are not reaching the method, if I debug and click on the continue-Button the floats passed to the method are stil 0.0

Raphael
  • 673
  • 1
  • 9
  • 27
  • I've Edited the Question, it has more to do with the JavaScript pareFloat-Funktion i assume – Raphael Mar 10 '15 at 14:20
  • 1
    Just write JavaScript code in a JavaScript function, not in an EL expression (which runs Java code, not JavaScript code). The duplicate shows you exactly how. – BalusC Mar 10 '15 at 14:21

0 Answers0