Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    fetchMissingValue not performed when value missing display value

    Hi Isomorphic,

    We are struggling with the fetch missing display value behaviour for a ComboBoxItem using an option DataSource (autoFetchData=false).

    For example, if we view record1 in the Form, the ComboBoxItem fetches the missing display value. If we click the ComboBoxItem drop-down, a fetch for the options is made (autoFetchData=false). If we then view record2 in the Form (i.e. editRecord(record2)), the ComboBoxItem will not fetch the missing display value (value different from record1), even with (alwaysFetchMissingValues=true). We suspect that maybe the pick list believes it has all the data and therefore, assumes there is no need to fetch the missing display values any more. If we do not click the drop-down to fetch/populate the options, the ComboBoxItem continues to fetch missing display values.

    In our use case, there is no guarantee the drop-down options (fetched and populated only when the user clicks the drop-down) will include the display value for the current value, however, the fetch for a display value of a specific value is guaranteed to return the display value if one exists. If the ComboBoxItem cannot find a display value for the current value, we want to it always make a fetch for the missing display value regardless.

    Can you please suggest a way we might force the ComboBoxItem to always make the fetch for a missing display value? We thought (alwaysFetchMissingValues=true) would solve it, but it did not.

    Thanks


    #2
    SmartClient Version: v10.1p_2016-04-20/Pro Deployment (built 2016-04-20)

    Comment


      #3
      The ComboBoxItem is already designed to fetch missing values as needed. If you are seeing a situation where this is not happening, it's either a bug or a problem with your application code. Either way, you should work toward making it reproducible.

      Comment


        #4
        To throw one random theory out there - perhaps record1 and record2 have the same value the valueField. If so, the ComboBoxItem will not fetch again. This is correct behavior, as pairs of values for the valueField and displayField must be unique.

        Comment


          #5
          Different values for sure, so will try to isolate a test case to reproduce the behaviour.
          Thanks

          Comment


            #6
            Hi Isomorphic,

            Here is a test case to reproduce the unexpected behaviour we are seeing with the fetching of missing values.

            Please load the provided entry point, and perform the following steps.

            1. Click on list record Item15, the missing display value is fetched for Ref form item value 15.
            2. Click on list record Item14, the missing display value is fetched for Ref form item value 14.
            3. Click on the drop-down for Ref form item, the drop-down is populated with RefItem1 through RefItem10.
            4. Click on list record Item13, the missing display value is NOT fetched for Ref form item value 13; the value of 13 is displayed in place of the display value.

            Thank you

            Sandbox8 EntryPoint
            Code:
              public class Sandbox8 implements EntryPoint {
              
                  @Override
                  public void onModuleLoad() {
                      DataSource clientDs = new DataSource();
                      clientDs.setClientOnly(true);
                      clientDs.setID("sandbox8_client");
                      DataSourceIntegerField idField = new DataSourceIntegerField("id");
                      idField.setPrimaryKey(true);
                      DataSourceTextField nameField = new DataSourceTextField("name");
                      DataSourceTextField refNameField = new DataSourceTextField("refName");
                      DataSourceTextField refField = new DataSourceTextField("ref");
                      refField.setForeignKey("sandbox8.id");
                      refField.setDisplayField("refName");
                      clientDs.setFields(idField, nameField, refNameField, refField);
              
                      ListGridRecord record;
                      List<ListGridRecord> recordList = new ArrayList<ListGridRecord>();
                      for (int i = 1; i <= 15; i++) {
                          record = new ListGridRecord();
                          record.setAttribute("id", i);
                          record.setAttribute("name", "item" + i);
                          record.setAttribute("refName", "refItem" + i);
                          record.setAttribute("ref", i);
                          recordList.add(record);
                      }
              
                      clientDs.setCacheData(recordList.toArray(new ListGridRecord[recordList.size()]));
              
                      final ListGrid list = new ListGrid();
                      list.setWidth100();
                      list.setHeight100();
                      list.setDataSource(clientDs);
                      list.setDataFetchMode(FetchMode.PAGED);
                      list.setAutoFitFieldsFillViewport(Boolean.TRUE);
                      list.setAutoFitWidthApproach(AutoFitWidthApproach.BOTH);
                      list.setAutoFitFieldWidths(Boolean.TRUE);
                      list.setCanFreezeFields(Boolean.FALSE);
                      list.setCanGroupBy(Boolean.FALSE);
                      list.setRecordComponentPoolingMode(RecordComponentPoolingMode.RECYCLE);
                      list.setAlternateRecordStyles(Boolean.TRUE);
                      list.setAutoFetchData(Boolean.TRUE);
                      list.setShowRollOver(Boolean.FALSE);
              
                      list.setDefaultFields(new ListGridField("id"), new ListGridField("name"), new ListGridField("ref"));
              
                      final DynamicForm form = new DynamicForm();
                      list.addRecordClickHandler(new RecordClickHandler() {
                          @Override
                          public void onRecordClick(RecordClickEvent event) {
                              ListGridRecord[] selectedRecords = list.getSelectedRecords();
                              if (selectedRecords != null && selectedRecords.length == 1) {
                                  form.editNewRecord(selectedRecords[0]);
                              }
                          }
                      });
                      form.setDataSource(clientDs);
                      form.setNumCols(2);
                      form.setWidth100();
                      form.setHeight100();
                      IntegerItem idItem = new IntegerItem("id");
                      idItem.setWidth("*");
                      TextItem nameItem = new TextItem("name");
                      nameItem.setWidth("*");
                      ComboBoxItem referenceItem = new ComboBoxItem("ref");
                      referenceItem.setWidth("*");
              
                      ListGrid pickListProperties = new ListGrid();
                      pickListProperties.setCanFreezeFields(Boolean.FALSE);
                      pickListProperties.setCanGroupBy(Boolean.FALSE);
                      pickListProperties.setAlternateRecordStyles(Boolean.TRUE);
                      pickListProperties.setCanSort(Boolean.FALSE);
                      referenceItem.setValueField("id");
              
                      String foreignDisplayField = "name";
                      referenceItem.setForeignDisplayField(foreignDisplayField);
                      ListGridField listGridDisplayField = new ListGridField(foreignDisplayField);
                      ListGridField listGridIdField = new ListGridField("id");
                      listGridIdField.setHidden(Boolean.TRUE);
                      ListGridField[] gridFields = new ListGridField[] { listGridDisplayField };
                      referenceItem.setAddUnknownValues(Boolean.FALSE);
                      referenceItem.setCachePickListResults(Boolean.FALSE);
                      referenceItem.setAutoFetchData(Boolean.FALSE);
                      referenceItem.setPickListFields(gridFields);
                      referenceItem.setPickListProperties(pickListProperties);
              
                      form.setFields(idItem, nameItem, referenceItem);
              
                      VLayout vLayout = new VLayout();
                      vLayout.setWidth100();
                      vLayout.setHeight100();
                      vLayout.addMember(list);
                      vLayout.addMember(form);
                      vLayout.show();
                  }
              }
            Sandbox8DS
            Code:
              public class Sandbox8DS {
              
                  public Sandbox8DS() {}
              
                  public DSResponse fetch(final DSRequest req) {
                      Long id = getCriteriaValueAsLong(req, "id");
                      DSResponse resp = new DSResponse();
                      if (id != null) {
                          resp.setStartRow(0);
                          resp.setEndRow(1);
                          resp.setTotalRows(1);
                          List<Map<String, Object>> rList = new ArrayList<>();
                          HashMap<String, Object> r = new HashMap<String, Object>();
                          r.put("id", id);
                          r.put("name", "refItem" + id);
                          rList.add(r);
                          resp.setData(rList);
                      } else {
                          resp.setStartRow(0);
                          resp.setEndRow(10);
                          resp.setTotalRows(10);
                          resp.setData(getTestData());
                      }
                      return resp;
                  }
              
                  private List<Map<String, Object>> getTestData() {
                      List<Map<String, Object>> rList = new ArrayList<>();
                      HashMap<String, Object> r;
                      for (long i = 1; i <= 10; i++) {
                          r = new HashMap<String, Object>();
                          r.put("id", new Long(i));
                          r.put("name", "refItem" + i);
                          rList.add(r);
                      }
                      return rList;
                  }
              
                  protected static Long getCriteriaValueAsLong(DSRequest req, String fieldName) {
                      AdvancedCriteria criteria = req.getAdvancedCriteria();
                      if (criteria == null) return null;
                      Set<Criterion> criterions = criteria.getFieldCriterions(fieldName);
                      if ((criterions == null) || criterions.isEmpty()) return null;
                      if (criterions.size() == 1) {
                          Criterion criterion = criterions.toArray(new Criterion[criterions.size()])[0];
                          Object criterionValue = criterion.getValue();
                          if (criterionValue == null) return null;
                          if (criterionValue instanceof Long) return (Long) criterionValue;
                      }
                      return null;
                  }
              }
            sandbox8.ds.xml
            Code:
              <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
              <DataSource xmlns:fmt="WEB-INF/" ID="sandbox8" serverType="generic">
                  <fields>
                      <field name="id" type="text" primaryKey="true" canEdit="false">
                          <title>UUID</title>
                      </field>
                      <field name="name" type="text" length="255" required="true">
                          <title>Name</title>
                      </field>
                  </fields>
                  <serverObject lookupStyle="new" className="com.sandbox.server.Sandbox8DS"/>
              </DataSource>
            Last edited by stonebranch2; 21 Apr 2016, 07:41. Reason: Changed DataSource.get("sandbox8_client") to clientDs.

            Comment


              #7
              Hi Isomorphic,
              Any luck reproducing the issue with the provided test case?
              Thanks

              Comment


                #8
                Hi,
                We're not actually reproducing this problem with the attached test case.
                Firstly - the ComboBoxItem (the "ref" item in the form) doesn't show any values in its drop down for us if the code is loaded unaltered. We had to add an explicit optionDataSource to the item (set to clientDs).
                Having done this we still don't reproduce the behavior you describe.

                Could you sanity check the test case and let us know if we are perhaps missing something here?

                Thanks
                Isomorphic Software

                Comment


                  #9
                  Hi Isomorphic,

                  I will repost the sample, including the imports. I recompiled with the latest nightly, and the sample is still functioning for me, and the problem still persists.

                  I am also including some screen captures.

                  Screen Captures

                  Click image for larger version

