Well, this is complicated to explain but:
I have a textField
TextItem phoneTextIem = new TextItem("PhoneItem", " Phone ")
phoneTextItem.setKeyPressFilter("[0-9.]");
phoneTextItem.addChangedHandler(new ChangedHandler()
{
@Override public void onChanged(ChangedEvent event)
{
//this event will reveal the resulting value as a consequence of the change.
if(event.getValue == null || event.getValue().toString().isEmpty())
//Do Something Wonderfull
}
});
I have another TextItem upon which I set: setCharacterCasing(CharacterCasing.UPPER);
when values either of these 2 textItems becomes empty, due to user backspace, I want the ChangedEvent to fire.
But the changed event does NOT fire.
If I do not setKeyPressFilter("[0-9.]" or setCharacterCasing(CharacterCasing.UPPER)
Then the ChangeEvent fires.
How can I have the KeyPressFilter and the CharacterCasing on the textItems and catch the ItemChanged event when the BackSpace is used to empty either field.
I need to know the value of the TextItem that will result as a consequence of user input.
I hope this is clear.
I have a textField
TextItem phoneTextIem = new TextItem("PhoneItem", " Phone ")
phoneTextItem.setKeyPressFilter("[0-9.]");
phoneTextItem.addChangedHandler(new ChangedHandler()
{
@Override public void onChanged(ChangedEvent event)
{
//this event will reveal the resulting value as a consequence of the change.
if(event.getValue == null || event.getValue().toString().isEmpty())
//Do Something Wonderfull
}
});
I have another TextItem upon which I set: setCharacterCasing(CharacterCasing.UPPER);
when values either of these 2 textItems becomes empty, due to user backspace, I want the ChangedEvent to fire.
But the changed event does NOT fire.
If I do not setKeyPressFilter("[0-9.]" or setCharacterCasing(CharacterCasing.UPPER)
Then the ChangeEvent fires.
How can I have the KeyPressFilter and the CharacterCasing on the textItems and catch the ItemChanged event when the BackSpace is used to empty either field.
I need to know the value of the TextItem that will result as a consequence of user input.
I hope this is clear.
Comment