[Javascript] Window.opener in JSP - again

Guilherme Cordeiro guilhermecordeiro at yahoo.com.br
Tue Sep 28 15:38:33 CDT 2004


So, I used the solution provided in those simple html
files. It worked perfectly.

Now, I am trying to use it on some JSP files.

The pop-up window has these elements:

<form name="sel_municipio"
action="selecionaMunicipio.jsp" method="post">
...
<table cellSpacing="1" cellPadding="2" width="300"
border="0">
...
<tr>
  <td>
    <input type="image" name="finalizar"
src="imagens/finalizar.gif" alt="Finalizar"
onclick="javascript:closeMunicipio();">&nbsp;
  </td>
</tr>

The opener window has these elements:

<form name="atualizaaluno" action="editaDados.jsp"
method="post">
...
<table name="table1" id="tag_100_1" cellspacing="1"
cellpadding="1" width="70%" align="center" border="0">
...
<tr>
  <td>
    <input type="text" name="cd_mun_nat" value="<%=
gc.codMunNat %>" size="8">
    <input type="text" name="nm_mun_nat" value="<%=
gc.nomeMunNat %>" size="18">
    <input type="button" name="but_mun_nat"
value="..." onclick="javascript:openMunicipio();">
  </td>
</tr>

The js file:

var novaJanela;

function openMunicipio()
{
  novaJanela =
window.open("selecionaMunicipio.jsp",'novaJanela','scrollbars=no,width=500,height=300');
}

function closeMunicipio()
{
  self.opener.document.atualizaaluno.nm_mun_nat.value
= self.document.sel_municipio.select_mun.value;
  self.close();
  self.opener.novaJanela = null;
}
(...)

So, when the user clicks on the "finalizar" image, it
was supposed to update the opener window with the
value selected in the dropdown. I don't know why it's
not working, even if I do like that simple example.
Anyone knows what can I do? Thanks again.


	
	
		
_______________________________________________________ 
Yahoo! Acesso Grátis - Internet rápida e grátis. Instale o discador agora! http://br.acesso.yahoo.com/



More information about the Javascript mailing list