the name of the fields can be like " form1:calendar1_field" or "form1:dropDown1_list", so ive created a function to make it simple
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package classes;
// get information context -request parameters
import java.util.Enumeration;
import javax.faces.context.FacesContext;
import javax.servlet.http.HttpServletRequest;
/**
*
* @author Administrador
*/
public class util {
// returns the value stored in request("parameter")
public static String recko(String parameter) {
HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
String controlName = request.getParameter("form1:textField1_field");
// iterate the collection
Enumeration e = request.getParameterNames();
while (e.hasMoreElements()) {
String s_clave = e.nextElement().toString();
String s_aux = request.getParameter(s_clave);
if (s_clave.indexOf(parameter + '_') != -1) {
return s_aux;
}
}
return "";
}
}
to use it (for example get the value in textField1.
String cadena=util.recko("textField1");