Hi! Coming from the xBase line of dBASE, Clipper, Foxpro, VFP programming, so javascript and webdev is new to me.
I'm hoping someone will point out what am I doing wrong with a simple task of filtering out a list after a value in a textbox (edit-combo list type) is being selected.
I'd like to avoid using a Search button, which works fine in filtering the list after. I tested invoking that code from AfterSelect (and OnSelect) with {dialog.object}.buttonClick('BUTTON_3'); . It works too, but for some reason not the first time I select a value.
So, back to the initial idea of the filtering with javascript command right from AfterSelect in the Lookup definition:
Using the latest update.
Works:
{dialog.object}._filterList('list2','prod_cat = "207 "');
Does not work (after "207 " row is selected):
var a;
a = this.value;
alert(a); // this messagebox comes up fine
{dialog.object}._filterList('list2', 'prod_cat = :a');
No surprise, this does not work either:
var a;
a = "207 ";
alert(a); // this messagebox comes up fine
{dialog.object}._filterList('list2', 'prod_cat = :a');
I tried multiple combinations of the second part of that command, at no avail. Am I missing something in defining the parameters in _filterList?
I see there's a filterExpn,orderExpn,filterParameters,havingExpn in the syntax. Maybe put a placeholder there, empty quotes?
Thanks in advance!
I'm hoping someone will point out what am I doing wrong with a simple task of filtering out a list after a value in a textbox (edit-combo list type) is being selected.
I'd like to avoid using a Search button, which works fine in filtering the list after. I tested invoking that code from AfterSelect (and OnSelect) with {dialog.object}.buttonClick('BUTTON_3'); . It works too, but for some reason not the first time I select a value.
So, back to the initial idea of the filtering with javascript command right from AfterSelect in the Lookup definition:
Using the latest update.
Works:
{dialog.object}._filterList('list2','prod_cat = "207 "');
Does not work (after "207 " row is selected):
var a;
a = this.value;
alert(a); // this messagebox comes up fine
{dialog.object}._filterList('list2', 'prod_cat = :a');
No surprise, this does not work either:
var a;
a = "207 ";
alert(a); // this messagebox comes up fine
{dialog.object}._filterList('list2', 'prod_cat = :a');
I tried multiple combinations of the second part of that command, at no avail. Am I missing something in defining the parameters in _filterList?
I see there's a filterExpn,orderExpn,filterParameters,havingExpn in the syntax. Maybe put a placeholder there, empty quotes?
Thanks in advance!
Comment