Announcement

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

    CharacterCasing.UPPER not working for TextItem in a ToolStrip

    SmartClient Version: SC_SNAPSHOT-2011-01-26/EVAL Deployment

    I'm using CharacterCasing.UPPER on a variety of fields and forms where it is working fine. But when I set that attribute on a TextItem and put that item on a ToolStrip using ToolStrip.addFormItem() I can still type lowercase letters into the TextItem. I've verified using the developer console that the setting is being stored correctly. Here is the TextItem definition from the console.
    Code:
    Evaluator: result of 'isc_DynamicForm_5.items[0]' (1ms):
    TextItem{eventParent: [DynamicForm ID:isc_DynamicForm_5],
    containerWidget: [DynamicForm ID:isc_DynamicForm_5],
    form: [DynamicForm ID:isc_DynamicForm_5],
    name: "HONO",
    title: "PO number",
    editorType: "TextItem",
    characterCasing: "upper",
    wrapTitle: false,
    icons: Array[1],
    ID: "isc_TextItem_6",
    hasFocus: false,
    }

    #2
    This could happen if other event handlers on the item interfered. Can you cut this down to a test case and verify the behavior?

    Comment


      #3
      Ah, yes. I should have spotted that. We're using a keyPressHandler on that field in order to capture the user pressing the Enter key to trigger some processing. Is there a better way to do that? I don't see anything similar to setSaveOnEnter() for a ToolStrip.

      Here is the keyPressHandler. Is there something we could do there to force uppercase?
      Code:
      searchItem.addKeyPressHandler(new KeyPressHandler() {				
      	@Override
      	public void onKeyPress(KeyPressEvent event) {
      		
      		if ("Enter".equals(event.getKeyName()))
      				triggerSearch();
      	}
      });

      Comment


        #4
        This is fixed in the next nightly (01/29). The keypress handler is called prior to any filtering or casing changes.

        Comment

        Working...
        X