Announcement

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

    Issue while tabbing among text items with picker icons and editor value formater

    Hi,

    I'm using smartgwt-3.1p.2012-11-27.

    I need to use in a form a text item with an internal value and a display value and additinally with some picker icons. To create the display value based on the internal value I use setEditorValueFormatter.
    I also need to keep the item disabled/read only but the picker icons enabled.
    While using tab to change the focus between all the form items I've seen that the value of the item becomes its display value. And that happens exactly when the focus is on the picker icon.
    I succeded to reproduce the problem in the Picker Icons example from the Smartgwt showcase.
    I attach the PickerControlsSample.java file with my changes.
    After loading the example the text items show "Display Value" and hovers show "value=Internal Value". After using the tab to change the focus between the items the hovers show "value=Display Value".
    1. Is it a bug? If yes, when can be solved?
    2. While tabbing among the items I have seen that even if one item is disabled, when its icon gets the focus then also the item looks like enabled. Is this also a problem?

    Regards,
    Mihnea
    Attached Files

    #2
    Hi Mihnea,
    1) The problem here is not actually related to the icons - it's simply the fact that you have an editorFormatter defined but no editorParser. If you add an editorParser which understands the formatted value and maps back to the expected data value things should behave properly.

    2) This is due to the fact that we're applying focused styling when the form item (or an icon thereof) receives focus, even if the item is marked as disabled. We agree that it's a little confusing in this example and will consider whether to change this behavior in the future.
    For now however you can avoid this by setting showFocused to false on your item.

    Regards
    Isomorphic Software

    Comment


      #3
      1) We cannot use the EditorValueParser because our internal value is a JSON value like [{name="name1", id="id1", type="t1"}, {name="name2", id="id2", type="t2"}] and the display value is "name1,name2".
      The internal value comes from a custom select dialog and we have to send it to the server when we do an add/update operation. On fetch operation we create a custom criteria based on the JSON internal value.
      It seems to me that using the EditorValueFormater and Parser and a TextItem is not the right approach. Could you please recommend us a solution for this situation?

      Regards,
      Mihnea

      Comment


        #4
        If you're saying that the value entered by the user doesn't contain the complete data necessary to reconstruct the internal value, then you need to separately store whatever additional data is needed.

        The parser/formatter data must round-trip the value properly, or there is no way the FormItem can support any of it's other features (change events and everything that flows from these).

        Comment

        Working...
        X