Reputation: 814
Why if I write this:
function selectListaArticoliOrdineCliente(n_ordine,cod_cli){
var invocationData={
adapter : 'DB2Adapter',
procedure: 'selectListaArticoliOrdineCliente',
parameters:[n_ordine,cod_cli]
};
WL.Client.invokeProcedure(invocationData,
{
onSuccess: function(){
getAllDettaglioOrdine(result);
},
onFailure: function(){
WL.Logger.debug("fallito");
}
}
);
}
or write this
function selectListaArticoliOrdineCliente(n_ordine,cod_cli){
....
WL.Client.invokeProcedure(invocationData,
{
onSuccess: getAllDettaglioOrdine(result);
,
onFailure: function(){
WL.Logger.debug("fallito");
}
}
);
}
the result variable is not defined, but if I write this
function selectListaArticoliOrdineCliente(n_ordine,cod_cli){
....
WL.Client.invokeProcedure(invocationData,
{
onSuccess: getAllDettaglioOrdine
,
onFailure: function(){
WL.Logger.debug("fallito");
}
}
);
}
All work perfectly?! How I pass another parameter to onSuccessFunction? For example i would pass result and an id.Such as
onSuccess: getAllDettaglioOrdine(result,"9000000")
The function getAllDettagioOrdine
function getAllDettaglioOrdine(result,id_ordine){
ordine_cliente_dettaglio_articolo=result.invocationResult.resultSet;
..
Upvotes: 0
Views: 408
Reputation: 5111
It looks like you're calling a function instead of defining a callback.
Change this:
onSuccess: getAllDettaglioOrdine(result,"9000000")
to this:
onSuccess: function(result){ getAllDettaglioOrdine(result,"9000000") }
Upvotes: 3