Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Apex 18= undefined type Javascript

José Gustavo Horta LimaApr 23 2018 — edited Apr 30 2018

I created an application {user and password test} to test field exchanges using a select list in a report. It was working until Friday 20-apr-18. For some reason the code has become useless.
Returns an undefined type error of the changed item. Regardless of the type of field. I suspect it has happened due to the new version of apex 18.

The code on page 2 is very similar to the one on the other pages. It refers on changes of object f13 - select list.

var source = apex.jQuery(this.triggeringElement).find('select[name="f13"]')
console.log('source')
console.log(source)
console.log('source.context.form')
console.log(source.context.form)
var lista  =  apex.jQuery(source.context.form).find('select[name="f13"
console.log(lista)
//var valornaorigem = apex.jQuery(this.triggeringElement).closest('select[name="f13"]').find('option[selected]')[0].value
var indiceOrigem = ''
var valorDefaultFinal = ''

 

   // valor da origem

  

//console.log('valor original: ' + valornaorigem)  

   console.log('valor modificado na origem: ' + source.context.value)

   for (var indice=0;indice<lista.length; indice++){

if (source.context === lista[indice]){
indiceOrigem = indice
console.log('indice do objeto manipulado '+indiceOrigem)
}

   }

console.log('indice default '+valordefault[indiceOrigem])
console.log('selectedIndex do objeto manipulado ' +source.context.selectedIndex)
for (var x=0;x<lista.length;x++){
console.log('iteração '+ x)
var tabela = {};
tabela.valordefault =  valordefault[indiceOrigem]
tabela.lista_x_selectedIndex = lista[x].selectedIndex
tabela.source_context_selectedIndex =  source.context.selectedIndex
tabela.indiceOrigem = indiceOrigem
tabela.objetoIterado = x
console.table(tabela)

if (valordefault[indiceOrigem] < source.context.selectedIndex) {
subtrai()
}  else {
soma()
}

}

valordefault[indiceOrigem] = valorDefaultFinal

function subtrai(){
if (source.context !== lista[x] && (lista[x].selectedIndex  >= valordefault[indiceOrigem] && lista[x].selectedIndex <= source.context.selectedIndex)){
console.log('item testado na lista '+ x)
console.log('pegou outro ' + [x])

lista[x].selectedIndex = lista[x].selectedIndex -1
valordefault[x]=lista[x].selectedIndex
else if (source.context === lista[x]) {
valorDefaultFinal=lista[x].selectedIndex
}

console.log(valordefault)
}  

function soma(){
if (source.context !== lista[x] && (lista[x].selectedIndex  <= valordefault[indiceOrigem] && lista[x].selectedIndex >= source.context.selectedIndex)){
console.log('item testado na lista '+ x)
console.log('pegou outro ' + [x])

lista[x].selectedIndex = lista[x].selectedIndex +1
valordefault[x]=lista[x].selectedIndex
else if (source.context === lista[x]) {
valorDefaultFinal=lista[x].selectedIndex
}

console.log(valordefault)
}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 28 2018
Added on Apr 23 2018
1 comment
439 views