Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

javascript problem when retrieve value in f:attribute

843844Dec 15 2007 — edited Dec 16 2007
in 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"
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 13 2008
Added on Dec 15 2007
3 comments
179 views