Question: Angular uses dirty checking to catch the data change and accordingly change the model or view. Ember sets observers to each elements to do this process.
But how does backbone do it?

Answer: 
This code works:

```
public class HomePage extends WebPage {

    private static final long serialVersionUID = 1L;

    private String someValue;
    private WebMarkupContainer container;

    public HomePage(final PageParameters parameters) {
        super(parameters);
        add(container = container());
        add(textfield());

    }

    private WebMarkupContainer container() {
        WebMarkupContainer wmc = new WebMarkupContainer("container") {

            @Override
            protected void onConfigure() {
                super.onConfigure(); 
                setVisible("SHOW".equals(someValue));
            }

        };
        wmc.setOutputMarkupPlaceholderTag(true);
        return wmc;
    }

    private TextField textfield() {
        TextField tf = new TextField("textfield", new PropertyModel(HomePage.this, "someValue"));
        tf.add(new OnChangeAjaxBehavior() {

            @Override
            protected void onUpdate(AjaxRequestTarget art) {
                //just model update
                art.add(container);
            }
        });
        return tf;
    }

}

```
Use

```
container.setOutputPlaceHolderTag(true);
container.setOuputMarkupId(true);

textfield.add(new OnChangeAjaxBehavior() {

            @Override
            protected void onUpdate(AjaxRequestTarget target) {
                form.modelChanged();

                if ("SHOW".equals(((TextField<String>) getComponent()).getModelObject())) { //change this
                    container.setVisible(true);
                } else {

                    container.setVisible(false);
                }
                target.addComponent(container);
}

```

I got this tip from [Getting a Wicket text box's value in an AJAX onchange event](https://stackoverflow.com/questions/5564634/getting-a-wicket-text-boxs-value-in-an-ajax-onchange-event)