javascript problem when retrieve value in f:attribute
843844Dec 15 2007 — edited Dec 16 2007in the jsf page___
I have a problem when I try to retrieve the value I get a String with the javascritp instead the value that belong to the evaluation of the javascript code
.....
<h:form id="formFiltro">
<h:selectOneMenu id="seleccionId" valueChangeListener="#{camionSessionBean.getCambioEnFiltroDeDatos}"
onchange="submit();">
<f:selectItem id="id0" itemLabel="" itemValue="" />
<f:selectItem id="id1" itemLabel="#{msgCamion.patChasis}" itemValue="1" itemDescription="String"/>
</h:selectOneMenu>
.....
<h:commandButton value="Consultar" actionListener="#{camionSessionBean.actualizarDatos}">
<f:attribute name="idParamString" value="javascript: document.getElementById('formFiltro:idString').value;" />
</h:commandButton>
</h:form>
into the back bean__
public void actualizarDatos(ActionEvent event) {
String campo = "";
campo = (String) Utilities.getActionAttribute(event, "idParamString");
.....
// when I run the debuger the String campo = "javascript: document.getElementById('formFiltro:idString').value;"
// and I want to get String campo = "1"