Name:	step1.jpg
Views:	211
Size:	25.2 KB
ID:	237396

                  Click image for larger version

Name:	step2.jpg
Views:	200
Size:	26.4 KB
ID:	237392

                  Click image for larger version

Name:	step3.jpg
Views:	201
Size:	25.3 KB
ID:	237394

                  Click image for larger version

Name:	step4.jpg
Views:	236
Size:	23.8 KB
ID:	237395

                  Click image for larger version

Name:	step5.jpg
Views:	207
Size:	26.5 KB
ID:	237393



                  Sandbox8 EntryPoint
                  Code:
                  package com.sandbox.client;
                  
                  import java.util.ArrayList;
                  import java.util.List;
                  
                  import com.google.gwt.core.client.EntryPoint;
                  import com.smartgwt.client.data.DataSource;
                  import com.smartgwt.client.data.fields.DataSourceIntegerField;
                  import com.smartgwt.client.data.fields.DataSourceTextField;
                  import com.smartgwt.client.types.AutoFitWidthApproach;
                  import com.smartgwt.client.types.FetchMode;
                  import com.smartgwt.client.types.RecordComponentPoolingMode;
                  import com.smartgwt.client.widgets.form.DynamicForm;
                  import com.smartgwt.client.widgets.form.fields.ComboBoxItem;
                  import com.smartgwt.client.widgets.form.fields.IntegerItem;
                  import com.smartgwt.client.widgets.form.fields.TextItem;
                  import com.smartgwt.client.widgets.grid.ListGrid;
                  import com.smartgwt.client.widgets.grid.ListGridField;
                  import com.smartgwt.client.widgets.grid.ListGridRecord;
                  import com.smartgwt.client.widgets.grid.events.RecordClickEvent;
                  import com.smartgwt.client.widgets.grid.events.RecordClickHandler;
                  import com.smartgwt.client.widgets.layout.VLayout;
                  
                  public class Sandbox8 implements EntryPoint {
                  
                      @Override
                      public void onModuleLoad() {
                          DataSource clientDs = new DataSource();
                          clientDs.setClientOnly(true);
                          clientDs.setID("sandbox8_client");
                          DataSourceIntegerField idField = new DataSourceIntegerField("id");
                          idField.setPrimaryKey(true);
                          DataSourceTextField nameField = new DataSourceTextField("name");
                          DataSourceTextField refNameField = new DataSourceTextField("refName");
                          DataSourceTextField refField = new DataSourceTextField("ref");
                          refField.setForeignKey("sandbox8.id");
                          refField.setDisplayField("refName");
                          clientDs.setFields(idField, nameField, refNameField, refField);
                  
                          ListGridRecord record;
                          List<ListGridRecord> recordList = new ArrayList<ListGridRecord>();
                          for (int i = 1; i <= 15; i++) {
                              record = new ListGridRecord();
                              record.setAttribute("id", i);
                              record.setAttribute("name", "item" + i);
                              record.setAttribute("refName", "refItem" + i);
                              record.setAttribute("ref", i);
                              recordList.add(record);
                          }
                  
                          clientDs.setCacheData(recordList.toArray(new ListGridRecord[recordList.size()]));
                  
                          final ListGrid list = new ListGrid();
                          list.setWidth100();
                          list.setHeight100();
                          list.setDataSource(clientDs);
                          list.setDataFetchMode(FetchMode.PAGED);
                          list.setAutoFitFieldsFillViewport(Boolean.TRUE);
                          list.setAutoFitWidthApproach(AutoFitWidthApproach.BOTH);
                          list.setAutoFitFieldWidths(Boolean.TRUE);
                          list.setCanFreezeFields(Boolean.FALSE);
                          list.setCanGroupBy(Boolean.FALSE);
                          list.setRecordComponentPoolingMode(RecordComponentPoolingMode.RECYCLE);
                          list.setAlternateRecordStyles(Boolean.TRUE);
                          list.setAutoFetchData(Boolean.TRUE);
                          list.setShowRollOver(Boolean.FALSE);
                  
                          list.setDefaultFields(new ListGridField("id"), new ListGridField("name"), new ListGridField("ref"));
                  
                          final DynamicForm form = new DynamicForm();
                          list.addRecordClickHandler(new RecordClickHandler() {
                              @Override
                              public void onRecordClick(RecordClickEvent event) {
                                  ListGridRecord[] selectedRecords = list.getSelectedRecords();
                                  if (selectedRecords != null && selectedRecords.length == 1) {
                                      form.editNewRecord(selectedRecords[0]);
                                  }
                              }
                          });
                          form.setDataSource(clientDs);
                          form.setNumCols(2);
                          form.setWidth100();
                          form.setHeight100();
                          IntegerItem idItem = new IntegerItem("id");
                          idItem.setWidth("*");
                          TextItem nameItem = new TextItem("name");
                          nameItem.setWidth("*");
                          ComboBoxItem referenceItem = new ComboBoxItem("ref");
                          referenceItem.setWidth("*");
                  
                          ListGrid pickListProperties = new ListGrid();
                          pickListProperties.setCanFreezeFields(Boolean.FALSE);
                          pickListProperties.setCanGroupBy(Boolean.FALSE);
                          pickListProperties.setAlternateRecordStyles(Boolean.TRUE);
                          pickListProperties.setCanSort(Boolean.FALSE);
                          referenceItem.setValueField("id");
                  
                          String foreignDisplayField = "name";
                          referenceItem.setForeignDisplayField(foreignDisplayField);
                          ListGridField listGridDisplayField = new ListGridField(foreignDisplayField);
                          ListGridField listGridIdField = new ListGridField("id");
                          listGridIdField.setHidden(Boolean.TRUE);
                          ListGridField[] gridFields = new ListGridField[] { listGridDisplayField };
                          referenceItem.setAddUnknownValues(Boolean.FALSE);
                          referenceItem.setCachePickListResults(Boolean.FALSE);
                          referenceItem.setAutoFetchData(Boolean.FALSE);
                          referenceItem.setPickListFields(gridFields);
                          referenceItem.setPickListProperties(pickListProperties);
                          referenceItem.setFetchMissingValues(Boolean.TRUE);
                          referenceItem.setAlwaysFetchMissingValues(Boolean.TRUE);
                  
                          form.setFields(idItem, nameItem, referenceItem);
                  
                          VLayout vLayout = new VLayout();
                          vLayout.setWidth100();
                          vLayout.setHeight100();
                          vLayout.addMember(list);
                          vLayout.addMember(form);
                          vLayout.show();
                      }
                  }
                  Sandbox8DS
                  Code:
                  package com.sandbox.server;
                  
                  import java.util.ArrayList;
                  import java.util.HashMap;
                  import java.util.List;
                  import java.util.Map;
                  import java.util.Set;
                  
                  import com.isomorphic.criteria.AdvancedCriteria;
                  import com.isomorphic.criteria.Criterion;
                  import com.isomorphic.datasource.DSRequest;
                  import com.isomorphic.datasource.DSResponse;
                  
                  public class Sandbox8DS {
                  
                      public Sandbox8DS() {}
                  
                      public DSResponse fetch(final DSRequest req) {
                          Long id = getCriteriaValueAsLong(req, "id");
                          DSResponse resp = new DSResponse();
                          if (id != null) {
                              resp.setStartRow(0);
                              resp.setEndRow(1);
                              resp.setTotalRows(1);
                              List<Map<String, Object>> rList = new ArrayList<>();
                              HashMap<String, Object> r = new HashMap<String, Object>();
                              r.put("id", id);
                              r.put("name", "refItem" + id);
                              rList.add(r);
                              resp.setData(rList);
                          } else {
                              resp.setStartRow(0);
                              resp.setEndRow(10);
                              resp.setTotalRows(10);
                              resp.setData(getTestData());
                          }
                          return resp;
                      }
                  
                      private List<Map<String, Object>> getTestData() {
                          List<Map<String, Object>> rList = new ArrayList<>();
                          HashMap<String, Object> r;
                          for (long i = 1; i <= 10; i++) {
                              r = new HashMap<String, Object>();
                              r.put("id", new Long(i));
                              r.put("name", "refItem" + i);
                              rList.add(r);
                          }
                          return rList;
                      }
                  
                      protected static Long getCriteriaValueAsLong(DSRequest req, String fieldName) {
                          AdvancedCriteria criteria = req.getAdvancedCriteria();
                          if (criteria == null) return null;
                          Set<Criterion> criterions = criteria.getFieldCriterions(fieldName);
                          if ((criterions == null) || criterions.isEmpty()) return null;
                          if (criterions.size() == 1) {
                              Criterion criterion = criterions.toArray(new Criterion[criterions.size()])[0];
                              Object criterionValue = criterion.getValue();
                              if (criterionValue == null) return null;
                              if (criterionValue instanceof Long) return (Long) criterionValue;
                          }
                          return null;
                      }
                  }
                  sandbox8.ds.xml
                  Code:
                  <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
                  <DataSource xmlns:fmt="WEB-INF/" ID="sandbox8" serverType="generic">
                      <fields>
                          <field name="id" type="text" primaryKey="true" canEdit="false">
                              <title>UUID</title>
                          </field>
                          <field name="name" type="text" length="255" required="true">
                              <title>Name</title>
                          </field>
                      </fields>
                      <serverObject lookupStyle="new" className="com.sandbox.server.Sandbox8DS"/>
                  </DataSource>
                  ​

                  Comment


                    #10
                    Thanks for reiterating everything. We finally got to the bottom of this and it is a problem with your custom dataSource.
                    When the client issues a fetch request with an 'id' value, the server logic for the sandbox8 ds will return a single matching result. This works for any id (including values greater than 10)
                    When the client issues an unbounded fetch request, the server logic returns 10 records, with ids from 1-10.

                    This is inconsistent and trips up the client side logic.
                    When a user loads a record into the form, this field's display value is picked up by fetching a matching record from the server. For record 15 (for example) this is being returned with an associated display value which we then use.
                    However, an unbounded fetch (which occurs when the user shows the pick-list for the item) indicates there are 10 total rows on the server.
                    This is then remembered by the client and we switch into using this as a definitive cache to avoid unnecessary additional fetches to the server - leading to the behavior you're seeing.

                    You can fix this in the sample by fixing the server logic - something like this:

                    Code:
                        public DSResponse fetch(final DSRequest req) {
                            Long id = getCriteriaValueAsLong(req, "id");
                            DSResponse resp = new DSResponse();
                            if (id != null) {
                                
                                if (id <= 0 || id > 10) {
                                    resp.setStartRow(0);
                                    resp.setEndRow(0);
                                    resp.setTotalRows(0);
                                    return resp;
                                }
                                resp.setStartRow(0);
                                resp.setEndRow(1);
                                resp.setTotalRows(1);
                                List<Map<String, Object>> rList = new ArrayList<>();
                                HashMap<String, Object> r = new HashMap<String, Object>();
                                r.put("id", id);
                                r.put("name", "refItem" + id);
                                rList.add(r);
                                resp.setData(rList);
                            } else {
                                resp.setStartRow(0);
                                resp.setEndRow(10);
                                resp.setTotalRows(10);
                                resp.setData(getTestData());
                            }
                            return resp;
                        }

                    Comment


                      #11
                      Hi Isomorphic,

                      With that change, the display value for 11 through 15 now displays as raw values; it actually broke those.

                      Furthermore, this is sample code to demonstrate our issue. We cannot make a specific assumption like your recommendation would assume, even if it worked under this specific sample.

                      Your explanation of the problem, client thinks it has a definitive cache so it will not longer fetch a missing display value, is what we assumed the issue was, however, we would like control over that, and we thought alwaysFetchMissingValues might be the answer to that problem.

                      For us, the optimization here to avoid fetching a missing display value once the client thinks it has a definitive cache is problematic because the drop-down options are not guaranteed to contain the currently selected option for a particular record; it all depends on the user viewing the record. However, the user still needs to be able to see what the record is configured for, hence, regardless of the definitive cache, we want missing display values to be fetched. And....this all works fine, of course, until the user decides to click and populate the drop-down with their selectable options.

                      Is there any way we can have more control over this?

                      Thanks

                      Comment


                        #12
                        Ah - this clarifies things a lot.
                        You are intentionally returning a subset of values for display in the pickList compared to what's available from the dataSource.
                        The pattern you're using to do this is not recommended - it is generally anticipated that a fetch request with no criteria returns the "full set" of available options for a particular DataSource operation.
                        Probably the easiest way to get what you're after is to use setPickListCriteria() on your FormItem - this will apply particular criteria to the options shown in the pickList (but won't interfere with the normal background fetch to retrieve display values for values that were set programatically).
                        If you need more advanced customization - for example the set of options to show in the pickList doesn't really translate to a simple set of criteria to apply, or you need custom logic to run on the server, you could use setPickListProperties() coupled with something like listGrid.setFetchOperation() to have the pickList use a custom fetch operation.

                        Regards
                        Isomorphic Software

                        Comment


                          #13
                          Thanks for the update, we will review, and consider our options here, and will post an update if/when we have any follow up comments/questions.

                          I will point out that while our sample does not use a custom fetch operation, our actual implementation does.

                          Code:
                                      referenceItem.setOptionOperationId(operationId);
                                      pickListProperties.setFetchOperation(operationId);
                          Last edited by stonebranch2; 2 May 2016, 14:49. Reason: Changed "fetch operation" to "custom fetch operation".

                          Comment


                            #14
                            Hi Isomorphic,

                            I have been experimenting with the sample, and I am experiencing some behaviour that doesn't seem correct.

                            For example, if I make the following change to the Sandbox8.java class, it certainly addresses the issue originally reported.

                            Code:
                                    referenceItem.setPickListCriteria(new AdvancedCriteria("id", OperatorId.NOT_NULL));
                            Then, if I click in the Ref: form item, and type "A", I see the following request, which looks correct. It combines my static criteria with name iContains "A" criteria.

                            Code:
                            {
                                dataSource:"sandbox8",
                                operationType:"fetch",
                                componentId:"isc_PickListMenu_0",
                                data:{
                                    operator:"and",
                                    criteria:[
                                        {
                                            fieldName:"id",
                                            operator:"notNull"
                                        },
                                        {
                                            operator:"and",
                                            criteria:[
                                                {
                                                    fieldName:"name",
                                                    operator:"iContains",
                                                    value:"A"
                                                }
                                            ]
                                        }
                                    ]
                                },
                                startRow:0,
                                endRow:75,
                                textMatchStyle:"startsWith",
                                resultSet:[ResultSet ID:isc_ResultSet_1 (dataSource: sandbox8, created by: isc_PickListMenu_0)],
                                callback:{
                                    caller:[ResultSet ID:isc_ResultSet_1 (dataSource: sandbox8, created by: isc_PickListMenu_0)],
                                    methodName:"fetchRemoteDataReply"
                                },
                                willHandleError:true,
                                showPrompt:false,
                                prompt:"Finding Records that match your criteria...",
                                oldValues:{
                                    operator:"and",
                                    criteria:[
                                        {
                                            fieldName:"id",
                                            operator:"notNull"
                                        },
                                        {
                                            operator:"and",
                                            criteria:[
                                                {
                                                    fieldName:"name",
                                                    operator:"iContains",
                                                    value:"A"
                                                }
                                            ]
                                        }
                                    ]
                                },
                                requestId:"sandbox8$6271",
                                internalClientContext:{
                                    requestIndex:1
                                },
                                fallbackToEval:false,
                                lastClientEventThreadCode:"TMR4",
                                bypassCache:true,
                                dataProtocol:"getParams"
                            }
                            However, if I simply hit the backspace key to clear the "A", and proceed with typing "B", a fetch is made, but the criteria appears incorrect. Can you explain what is happening with my criteria here? It doesn't appear to be properly combining the criteria here, like it did above.

                            Code:
                            {
                                dataSource:"sandbox8",
                                operationType:"fetch",
                                componentId:"isc_PickListMenu_0",
                                data:{
                                    fieldName:"id",
                                    operator:"notNull",
                                    name:"B"
                                },
                                startRow:0,
                                endRow:75,
                                textMatchStyle:"startsWith",
                                resultSet:[ResultSet ID:isc_ResultSet_1 (dataSource: sandbox8, created by: isc_PickListMenu_0)],
                                callback:{
                                    caller:[ResultSet ID:isc_ResultSet_1 (dataSource: sandbox8, created by: isc_PickListMenu_0)],
                                    methodName:"fetchRemoteDataReply"
                                },
                                willHandleError:true,
                                showPrompt:false,
                                prompt:"Finding Records that match your criteria...",
                                oldValues:{
                                    fieldName:"id",
                                    operator:"notNull",
                                    name:"B"
                                },
                                requestId:"sandbox8$6272",
                                internalClientContext:{
                                    requestIndex:2
                                },
                                fallbackToEval:false,
                                fetchID:0,
                                lastClientEventThreadCode:"TMR2",
                                bypassCache:true,
                                dataProtocol:"getParams"
                            }
                            Furthermore, I cannot seem to figure out how to override the operator from iContains to iStartsWith, which is the behaviour I need to preserve here.


                            On a side-note, there really is no true client-side filter to apply here for us; the fetch is handled by a custom fetch operation, it is not a simple set of criteria, and a special server-side logic applies. It would be a lot simpler for us to be able to tell the client to fetch missing display values regardless in our case, rather than workaround this. :(

                            Thanks
                            Last edited by stonebranch2; 2 May 2016, 19:24.

                            Comment


                              #15
                              The second set of criteria does indeed look broken. Presumably some logic to combine criteria is misbehaving.
                              We're taking a look and we'll let you know.

                              On the deeper question:
                              On a side-note, there really is no true client-side filter to apply here for us; the fetch is handled by a custom fetch operation, it is not a simple set of criteria, and a special server-side logic applies. It would be a lot simpler for us to be able to tell the client to fetch missing display values regardless in our case, rather than workaround this. :(
                              We'll also consider whether we see a framework change that might make sense here and let you know what we think.

                              Regards
                              Isomorphic Software

                              Comment

                              Working...
                              X