lunifera / lunifera-issues

Dummy repo - All the issues should be added here
0 stars 0 forks source link

[runtime web] Eclipse Databining for vaadin #19

Open florianpirchner opened 11 years ago

florianpirchner commented 11 years ago

Olla,

i will prepare a eclipse databinding integration for vaadin. The goal is to provide swt like databinding to vaadin.

Example - Bind the check box boolean to the enabled state of the text field. If the check box value changes, the enable state of the text field changes.

TextField field;
CheckBox checkbox;

checkBoxObservable = VaadinObservables.observeValue(checkbox)
fieldEnabledObservable = VaadinObservables.observeEnablement(field)

dbc.bind(checkBoxObservable, fieldEnabledObservable)

Could already finish a prototype for observeValue(). But i am not sure if i can make it work.

ekke commented 11 years ago

cool

florianpirchner commented 11 years ago

Looks really great! Have implemented about 12 properties!

This examples works well now!

        CheckBox required = new CheckBox("required");
        required.setImmediate(true);
        required.setBuffered(false);

        TextField requiredError = new TextField("requiredError");
        requiredError.setImmediate(true);
        requiredError.setBuffered(false);

        TextField input = new TextField("input");
        input.setImmediate(true);
        input.setBuffered(false);

        layout.addComponent(required, 0, 2);
        layout.addComponent(requiredError, 1, 2);
        layout.addComponent(input, 2, 2);

        IVaadinObservableValue value_requiredObservable = VaadinObservables
                .observeValue(required);
        IVaadinObservableValue value_errorString = VaadinObservables
                .observeValue(requiredError);
        IVaadinObservableValue readonly_errorString = VaadinObservables
                .observeReadonly(requiredError);

        IVaadinObservableValue required_Input = VaadinObservables
                .observeRequired(input);
        IVaadinObservableValue errorMessage_Input = VaadinObservables
                .observeRequiredError(input);

        dbc.bindValue(value_requiredObservable, required_Input);
        dbc.bindValue(value_requiredObservable, readonly_errorString);
        dbc.bindValue(value_errorString, errorMessage_Input);
florianpirchner commented 11 years ago

First version is pushed: http://bit.ly/13QUqRm

Supporting most of available properties. Collections and Maps will follow.