Announcement

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

    DsRequest criteria string showing up as an array

    Hummm, why am I seeing criteria strings coming through as arrays on my production server?
    Interesting enough I don't see it on my development machine (Windows vs Linux?)

    Code:
    === 2011-10-28 15:39:44,407 [ec-5] DEBUG RPCManager - Request #1 (DSRequest) payload: {
        criteria:{
            clientName:{
                "0":"W",
                "1":"a",
                "2":"l",
                "3":"g",
                "4":"r",
                "5":"e",
                "6":"e",
                "7":"n",
                "8":"s",
                cM:{
                    "1":1,
                    "108":1,
                    "109":1,
                    "110":1
                }
            }
        },
    The following is what I have on the client side to set the SelectList option's data source.
    Code:
    selectItem.setOptionCriteria(new Criteria("clientName", comboBoxItem.getValue().toString()));

    #2
    This is due to a core GWT bug where toString() when called on a String turns the String into a "String Object". Remove the unnecessary toString() call to fix.

    Comment


      #3
      That did fix the problem when setting the criteria.

      However, how to fix this when criteria is being sent automatically by a ComboBoxItem.

      Note: I typed "Rub" in the combo box.

      Code:
      clientNameComboBoxItem = new ComboBoxItem(CustomerDataField.NAME, "Customer Name");
      clientNameComboBoxItem.setOptionDataSource(DataSource.get("clientName"));
      clientNameComboBoxItem.setSortField(CustomerDataField.NAME);
      Code:
      _transaction
      <transaction xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance" xsi:type="xsd:Object">
          <transactionNum xsi:type="xsd:long">33</transactionNum>
          <operations xsi:type="xsd:List">
              <elem xsi:type="xsd:Object">
                  <criteria xsi:type="xsd:Object">
                      <clientName xsi:type="xsd:Object">
                          <Object _isc_name="0">R</Object>
                          <Object _isc_name="1">u</Object>
                          <Object _isc_name="2">b</Object>
                          <cM xsi:type="xsd:Object">
                              <Object _isc_name="1" xsi:type="xsd:long">1</Object>
                              <Object _isc_name="108" xsi:type="xsd:long">1</Object>
                              <Object _isc_name="109" xsi:type="xsd:long">1</Object>
                              <Object _isc_name="110" xsi:type="xsd:long">1</Object>
                          </cM>
                      </clientName>
                  </criteria>
                  <operationConfig xsi:type="xsd:Object">
                      <dataSource>catEnvironment</dataSource>
                      <operationType>fetch</operationType>
                      <textMatchStyle>startsWith</textMatchStyle>
                  </operationConfig>
                  <startRow xsi:type="xsd:long">0</startRow>
                  <endRow xsi:type="xsd:long">75</endRow>
                  <sortBy xsi:type="xsd:List">
                      <elem>name</elem>
                  </sortBy>
                  <componentId>isc_PickListMenu_0</componentId>
                  <appID>builtinApplication</appID>
                  <operation>catEnvironment_fetch</operation>
                  <oldValues xsi:type="xsd:Object">
                      <clientName xsi:type="xsd:Object">
                          <Object _isc_name="0">R</Object>
                          <Object _isc_name="1">u</Object>
                          <Object _isc_name="2">b</Object>
                          <cM xsi:type="xsd:Object">
                              <Object _isc_name="1" xsi:type="xsd:long">1</Object>
                              <Object _isc_name="108" xsi:type="xsd:long">1</Object>
                              <Object _isc_name="109" xsi:type="xsd:long">1</Object>
                              <Object _isc_name="110" xsi:type="xsd:long">1</Object>
                          </cM>
                      </clientName>
                  </oldValues>
              </elem>
          </operations>
      </transaction>

      Comment


        #4
        The ComboBoxItem doesn't send criteria like that automatically. You've customized it in some way, and your customizations are making a call to toString() which is causing this problem. It may be difficult to spot, so work toward creating a minimal test case to find the problem.

        Comment


          #5
          Note, the core GWT bug that causes this was fixed in GWT 2.5.

          Comment

          Working...
          X