Announcement

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

    Problem with ListGrid and Select

    SmartClient Version: v8.3p_2012-12-12/LGPL Development Only (built 2012-12-12)
    Browser: any

    Following situation:
    - we have an own DataSource-Implementation (JSON based)
    - I defined a ListGridField with setMultiple(true) (did the same on the underlying DataSourceField)
    - I defined a SelectItem as FilterEditor backed with an own implementation for querying values

    What happens?
    When the list loads, the filter is built the way I suspect it: I see a dropdown with checkboxes displaying the value names and if I select one (or more) values the IDs get to the server - works great.
    If I look at each row, I can see three different values:
    - nothing, if the corresponding value is null / empty -> ok
    - the value name if there is exact one value in the array -> ok
    - a comma separated list of IDs if there are two or more values in the array -> wtf?

    Now I activated the inline Editor - the dropdown there is like the one in the filter - works great with correct displayed values and correct submitted IDs if I change something, the correct IDs get send to my server. What's also somehow strange - if I change something in the Editor, the displayed value in the list after leaving the editor seems ok - I get an comma separted list of the display values. Also if there are two values set and I enter the Editor no value is selected, but if there's one value, it's selected.

    Everything looks fine - exepct that after initial loading the list, all fields with more than one value displaying the IDs and not the names :-(

    I double checked the data that was send from the server - it's an array with [], ["id4711"] or ["id4711","4713"] - seems right, or?

    So I think I missed something to define or so. I don't use "setDisplayField" for the DataSource, I use setValueMap (for SelectItem and ListGridField), setEditorValueMap (for listGridField) and setFilterEditorValueMap (for listGridField) and set in every case the map with ID-value-pairs...

    I made some screenshots (don't get confused - we use GUIDs, so DY272... is the ID and "Server" is the displayed name) and hope it will clarify it a bit).

    And here is the response (JSON) from the server (formatted raw response for listgrid fetch copied from developer console, snipped out some rows):
    Code:
    { "response": { "startRow":0, "endRow":22, "totalRows":23, "data":[
    {
    "unterasset_count":"0",
    "k_ms_nmassettyp$ms_ast_id":[]
    },{
    "unterasset_count":"0",
    "k_ms_nmassettyp$ms_ast_id":["DY27212ffX13b908f7b02XY7461","DY27212ffX13b908f7b02XY747d"]
    },
    [..snip..]
    {
    "unterasset_count":"0",
    "k_ms_nmassettyp$ms_ast_id":["DY27212ffX13b908f7b02XY747d"],
    }]
    }}
    Any hints are welcome...


    sidenote: it's hard to post sourcecode or an example where the situation will be clearer, because we wrapped the SmartGWT classes and the whole code is distributed between 7 to 10 classes...
    Attached Files
    Last edited by tsauer; 21 Jan 2013, 02:30. Reason: changed title for clarification

    #2
    No ideas? Anyone?

    Comment


      #3
      I updated to the (so far) latest nightly build (v8.3p_2013-01-22/LGPL Development Only (built 2013-01-22)) but the problem still exists...

      Has anyone a guess?

      Comment

      Working...
      X