Package root.view.form

Examples of root.view.form.MahasiswaForm


            e.printStackTrace();
        }

        final VerticalLayout root = new VerticalLayout();

        final MahasiswaForm form = new MahasiswaForm();
        final MahasiswaList list = new MahasiswaList();

        form.setMargin(true);
        form.getSaveButton().addClickListener(new Button.ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                form.save();
                ((JPAContainer)list.getMhsTable().getContainerDataSource()).refresh();
                form.clear();
                list.getMhsTable().setValue(null);
            }
        });

        list.getMhsTable().addValueChangeListener(new Property.ValueChangeListener() {
            @Override
            public void valueChange(Property.ValueChangeEvent event) {
                if (event.getProperty().getValue() != null) {
                    Object mhsId = event.getProperty().getValue();
                    Mahasiswa selectedMahasiswa = createEntityManager().find(Mahasiswa.class, mhsId);
                    form.setMahasiswa(selectedMahasiswa);
                } else {
                    form.clear();
                }
            }
        });

        root.addComponent(form);
View Full Code Here

TOP

Related Classes of root.view.form.MahasiswaForm

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.