Announcement

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

    Problem at ComboBoxItem with optionsDataSource and fetchMissingValues=[true]

    I have a ComboBoxItem added to DynamicForm.
    I set fetchMissingValues=true, autoFetch=false
    Also the ComboBoxItem has displayProperty and valueProperty.

    When I set value to the combobox with a record containing attributes for display and value properties, no value rendered at the combobox and it appears empty and this warning messages logged at developer console "FetchMissingValues - filterLocally is false yet optionDataSource fetch included records that do not match our current data value. Ignoring these values."

    After investigations i found that, when set fetchMissingValues=true combobox tries to fetch the the record i already set as value with extra request, i handled the fetch request from server side to return the record from server expecting that when the fetch request returns correct response the value will appears at combobox.
    But this doesn't happens and i still have same warning logged at developer console

    I need to know what is missing to make values appears on combobox item, appreciating your kind feedback
    Regards,

    SmartClient Version: v9.0_2013-07-03/LGPL Development Only (built 2013-07-03)
    Last edited by apateer; 13 May 2014, 05:26. Reason: spilling mistakes

    #2
    When I set value to the combobox with a record containing attributes for display and value properties,
    If, by this, you mean you're calling setValue() with a Record, this is never correct. setValue() should always be passed a value for the valueField.

    If you want to pre-fetch a particular valueField/displayField pair, you can set a valueMap that includes that pair (in addition to providing the optionDataSource and other settings).

    Comment


      #3
      i didn't use setValue(), the ComboBoxItem is bounded to a record called Customer which wrapped in a parent record SalesOrder.
      i pass the parent record (SalesOreder) to the form containing the ComboBoxItem by calling form.editRecord(parentRecord).

      i am expecting to bind the customer record with the comboboxitem and show display property at the comboboxitem. but this didn't happens.

      Comment


        #4
        If your ComboBoxItem is using an optionDataSource that provides Customer records, it would not be expected to take a value from a SalesOrder record and assume it's a valid display value, even if the field names are the same. The system has no way of determining that it is valid to do this.

        Again, if it happens to be valid to do this, and you want to implement this minor optimization, you can provide a single-entry valueMap.

        If you think there's any framework issue here, put together a minimal, ready-to-run test case and make sure it's tested against the latest patched build of 9.1.

        Comment


          #5
          ok, i got your point.
          but i still have a question about how fetchMissingValues works, as i provided a valid record when fetch missing value request submitted to server, but the returned record considered as invalid value.

          thanks alot for you patience :)

          Comment


            #6
            You've been very vague about what you are returning from the server when fetchMissingValues, but whatever it is, it's almost certainly invalid or your settings are wrong. There are lots and lots of tests of this very basic aspect of the fetchMissingValues functionality, and every user with a ComboBox or SelectItem with an optionDataSource is successfully using it.

            Comment


              #7
              I am not debating that it is not working, certainly i misunderstood something.
              server implementation returns a customer record, that contains attribute for displayvalue set for combobox.

              in other words, what is expected to be returned from fetchMissingValues request, as i am returning customer record but it doesn't work ?

              Comment


                #8
                What you're describing in prose sounds correct.

                Whatever is actually set on your comboBox and being returned from the server must not be.

                It's useless to go further without a test case..

                Comment

                Working...
                X