Boa tarde pessoal,
Estou usando ajax para carregar uma tabela, so que quando eu tento recuperar um parametro para fazer a pesquisa, ele me retorna null, como eu devo fazer !!! Vou postar um pedaço do codigo.
else if(acao=='ListaDatas'){
for(i = 0; i < document.cadSolicitacao.fluxo.length; i++){
if(document.cadSolicitacao.fluxo[i].checked){
var fluxo = document.cadSolicitacao.fluxo[i].value;
mensagem(fluxo);
}
função que recupeara o valor clicado (estou usando input type=“radio” )
var xmlhttp=false;
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}catch(e){
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}catch(E){
xmlhttp = false;
}
}
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
xmlhttp = new XMLHttpRequest();
}
function mensagem(fluxo){
var theUrl = "/WORKATIS2/ControllerRegistrarSolicitacao?action=listarDatas";
xmlhttp.open("GET", theUrl, true);
xmlhttp.onreadystatechange=function(){
if (xmlhttp.readyState==4) {
ExibeMensagem(false);
criaAviso(xmlhttp.responseXML);
}else{
ExibeMensagem(true);
}
}
xmlhttp.send(null);
};
function ExibeMensagem(fluxo){
var DivRef = document.getElementById('MensagemAguarde');
if(fluxo){
alert("OK");
DivRef.style.display = "block";
}else{
alert("NOT OK");
DivRef.style.display = "none";
}
}
function criaAviso(ajaxResponse) {
alert("OK");
}
Aqui esta a função do Ajax.js
String fluxo = (String) request.getParameter("fluxoEscolhido");
Hashtable hash = new Hashtable();
Pedaco do .java
Quando ele passa pela variavel, ele nao encontra nenhum valor, isso pq eu nao estou passando um submit, como eu posso fazer com que ele pege o valor selecionado !!
valew