GithubHelp home page GithubHelp logo

yachaywasi / vaadin-confirmdialog Goto Github PK

View Code? Open in Web Editor NEW

This project forked from samie/vaadin-confirmdialog

0.0 2.0 0.0 5.4 MB

A ConfirmDialog Add-on for the Vaadin Framework

Home Page: http://vaadin.com/addon/confirmdialog

vaadin-confirmdialog's Introduction

ConfirmationDialog

Ever needed a present a confirmation dialog in a Vaadin application?

Here is a way to do it nicely. The ConfirmDialog add-on provides you with a configurable way of requesting user confirmation for a button click or some other some operation.

Defaults like size calculation, keyboard bindings and styling are all there, but of course you can provide your own. Take a look at the demo application for sample code and use cases.

Currently only two-way (yes,no) confirmation is supported. Vote for three-way (yes,no,cancel) if you need it. And for "monolog box" use the Vaadin's own showNotification method.

This is a server-side-only component, so no need to recompile the widgetset.

Usage of the add-on

private void addBasicExample() {
	Button button = new Button("Basic");
	button.setDebugId("basic");
	button.addListener(new Button.ClickListener() {
		public void buttonClick(ClickEvent event) {
			// The quickest way to confirm
			ConfirmDialog.show(getMainWindow(), "Are you sure?",
			        new ConfirmDialog.Listener() {

			            public void onClose(ConfirmDialog dialog) {
			                if (dialog.isConfirmed()) {
			                    // Confirmed to continue
								// DO STUFF
			                } else {
			                    // User did not confirm
								// CANCEL STUFF
			                }
			            }
			        });
		}
	});

Developing and building

Project sources are hosted in github.com.

Project is built with maven. Sources are directly in src directory, tests in test directory.

ConfirmTestApplication has main method that launches itself into an embedded jetty. Selenium2 tests are run against it.

vaadin-confirmdialog's People

Contributors

samie avatar mstahv avatar

Watchers

James Cloos avatar Wilmer Reyes avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.