I would like help on how to get a value from a hidden
that is in a utility. I need this value to send to the next screen, but since it is in a multi-line table, I can not do that.
I need to get this value in javascript.
The screen:
<div class="grupoLista">
<util:tabela id="lista" colecao="${form.listaPrograma12}" paginar="true" indiceProperty="lerDe" totalRegistrosProperty="qtdTotalLista" tamanhoPagina="30" idxLinha="true">
<util:coluna id="id" titulo="" propriedade="nuContrato" tipo="radio">
<input type="radio" name="listaIndice" value="${idxLinha}" />
<input type="hidden" name="listanuContrato" value="${lista.nuContrato}" />
<input type="hidden" name="listanuStatus" value="${lista.nuStatus}" />
<input type="hidden" name="listanoStatus" value="${lista.noStatus}"/>
<input type="hidden" name="listanoEmpresa" value="${lista.noEmpresa}"/>
<input type="hidden" name="listanoGestor" value="${lista.noGestor}"/>
<input type="hidden" name="listadtAssina" value="${lista.dtAssina}"/>
<input type="hidden" name="listavlContrato" value="${lista.vlContrato}"/>
<input type="hidden" name="listavlDevolucao" value="${lista.vlDevolucao}"/>
<input type="hidden" name="listavlDev" value="${lista.vlDev}"/>
<input type="hidden" name="listanuEstagio" value="${lista.nuEstagio}"/>
<input type="hidden" name="listanoEstagioCont" value="${lista.noEstagio}"/>
</util:coluna>
</div>
O js
function listar(){
var validado = true;
if(!checkRadio()){
mensagemAlerta("Selecione uma das opções na lista.", "INF");
validado = false;
}
if(validado){
var linSel = $("input[name=listaIndice]:checked").val();
document.getElementById("nuContrato").value = $("#listanuContrato" + linSel).val();
document.getElementById("nuStatus").value = $("#listanuStatus" + linSel).val();
var idEstagio = $("input[name=listanuEstagio]" + linSel).val();
document.getElementById("selEstagioCont").value = idEstagio;
var noEstagio = $("input[name=listanoEstagioCont]").val();
document.getElementById("noSelEstagioCont").value = noEstagio;
submitForm("listarContratoDevolucao");
}
}
In short: In jsp a list, a table with several rows and columns is set up as well. I select a line through a radio and I push the button to send what I selected. I need to get the listanuEstagio field from the one that was selected and play in another hidden, so when you press the send button, this value will remain for the next screen. The situation is: how to capture this listanuEstagio since it is part of a list mounted, with the code I made it is only returning the value of the first line.
* in time: I'm just doing code maintenance.
Following HTML code:
<html><head></head><body><div id="modalPane" style="visibility: hidden;"></div><div id="container"><div id="header"></div><div id="corpo"><div class="confidencialidade"></div>
<!-- corpo -->
<div id="funcao"></div><div class="divisor"></div><div style="float:left;float:right;"></div>
<form id="form" action="/projet/programa.do" method="post" name="ContratoForm">
<input id="breadCrumb" type="hidden" value="/projeto/programa.do?.....?mt=pesquisar;" name="breadCrumb">
</input><input id="backPage" type="hidden" value="/projeto/programa.do?mt=ini" name="backPage"></input>
<input id="mt" type="hidden" value="pesquisar" name="mt">
</input><input id="nuContrato" type="hidden" value="9999999" name="nuContrato"></input><input id="chkFiltroNumCont" type="hidden" value="" name="chkFiltroNumContr"></input>
<input id="tela" type="hidden" value="lista" name="tela"></input><div id="conteudo"><div class="informacao">
CNPJ:
<b></b></div><div class="informacao">
Nome Contratante:
<b></b></div><div class="grupoLista"><script type="text/javascript"></script><input id="qtdTotalLista" type="hidden" value="31" name="qtdTotalLista"></input><div id="divIE" class="divlinhaTabela"><table id="tblIE" class="dados" width="100%">
<tbody>
<tr class="azul">
<th></th><th nowrap="nowrap"></th><th nowrap="nowrap"></th><th nowrap="nowrap"></th><th nowrap="nowrap"></th><th nowrap="nowrap"></th><th nowrap="nowrap"></th><th nowrap="nowrap"></th><th nowrap="nowrap" style="text-align:right"></th><th nowrap="nowrap" style="text-align:right"></th><th nowrap="nowrap" style="text-align:right"></th></tr>
<tr class="branco">
<td><input type="radio" value="0" name="listaIndice"></input>
<input type="hidden" value="9999999" name="listanuOperacao"></input>
<input type="hidden" value="4" name="listanuSituacao"></input>
<input type="hidden" value="Contratada/Notificado" name="listanoSituacao"></input>
<input type="hidden" value="Contrantante" name="listanoContratado"></input>
<input type="hidden" value="Gestor" name="listanoGestor"></input>
<input type="hidden" value="19/02/2016" name="listadtAssina"></input>
<input type="hidden" value="0000000000010000.00" name="listaValor></input>
<input type="hidden" value="0000000000000000.00" name="listavlDev"></input>
<input type="hidden" value="0000000000000000.00" name="listavlCredito"></input>
<input type="hidden" value="4" name="listanuEstagio'0'"></input>
<input type="hidden" value="Notificado de TCE" name="listanoEstagioOper"></input></td>
<td nowrap="nowrap"></td>
<td nowrap="nowrap"></td>
<td nowrap="nowrap">
9999999 - 99
</td><td nowrap="nowrap">
Contratada/Notificado
</td><td nowrap="nowrap"></td>
<td nowrap="nowrap"></td>
<td nowrap="nowrap">
Contratante
</td><td nowrap="nowrap"></td>
<td nowrap="nowrap"></td>
<td nowrap="nowrap" style="text-align:right"></td>
<td nowrap="nowrap" style="text-align:right"></td>
<td nowrap="nowrap" style="text-align:right"></td>
</tbody>
</table>
</div><div class="paginacao"><div class="numeros"></div>
<div style="float:left;"></div></div>
<span class="total"></span>
<div class="grupoBotaoLista"><div class="divisor"></div>
<img class="botao" onclick="listar();" src="resources/_images/botoes/bt_listar.gif" alt=""></img>
<img class="botao" onclick="volta();" src="resources/_images/botoes/bt_voltar.gif" alt=""></img></div></div></div>
</form>
<!-- mensagem -->
</div><div id="rodape"></div></div><form id="idsp" method="post" action="#"></form></body></html>