Hi,
I've just come across a bug in my application and I don't know if it's a SmartGWT issue or this is what you would expect.
I've been migrating some of my code to use advanced Criterion over Criteria for my searches.
I have a TreeGrid which is data bound, when the fetchData is triggered, the Criteria contains the primary key value which allows me to load the current level in the tree. However, since converting the data to advanced criteria, the primary key value gets lost, see the below code snippet
// My Data Source Snippet....
DataSourceField idField = new DataSourceTextField(FieldConstants.REFERENCE_COLUMN);
idField.setHidden(true);
idField.setPrimaryKey(true);
fields.add(idField);
DataSourceField primaryReference = new DataSourceTextField(FieldConstants.PRIMARY_REFERENCE_COLUMN); // "__$$__PRIM_CUST_REF"
primaryReference.setHidden(true);
primaryReference.setForeignKey(FieldConstants.REFERENCE_COLUMN);
fields.add(primaryReference);
// The fetch Code
DSRequest request; // Passed in the fetchData request.getCriteria().getValues() Result...
result = {LinkedHashMap@29901} size = 3
0 = {LinkedHashMap$Entry@29904} "1" -> "Dale"
1 = {LinkedHashMap$Entry@29905} "2" -> "E"
2 = {LinkedHashMap$Entry@29906} "__$$__PRIM_CUST_REF" -> "null"
Contains a __$$__PRIM_CUST_REF entry
request.getCriteria().asAdvancedCriteria().getValues() Result...
result = {LinkedHashMap@29923} size = 3
0 = {LinkedHashMap$Entry@29926} "_constructor" -> "AdvancedCriteria"
1 = {LinkedHashMap$Entry@29927} "operator" -> "and"
key = "operator"
value = "and"
2 = {LinkedHashMap$Entry@29928} "criteria" -> " size = 2"
key = "criteria"
value = {ArrayList@29934} size = 2
0 = {LinkedHashMap@29936} size = 3
0 = {LinkedHashMap$Entry@29940} "fieldName" -> "1"
1 = {LinkedHashMap$Entry@29941} "operator" -> "iContains"
2 = {LinkedHashMap$Entry@29942} "value" -> "Dale"
1 = {LinkedHashMap@29937} size = 3
0 = {LinkedHashMap$Entry@29951} "fieldName" -> "2"
1 = {LinkedHashMap$Entry@29952} "operator" -> "iContains"
2 = {LinkedHashMap$Entry@29953} "value" -> "E"
Does not contains a __$$__PRIM_CUST_REF entry
Is this what you would expect or is this a bug?
Thanks,
Dale
I've just come across a bug in my application and I don't know if it's a SmartGWT issue or this is what you would expect.
I've been migrating some of my code to use advanced Criterion over Criteria for my searches.
I have a TreeGrid which is data bound, when the fetchData is triggered, the Criteria contains the primary key value which allows me to load the current level in the tree. However, since converting the data to advanced criteria, the primary key value gets lost, see the below code snippet
// My Data Source Snippet....
DataSourceField idField = new DataSourceTextField(FieldConstants.REFERENCE_COLUMN);
idField.setHidden(true);
idField.setPrimaryKey(true);
fields.add(idField);
DataSourceField primaryReference = new DataSourceTextField(FieldConstants.PRIMARY_REFERENCE_COLUMN); // "__$$__PRIM_CUST_REF"
primaryReference.setHidden(true);
primaryReference.setForeignKey(FieldConstants.REFERENCE_COLUMN);
fields.add(primaryReference);
// The fetch Code
DSRequest request; // Passed in the fetchData request.getCriteria().getValues() Result...
result = {LinkedHashMap@29901} size = 3
0 = {LinkedHashMap$Entry@29904} "1" -> "Dale"
1 = {LinkedHashMap$Entry@29905} "2" -> "E"
2 = {LinkedHashMap$Entry@29906} "__$$__PRIM_CUST_REF" -> "null"
Contains a __$$__PRIM_CUST_REF entry
request.getCriteria().asAdvancedCriteria().getValues() Result...
result = {LinkedHashMap@29923} size = 3
0 = {LinkedHashMap$Entry@29926} "_constructor" -> "AdvancedCriteria"
1 = {LinkedHashMap$Entry@29927} "operator" -> "and"
key = "operator"
value = "and"
2 = {LinkedHashMap$Entry@29928} "criteria" -> " size = 2"
key = "criteria"
value = {ArrayList@29934} size = 2
0 = {LinkedHashMap@29936} size = 3
0 = {LinkedHashMap$Entry@29940} "fieldName" -> "1"
1 = {LinkedHashMap$Entry@29941} "operator" -> "iContains"
2 = {LinkedHashMap$Entry@29942} "value" -> "Dale"
1 = {LinkedHashMap@29937} size = 3
0 = {LinkedHashMap$Entry@29951} "fieldName" -> "2"
1 = {LinkedHashMap$Entry@29952} "operator" -> "iContains"
2 = {LinkedHashMap$Entry@29953} "value" -> "E"
Does not contains a __$$__PRIM_CUST_REF entry
Is this what you would expect or is this a bug?
Thanks,
Dale
GWT Version : | 2.7.0 |
SmartGWT Version : | 5.1p |
SmartGWT Build Date : | 01/12/2016 06:19 |
Comment