All of our COMBOBOXES are queryeditable.
Our COMBOBOXES are initalized in a form initializer function and
we add a blank line to the top for every one.
Now, when you are in a CONSTRUCT statement and you tab
through a field that has a COMBOBOX, in the QBE string is
"field_name IS NULL".
If you choose the first blank line in the COMBOBOX, the QBE string is "field_name IS NULL".
If you choose the last blank line in the COMBOBOX, the QBE string is "field_name IS NULL".
In another topic where this was discussed, it was stated that the last blank line chosen would
produce QBE string " 1=1".
Also, something that annoys our users, is that in the CONSTRUCT statement with
QUERYEDITABLE, it takes two clicks for the COMBOBOX to appear. We were told
it was expected behavior.
What is expected behavior when choosing blank line? And if you tab through
a COMBOBOX, is QBE string being "field_name IS NULL" expected behavior?
Thanks!
Candy
Candy,
I had no chance to look in detail at your case and see if we have a bug here (support, please analyze), but I would like to point you to the docs:
https://4js.com/techdocs/genero/fgl/devel/DocRoot/User/FormSpecFiles.html#FF_ITEMTYPE_COMBOBOX
https://4js.com/techdocs/genero/fgl/devel/DocRoot/User/FSFAttributes.html#FA_QUERYEDITABLE
You should first read these sections carefully, and if they don't answer your questions, we should go complete the doc.
Seb
Seb,
I did read the doc.
Reuben had said in another topic (Blank line in COMBOBOX):
If you have used NULL as an first argument to addItem then the QBE string returned will be "fieldname IS NULL" if that item is selected.
If you select the NULL that is added with a CONSTRUCT (the last one) then the QBE string is effectively 1=1
So. I was testing that out and it appears that the QBE string returns "fieldname IS NULL" if blank inserted, or
blank at the end, or even if the user tabs through the field and doesn't click the ComboBox.
Candy
Ok that looks not good, could you give use more details about your form?
What is the data type of the COMBOBOX field?
Any chance to get a sample to repro? (if yes plssend to support@4js.com please)
Also: What FGL/GDC/GWC version are you using?
Thanks
Seb
Seb,
I sent sample to support.
Here is test that I sent:
LAYOUT
GRID
{
[f01 ]
[f02 ]
[f03 ]
}
END
END
ATTRIBUTES
COMBOBOX f01 = formonly.combo1,
QUERYEDITABLE,
ITEMS=(NULL,"Y","N");
COMBOBOX f02 = formonly.combo2, QUERYEDITABLE,
ITEMS=((NULL,"Please select an item..."),("Y","Yes"),("N","No"));
COMBOBOX f03 = formonly.combo3,
QUERYEDITABLE;
MAIN
DEFINE l_cb ui.ComboBox
DEFINE where_clause STRING
OPEN WINDOW w WITH FORM "testconstruct"
CONSTRUCT where_clause ON col1, col2, col3 FROM combo1, combo2, combo3
BEFORE CONSTRUCT
LET l_cb = ui.ComboBox.forName("combo3")
CALL l_cb.addItem(NULL,NULL)
CALL l_cb.addItem("Y","Yes")
CALL l_cb.addItem("N","No")
END CONSTRUCT
DISPLAY where_clause
END MAIN
fglrun 2.11.03 build-1169.8
GDC: 2.11.02
When I press OK displays "col1 IS NULL"
Candy
Hello Candy,
I confirm I could repro with FGL 2.11.11 + GDC 2.11.03 and GDC 2.11.05.
The GDC returns { value "=" } change in the AUI when the focus goes to the combo, but it should not.
Actually I believe we have a design problem here with COMBOBOX + QUERYEDITABLE + NULL item:
We should distinguish NULL (i.e. IS NULL) from "empty field" (gives 1=1)...
This is not important in an INPUT / INPUT ARRAY context, but is critical in CONSTRUCT.
GDC 2.20 handles this case in a better way, but I think we still have an issue.
Please contact the support, so we can track this as a bug.
As a workaround, I would recommend to avoid NULL items in such combos during CONSTRUCT.
Thanks,
Seb
I have filed a bug for GDC 2.20 regarding comboboxes in CONSTRUCT.
Bug id is 12082.
Seb