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

Different behaviours of valuesHaveChanged

$
0
0
I have 2 different behaviours for the dynamicForm.valuesHaveChanged.

My testcase:
Code:

public void onModuleLoad() {

                final DynamicForm df = new DynamicForm();
                final TextItem item = new TextItem("mytextitem");
                df.setItems(item);
                VLayout vlayout = new VLayout();
                vlayout.addMember(df);
                IButton button = new IButton("Click me");
                button.addClickHandler(new ClickHandler() {

                        @Override
                        public void onClick(ClickEvent event) {
                                //item.setValue("new value");
                                //Map<String,Object> values = new HashMap<String,Object>();
                                //values.put("mytextitem", "new value");
                                df.setValue("mytextitem", "new value");
                                SC.say("Values have changed: " + df.valuesHaveChanged());
                        }
                });
                vlayout.addMember(button);
                vlayout.draw();
        }

If I change the value with
Code:

df.setValue("mytextitem", "new value");
or
Code:

item.setValue("new value");
the df.valuesHaveChanged() returns true.

If I change the value with
Code:

Map<String,Object> values = new HashMap<String,Object>();
values.put("mytextitem", "new value");

then df.valuesHaveChanged returns false.

Is this a correct behaviour? It is not consistent...

Using Smartgwt v9.1p_2014-08-19 Power edition.

Viewing all articles
Browse latest Browse all 4756

Trending Articles