joffre
12 years agoRegular Contributor
Generic object for Event .ClickButton(cbChecked)
Hi all.
I'm creating a generic function that will receive 3 parameters:
> nomeColuna - Column name (will receive the column name from DataBase)
> nomeComponente - Form's label (will receive the name of the object that will be selected)
> itemClicado - Item Clicked - (will receive the form object that is a checkbox)
Here is the function:
The 'nomeComponente' variable is receiving the CheckBox, but it isn't working. The problem is when it arrives at the last if line, it returns the error attached, that translating into english means The object doesn't support the property or method.
What can I do?
I'm creating a generic function that will receive 3 parameters:
> nomeColuna - Column name (will receive the column name from DataBase)
> nomeComponente - Form's label (will receive the name of the object that will be selected)
> itemClicado - Item Clicked - (will receive the form object that is a checkbox)
Here is the function:
function verificarClickCheckBox(nomeColuna, nomeComponente, itemClicado)
{
loadTipoAtividadeNormalVariaveis();
if (registros.Fields(nomeColuna).Value == "S") {
Log.Message("Seleciona o item " + itemClicado)
nomeComponente.ClickButton(cbChecked);
}
}
The 'nomeComponente' variable is receiving the CheckBox, but it isn't working. The problem is when it arrives at the last if line, it returns the error attached, that translating into english means The object doesn't support the property or method.
What can I do?
- Here
verificarClickCheckBox(
"bTRABALHADOR_URBANO_PJ"
,
"chkTrabalhadorUrbanoPJ"
,
"Trabalhador Urbano - PJ - CLT"
);
Don't pass in the label. Don't pass in the string. Pass in the actual object. You have an object var
chkTrabalhadorUrbanoPJ = Sys.Process(
"FPw5_CadCalc"
).VBObject(
"Form1"
).Window(
"MDIClient"
).VBObject(
"cdSituacoes"
).VBObject(
"fraSituacao_5"
).VBObject(
"Vinculos_11"
);
Pass it into the procedure and use it.