Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Be notified in end of process
#1
Hi,

I use onnavigationcompletehex event for knowing that web page has finished refreshing a url; a web site.
But now, i have a case in what i can get this way working. In the web site appears a popup saying search is in process, but when finished i don't see  onnavigationcompletehex event being fired.
Hope the code helps to debug this problem.

Code:
local m.clink, m.cscript, m.valor, m.exito, m.finished

* browse to main page
m.clink = "https://contrataciondelestado.es/wps/portal/"
m.clink = m.clink + "!ut/p/b1/jZC7bsMwDEW_qCBFybI1SnIsO0gbPyK31lJ4KIIEeSxFv7"
m.clink = m.clink + "-KEaBT1HAjeC4PQQgwvSiVsZxJSfAB4TL_HPbz9-F6mU-"
m.clink = m.clink + "3PshPsdpaW9WExcBLpE3pvaxj67IITBHAB6VxyZuhKLRhGpH7ArXsOqviHlT8ns-"
m.clink = m.clink + "4FeN6bOXQOMSmrsqNZxk6ks_5E4JbXo-"
m.clink = m.clink + "rTjeKIyprkHoteucpjvN7_qGAnvMnBP_k3yEsSOoDC5B6cVpC8FZfz18wRSz_O3Vr-"
m.clink = m.clink + "oit29dd64ghCtjBZOAcTlUs1RzF_AuxMNAf/dl4/d5/"
m.clink = m.clink + "L2dBISEvZ0FBIS9nQSEh/pw/Z7_AVEQAI930OBRD02JPMTPG21004/"
m.clink = m.clink + "act/id=0/p=javax.servlet.include.path_info=QCPjspQCPbusquedaQCPMainBusqueda.jsp"

m.finished = .f.
thisform.oAntView.object.navigate(m.clink)
DO WHILE !m.finished
    * wait for onnavigationcompletehex that changes m.finished value
enddo
thisform.oantView.Refresh()

m.cscript = "jsfcljs(document.forms["
m.cscript = m.cscript + "'viewns_Z7_AVEQAI930OBRD02JPMTPG21004_:form1']"
m.cscript = m.cscript + ",{'viewns_Z7_AVEQAI930OBRD02JPMTPG21004_:form1:linkFormularioBusqueda':"
m.cscript = m.cscript + "'viewns_Z7_AVEQAI930OBRD02JPMTPG21004_:form1:linkFormularioBusqueda'},'')"
thisform.oantView.executeScript(m.cscript)
m.finished = .f.
DO WHILE !m.finished
    * wait for onnavigationcompletehex that changes m.finished value
enddo

* From publication date field
m.valor = ""
thisform.oantviewdocument.RequestElementValueByIdSync("viewns_Z7_AVEQAI930OBRD02JPMTPG21004_:form1:textMinFecAnuncioMAQ2", @m.valor)
DO WHILE isnull(m.valor) OR empty(m.valor)
    thisform.oantviewdocument.SetElementValueByIdSync("viewns_Z7_AVEQAI930OBRD02JPMTPG21004_:form1:textMinFecAnuncioMAQ2", "05-12-2024")
    thisform.oantviewdocument.RequestElementValueByIdSync("viewns_Z7_AVEQAI930OBRD02JPMTPG21004_:form1:textMinFecAnuncioMAQ2", @m.valor)
enddo

* To publication date field
m.valor = ""
thisform.oantviewdocument.RequestElementValueByIdSync("viewns_Z7_AVEQAI930OBRD02JPMTPG21004_:form1:textMaxFecAnuncioMAQ", @m.valor)
DO WHILE isnull(m.valor) OR empty(m.valor)
    thisform.oantviewdocument.SetElementValueByIdSync("viewns_Z7_AVEQAI930OBRD02JPMTPG21004_:form1:textMaxFecAnuncioMAQ", "05-12-2024")
    thisform.oantviewdocument.RequestElementValueByIdSync("viewns_Z7_AVEQAI930OBRD02JPMTPG21004_:form1:textMaxFecAnuncioMAQ", @m.valor)
enddo

* Begin search
m.cscript = "iniciarBusqueda('button1', "
m.cscript = m.cscript + 'document.getElementById("viewns_Z7_AVEQAI930OBRD02JPMTPG21004_:form1:button1")'
m.cscript = m.cscript + ");"
thisform.oantView.executeScript(m.cscript)
m.finished = .f.
DO WHILE !m.finished
    * wait for onnavigationcompletehex that changes m.finished value
enddo

*--- Now, how can i be notified that navigation has being completed?
* onnavigationcompletehex seems to not work in this case
m.finished = .f.
DO WHILE !m.finished
    * wait for onnavigationcompletehex that changes m.finished value
enddo

CYZ
Reply


Messages In This Thread
Be notified in end of process - by carlos@agpsoftware.com - 2024-12-05, 10:21:54
RE: Be notified in end of process - by wila - 2024-12-05, 11:07:06
RE: Be notified in end of process - by wila - 2024-12-05, 18:52:45

Forum Jump:


Users browsing this thread: 1 Guest(s)