Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

170
Visualizações
window.opener causes error "Uncaught TypeError: Cannot read properties of null (reading 'opener')" if calendar dialog is displayed first

I have a dialog containing a text entry field with a calendar icon that when clicked displays a calendar lookup. Next to that is a button that calls a function to copy the text entry field values to a list of other fields in the dialog. The code is below. If I simply enter a date and hit the Copy button, it works fine. But if I click the calendar icon to select a date from the calendar lookup, the FIRST time I click 'Copy', I get this error:

"Uncaught TypeError: Cannot read properties of null (reading 'opener')"

The SECOND time I click 'Copy', it copies the date to the other fields. Something about clicking the calendar icon first is screwing up opener(). I am not a JS expert so if you have any suggestions, please be explicit with instructions on how to fix it. Thanks in advance for any help!

// DATE TEXT ENTRY FIELD
html += "<tr><td colspan='4'></td><td><input size='18' type='text' id='uphs_samedate'></td>";
// CALENDAR LOOKUP ICON
html += "<td><a style='display:inline;' displaystyle='inline' id='uphs_samedate_img' href='#' title='/Look up a date' onclick=\"sapphire.lookup.date.open('uphs_samedate','','','','MM/dd/yy hh:mm:ss a','S M' );return false;\" tabindex='0'><img title='Lookup a date' border='0' src='WEB-CORE/imageref/flat/16/flat_black_calendar2.svg'></a></td>";
// BUTTON TO COPY DATE FROM TEXT ENTRY FIELD TO OTHER TEXT FIELDS BELOW
html += "<td><button type='button' id='uphs_setdatebutton' onclick='sapphire.ui.dialog.getDialogObject().opener.uphs_colxn_set_copydownvalues("+ dsLength +")'>Copy Down</button></td></tr>";

... [LIST OF TEXT FIELDS TO WHICH TO COPY ABOVE DATE]

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda