Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

Bug: ChangeOnKeypress not working for DateTimeItems if useMask is set to true

$
0
0
Hi

If looked through the documentation of both 'setChangeOnKeypress' and 'setUseMask' but couldn't find anything indicating that change events won't be fired if both are set to true.

So i suspect this is a bug.

Here's a quick test class to reproduce the issue:

Code:

public class Test implements EntryPoint {

        @Override
        public void onModuleLoad() {

                final Layout layout = new Layout();
                final DynamicForm form = new DynamicForm();
                final DateTimeItem item = new DateTimeItem("testName", "testTitle"){
                        {
                                setUseTextField(true);
                                setChangeOnKeypress(true);
                                setUseMask(true);
                                setValue(new Date());
                                addChangedHandler(new ChangedHandler() {
                                       
                                        @Override
                                        public void onChanged(ChangedEvent event) {
                                                SC.say("Changed fired");
                                        }
                                });
                                addChangeHandler(new ChangeHandler() {
                                       
                                        @Override
                                        public void onChange(ChangeEvent event) {
                                                SC.say("Change fired");
                                        }
                                });
                        }
                };
                form.setItems(item);
                layout.addMember(form);
                layout.draw();
        }
}

If both 'setChangeOnKeypress' and 'setUseMask' are set to true, no change or changed events are fired on keypress.
If i set 'setUseMask' back to false, both events fire as expected.

I'm currently using the latest build available (27.05.2015).

Best regards,
Seraksab

Viewing all articles
Browse latest Browse all 4756

Trending Articles