Hello,
I encounter a very strange problem.
I have a combobox with a custome valuelist. A function is fired on the DataChange event.
In debug mode, all is OK (web and smart client)
In production environment, it works fine in web client, but not in Smart Client !
When I change of dropdownlist value, nothing happens (the function is not fired). When I try to call the function on the onShow event, I have a error message “{myFunctionName} is not a function, this is a object”. Unfortunately, nothing is traced in the log file.
Here the call of the function in the onShow :
/**
* Callback method for when form is shown.
*
* @param {Boolean} firstShow form is shown first time after load
* @param {JSEvent} event the event that triggered the action
*
* @properties={typeid:24,uuid:"FA79FD34-FD3F-4203-8E59-C7E4BC3F8F71"}
*/
function onShow(firstShow, event) {
// TODO Auto-generated method stub
globals.gest_printButton(false);
evtchangeList(); //Note : I don't use the oldValue, newValue and event parameters in my function
// (...)
}
And the declaration of the function :
/**
* Handle changed data.
*
* @param {Object} oldValue old value
* @param {Object} newValue new value
* @param {JSEvent} event the event that triggered the action
*
* @returns {Boolean}
*
* @properties={typeid:24,uuid:"9D3FDA28-9443-4ABF-AAA2-887636E4575F"}
*/
function evtchangeList(oldValue, newValue, event)
{
// (...)
}
the dataChange event :
[attachment=0]servoy_datachange.png[/attachment]
I really can’t understand what happens … Help please !
Thank you very much
This also happens if you create a very small sample solution?
Which version of Servoy are you using? Is developer and production the same version?
Rob
Hello,
Thank you for your quick answer.
I’m using the version 7.3 but the problem was already there with the version 7.1.
I don’t tried with a very small sample solution. But I have the same development on an other application, and I don’t encounter the problem.
Here is the code of the function declenched on the DataChange event, maybe it will helps :
function evtchangeList(oldValue, newValue, event)
{
switch (globals.vl_states_num)
{
case 7:{
forms.frm_entites_turnover.elements.datedebut.visible = true;
forms.frm_entites_turnover.elements.datefin.visible = true;
forms.frm_entites_turnover.elements.entity.visible = true;
forms.frm_entites_turnover.elements.commercial.visible = false;
forms.frm_entites_turnover.elements.company.visible = false;
forms.frm_entites_turnover.elements.company_name.visible = false;
forms.frm_entites_turnover.elements.lbl_debut.visible = true;
forms.frm_entites_turnover.elements.lbl_fin.visible = true;
forms.frm_entites_turnover.elements.lbl_commercial.visible = false;
forms.frm_entites_turnover.elements.lbl_entity.visible = true;
forms.frm_entites_turnover.elements.lbl_company.visible = false;
forms.frm_entites_turnover.elements.lbl_statut_echantillon.visible = false
forms.frm_entites_turnover.elements.fld_statut.visible = false
forms.frm_entites_turnover.elements.lbl_mois_promo.visible = false
forms.frm_entites_turnover.elements.fld_mois_promo.visible = false
forms.frm_entites_turnover.elements.lbl_title.visible = false
forms.frm_entites_turnover.elements.fld_title.visible = false
forms.frm_entites_turnover.elements.lbl_structure.visible = false
forms.frm_entites_turnover.elements.fld_structure_id.visible = false
forms.frm_entites_turnover.elements.lbl_is_valide.visible = false;
forms.frm_entites_turnover.elements.fld_is_valide.visible = false;
forms.frm_entites_turnover.elements.lbl_type_a3.visible = false;
forms.frm_entites_turnover.elements.fld_type_a3.visible = false;
forms.frm_entites_turnover.elements.fld_type_a3_name.visible = false;
forms.frm_entites_turnover.elements.lbl_fournisseur.visible = false;
forms.frm_entites_turnover.elements.fld_fournisseur.visible = false;
forms.frm_entites_turnover.elements.fld_fournisseur_name.visible = false;
forms.frm_entites_turnover.elements.lbl_datemodifdebut.visible = false;
forms.frm_entites_turnover.elements.datemodifdebut.visible = false;
forms.frm_entites_turnover.elements.lbl_datemodiffin.visible = false;
forms.frm_entites_turnover.elements.datemodiffin.visible = false;
forms.frm_entites_turnover.elements.choice_libelle.visible = false;
forms.frm_entites_turnover.elements.lbl_choice.visible = false;
forms.frm_entites_turnover.elements.lbl_valeur_choix.visible = false;
forms.frm_entites_turnover.elements.fld_group.visible = false;
forms.frm_entites_turnover.elements.fld_category.visible = false;
forms.frm_entites_turnover.elements.fld_subcategory.visible = false;
forms.frm_entites_turnover.elements.lbl_valeur_choix.visible = false;
forms.frm_entites_turnover.elements.fld_articleid.visible = false;
forms.frm_entites_turnover.elements.choice.visible = false;
forms.frm_entites_turnover.elements.lbl_datereclamation.visible = false;
forms.frm_entites_turnover.elements.datereclamation.visible = false;
forms.frm_entites_turnover.elements.lbl_article_releve.visible = false;
forms.frm_entites_turnover.elements.fld_article_releve.visible = false;
forms.frm_entites_turnover.elements.lbl_article2.visible = false;
forms.frm_entites_turnover.elements.fld_article2.visible = false;
forms.frm_entites_turnover.elements.fld_article_name2.visible = false;
forms.frm_entites_turnover.elements.lbl_famille2.visible = false;
forms.frm_entites_turnover.elements.fld_famille2.visible = false;
forms.frm_entites_turnover.elements.fld_famille_name2.visible = false;
forms.frm_entites_turnover.elements.lbl_groupe2.visible = false;
forms.frm_entites_turnover.elements.fld_groupe2.visible = false;
forms.frm_entites_turnover.elements.fld_groupe_name2.visible = false;
forms.frm_entites_turnover.elements.lbl_ca_n_ec.visible = false;
forms.frm_entites_turnover.elements.fld_ca_n_ec.visible = false;
forms.frm_entites_turnover.elements.lbl_annee.visible = false;
forms.frm_entites_turnover.elements.fld_annee.visible = false;
forms.frm_entites_turnover.elements.lbl_centre_nat.visible = false;
forms.frm_entites_turnover.elements.centre_nat.visible = false;
forms.frm_entites_turnover.elements.centre_nat_name.visible = false;
forms.frm_entites_turnover.elements.lbl_groupement.visible = false;
forms.frm_entites_turnover.elements.groupement.visible = false;
forms.frm_entites_turnover.elements.groupement_name.visible = false;
forms.frm_entites_turnover.elements.lbl_region.visible = false;
forms.frm_entites_turnover.elements.region.visible = false;
forms.frm_entites_turnover.elements.region_name.visible = false;
forms.frm_entites_turnover.elements.lbl_plateforme.visible = false;
forms.frm_entites_turnover.elements.plateforme.visible = false;
forms.frm_entites_turnover.elements.plateforme_name.visible = false;
forms.frm_entites_turnover.elements.lbl_decisionnaire.visible = false;
forms.frm_entites_turnover.elements.fld_decisionnaire.visible = false;
break;
}
case 8:{
forms.frm_entites_turnover.elements.datedebut.visible = true
forms.frm_entites_turnover.elements.datefin.visible = true
forms.frm_entites_turnover.elements.entity.visible = true
forms.frm_entites_turnover.elements.commercial.visible = false
forms.frm_entites_turnover.elements.company.visible = false
forms.frm_entites_turnover.elements.company_name.visible = false
forms.frm_entites_turnover.elements.lbl_debut.visible = true
forms.frm_entites_turnover.elements.lbl_fin.visible = true
forms.frm_entites_turnover.elements.lbl_commercial.visible = false
forms.frm_entites_turnover.elements.lbl_entity.visible = true
forms.frm_entites_turnover.elements.lbl_company.visible = false
forms.frm_entites_turnover.elements.lbl_statut_echantillon.visible = false
forms.frm_entites_turnover.elements.fld_statut.visible = false
forms.frm_entites_turnover.elements.lbl_mois_promo.visible = false
forms.frm_entites_turnover.elements.fld_mois_promo.visible = false
forms.frm_entites_turnover.elements.lbl_title.visible = false
forms.frm_entites_turnover.elements.fld_title.visible = false
forms.frm_entites_turnover.elements.lbl_structure.visible = false
forms.frm_entites_turnover.elements.fld_structure_id.visible = false
forms.frm_entites_turnover.elements.lbl_is_valide.visible = false;
forms.frm_entites_turnover.elements.fld_is_valide.visible = false;
forms.frm_entites_turnover.elements.lbl_type_a3.visible = false;
forms.frm_entites_turnover.elements.fld_type_a3.visible = false;
forms.frm_entites_turnover.elements.fld_type_a3_name.visible = false;
forms.frm_entites_turnover.elements.lbl_fournisseur.visible = false;
forms.frm_entites_turnover.elements.fld_fournisseur.visible = false;
forms.frm_entites_turnover.elements.fld_fournisseur_name.visible = false;
forms.frm_entites_turnover.elements.lbl_datemodifdebut.visible = false;
forms.frm_entites_turnover.elements.datemodifdebut.visible = false;
forms.frm_entites_turnover.elements.lbl_datemodiffin.visible = false;
forms.frm_entites_turnover.elements.datemodiffin.visible = false;
forms.frm_entites_turnover.elements.choice_libelle.visible = false;
forms.frm_entites_turnover.elements.lbl_choice.visible = false;
forms.frm_entites_turnover.elements.lbl_valeur_choix.visible = false;
forms.frm_entites_turnover.elements.fld_group.visible = false;
forms.frm_entites_turnover.elements.fld_category.visible = false;
forms.frm_entites_turnover.elements.fld_subcategory.visible = false;
forms.frm_entites_turnover.elements.lbl_valeur_choix.visible = false;
forms.frm_entites_turnover.elements.fld_articleid.visible = false;
forms.frm_entites_turnover.elements.choice.visible = false;
forms.frm_entites_turnover.elements.lbl_datereclamation.visible = false;
forms.frm_entites_turnover.elements.datereclamation.visible = false;
forms.frm_entites_turnover.elements.lbl_article_releve.visible = false;
forms.frm_entites_turnover.elements.fld_article_releve.visible = false;
forms.frm_entites_turnover.elements.lbl_article2.visible = false;
forms.frm_entites_turnover.elements.fld_article2.visible = false;
forms.frm_entites_turnover.elements.fld_article_name2.visible = false;
forms.frm_entites_turnover.elements.lbl_famille2.visible = false;
forms.frm_entites_turnover.elements.fld_famille2.visible = false;
forms.frm_entites_turnover.elements.fld_famille_name2.visible = false;
forms.frm_entites_turnover.elements.lbl_groupe2.visible = false;
forms.frm_entites_turnover.elements.fld_groupe2.visible = false;
forms.frm_entites_turnover.elements.fld_groupe_name2.visible = false;
forms.frm_entites_turnover.elements.lbl_ca_n_ec.visible = false;
forms.frm_entites_turnover.elements.fld_ca_n_ec.visible = false;
forms.frm_entites_turnover.elements.lbl_annee.visible = false;
forms.frm_entites_turnover.elements.fld_annee.visible = false;
forms.frm_entites_turnover.elements.lbl_centre_nat.visible = false;
forms.frm_entites_turnover.elements.centre_nat.visible = false;
forms.frm_entites_turnover.elements.centre_nat_name.visible = false;
forms.frm_entites_turnover.elements.lbl_groupement.visible = false;
forms.frm_entites_turnover.elements.groupement.visible = false;
forms.frm_entites_turnover.elements.groupement_name.visible = false;
forms.frm_entites_turnover.elements.lbl_region.visible = false;
forms.frm_entites_turnover.elements.region.visible = false;
forms.frm_entites_turnover.elements.region_name.visible = false;
forms.frm_entites_turnover.elements.lbl_plateforme.visible = false;
forms.frm_entites_turnover.elements.plateforme.visible = false;
forms.frm_entites_turnover.elements.plateforme_name.visible = false;
forms.frm_entites_turnover.elements.lbl_decisionnaire.visible = false;
forms.frm_entites_turnover.elements.fld_decisionnaire.visible = false;
break;
}
//and then many other cases...
}
default:
break;
}
return true;
}
[attachment=1]frm_states.jpg[/attachment]
[attachment=0]frm_entites_turnover.png[/attachment]
Hi Vincent,
you must have error markers in your method file.
This is due to all the curly brackets you use within the switch function.
It should look like:
switch (globals.vl_states_num) {
case 7:
forms.frm_entites_turnover.elements.datedebut.visible = true;
forms.frm_entites_turnover.elements.datefin.visible = true;
forms.frm_entites_turnover.elements.entity.visible = true;
etc.
break;
case 8:
forms.frm_entites_turnover.elements.datedebut.visible = true
forms.frm_entites_turnover.elements.datefin.visible = true
forms.frm_entites_turnover.elements.entity.visible = true
etc.
break;
default:
break;
}
Thank you for your answer !
I hadn’t errors markers but I even tried your solution. Unfortunately, I still have the problem … (only on production server and in Smart Client).
I finally find a workaround : I created a new function in which I put “if” conditions instead of the switch case, I attached this function on the dataChange event and it works now!