GithubHelp home page GithubHelp logo

samie / vaadin-confirmdialog Goto Github PK

View Code? Open in Web Editor NEW
17.0 5.0 27.0 5.28 MB

ConfirmDialog Add-on for the Vaadin 6, 7, 8, and 14

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

Java 100.00%
java vaadin apache-license-2

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

Button button = new Button("Unsafe action", e -> {

    // The quickest way to confirm
    ConfirmDialog.show(UI.getCurrent(), "Are you sure?",
            (ConfirmDialog.Listener) dialog -> {
                if (dialog.isConfirmed()) {
                    // Confirmed to continue
                    // DO STUFF
                } else {
                    // User did not confirm
                    // CANCEL STUFF
                }
            });
});
add(button);

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

foxyboa avatar mstahv avatar samie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

vaadin-confirmdialog's Issues

ConfirmDialog scrolls simple question

Currently ConfirmDialog does not wrap the question contents; if the font settings are changed, the computed size is most often incorrect and will lead to message scrolling which does not look nice. Please see screenshot for details. Actually I think that the real culprit is the VerticalLayout having unnecessary spacing.
screenshot_20170530_155656

ContentMode in Vaadin 8 Beta 2

Hi,
the ConfirmDialog version 3.1.0 has problems with finding ContentMode because its destination was moved in the new Beta2.

Thank You

Exclusion of sass-compiler in confirmdialog means you cannot compile themes

Getting this error since adding confirmdialog to my pom:

[ERROR] Error: Could not find or load main class com.vaadin.sass.SassCompiler

Seems to be down to this entry in the pom:

      <dependency>
           <groupId>com.vaadin</groupId>
           <artifactId>vaadin-server</artifactId>
           <version>${vaadin.version}</version>
           <exclusions>
               <exclusion>
                   <groupId>com.vaadin</groupId>
                   <artifactId>vaadin-sass-compiler</artifactId>
               </exclusion>
           </exclusions>
       </dependency>

The workaround is to explicitly add the sass-compiler dependency back in to my pom, but like issue #26 I'm expecting that this plugin shouldn't be explicitly depending on server or excluding the sass compiler

Addon uses vaadin server as dependency

I am using spring boot and ran into an exception yesterday (see below). This was cause by a dependency conflict from the confirmdialog, which uses vaadin server 7.5.0 which conflicts with the spring boot vaadin server version 7.7.3 (see below).

I am not sure if an addon should use a vaadin server directly. What is also strange is that the vaadin-spring-boot-starter does not use a vaadin server.

I could fix the problem by excluding the spring server from the confirm dialog in my pom.xml (see below), but I believe an add on should not have the vaadin server version as a compile dependency. Maybe it should use vaadin server with scope provided?

Exception

java.lang.NoSuchMethodError: com.vaadin.navigator.Navigator: method <init>()V not found
	at com.vaadin.spring.navigator.SpringNavigator.<init>(SpringNavigator.java:67) ~[vaadin-spring-1.1.1.jar:1.1.1]
	at com.vaadin.spring.boot.VaadinAutoConfiguration$EnableSpringVaadinNavigatorConfiguration.vaadinNavigator(VaadinAutoConfiguration.java:81) ~[vaadin-spring-boot-1.1.1.jar:1.1.1]
	at com.vaadin.spring.boot.VaadinAutoConfiguration$EnableSpringVaadinNavigatorConfiguration$$EnhancerBySpringCGLIB$$65754212.CGLIB$vaadinNavigator$1(<generated>) ~[vaadin-spring-boot-1.1.1.jar:1.1.1]
	at com.vaadin.spring.boot.VaadinAutoConfiguration$EnableSpringVaadinNavigatorConfiguration$$EnhancerBySpringCGLIB$$65754212$$FastClassBySpringCGLIB$$f358037a.invoke(<generated>) ~[vaadin-spring-boot-1.1.1.jar:1.1.1]
	at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) ~[spring-core-4.3.4.RELEASE.jar:4.3.4.RELEASE]
	at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:356) ~[spring-context-4.3.4.RELEASE.jar:4.3.4.RELEASE]
	at com.vaadin.spring.boot.VaadinAutoConfiguration$EnableSpringVaadinNavigatorConfiguration$$EnhancerBySpringCGLIB$$65754212.vaadinNavigator(<generated>) ~[vaadin-spring-boot-1.1.1.jar:1.1.1]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_101]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_101]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_101]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_101]
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162) ~[spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE]
	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588) ~[spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1128) ~[spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1022) ~[spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:512) ~[spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) ~[spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory$2.getObject(AbstractBeanFactory.java:345) ~[spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE]
	at com.vaadin.spring.internal.BeanStore.create(BeanStore.java:71) ~[vaadin-spring-1.1.1.jar:1.1.1]
	at com.vaadin.spring.internal.UIScopeImpl$UIBeanStore.create(UIScopeImpl.java:279) ~[vaadin-spring-1.1.1.jar:1.1.1]
	at com.vaadin.spring.internal.BeanStore.get(BeanStore.java:62) ~[vaadin-spring-1.1.1.jar:1.1.1]
	at com.vaadin.spring.internal.SessionLockingBeanStore.get(SessionLockingBeanStore.java:46) ~[vaadin-spring-1.1.1.jar:1.1.1]
	at com.vaadin.spring.internal.UIScopeImpl.get(UIScopeImpl.java:81) ~[vaadin-spring-1.1.1.jar:1.1.1]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:340) ~[spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:220) ~[spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveNamedBean(DefaultListableBeanFactory.java:1011) ~[spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:340) ~[spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:335) ~[spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1093) ~[spring-context-4.3.4.RELEASE.jar:4.3.4.RELEASE]
	at com.vaadin.spring.server.SpringUIProvider.getNavigator(SpringUIProvider.java:303) ~[vaadin-spring-1.1.1.jar:1.1.1]
	at com.vaadin.spring.server.SpringUIProvider.configureNavigator(SpringUIProvider.java:268) ~[vaadin-spring-1.1.1.jar:1.1.1]
	at com.vaadin.spring.server.SpringUIProvider.createInstance(SpringUIProvider.java:204) ~[vaadin-spring-1.1.1.jar:1.1.1]
	at com.vaadin.server.communication.UIInitHandler.getBrowserDetailsUI(UIInitHandler.java:191) ~[vaadin-server-7.5.0.jar:7.5.0]
	at com.vaadin.server.communication.UIInitHandler.synchronizedHandleRequest(UIInitHandler.java:74) ~[vaadin-server-7.5.0.jar:7.5.0]
	at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:41) ~[vaadin-server-7.5.0.jar:7.5.0]
	at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1408) ~[vaadin-server-7.5.0.jar:7.5.0]
	at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:350) ~[vaadin-server-7.5.0.jar:7.5.0]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) ~[tomcat-embed-core-8.5.6.jar:8.5.6]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230) ~[tomcat-embed-core-8.5.6.jar:8.5.6]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) ~[tomcat-embed-core-8.5.6.jar:8.5.6]
	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:726) ~[tomcat-embed-core-8.5.6.jar:8.5.6]
	at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:469) ~[tomcat-embed-core-8.5.6.jar:8.5.6]
	at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:351) ~[tomcat-embed-core-8.5.6.jar:8.5.6]
	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:311) ~[tomcat-embed-core-8.5.6.jar:8.5.6]
	at org.springframework.web.servlet.mvc.ServletForwardingController.handleRequestInternal(ServletForwardingController.java:133) ~[spring-webmvc-4.3.4.RELEASE.jar:4.3.4.RELEASE]
	at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:174) ~[spring-webmvc-4.3.4.RELEASE.jar:4.3.4.RELEASE]
	at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:50) ~[spring-webmvc-4.3.4.RELEASE.jar:4.3.4.RELEASE]
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963) ~[spring-webmvc-4.3.4.RELEASE.jar:4.3.4.RELEASE]
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897) ~[spring-webmvc-4.3.4.RELEASE.jar:4.3.4.RELEASE]
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) ~[spring-webmvc-4.3.4.RELEASE.jar:4.3.4.RELEASE]
	at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872) ~[spring-webmvc-4.3.4.RELEASE.jar:4.3.4.RELEASE]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:648) ~[tomcat-embed-core-8.5.6.jar:8.5.6]
	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) ~[spring-webmvc-4.3.4.RELEASE.jar:4.3.4.RELEASE]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) ~[tomcat-embed-core-8.5.6.jar:8.5.6]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230) ~[tomcat-embed-core-8.5.6.jar:8.5.6]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) ~[tomcat-embed-core-8.5.6.jar:8.5.6]
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) ~[tomcat-embed-websocket-8.5.6.jar:8.5.6]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) ~[tomcat-embed-core-8.5.6.jar:8.5.6]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) ~[tomcat-embed-core-8.5.6.jar:8.5.6]
	at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) ~[spring-web-4.3.4.RELEASE.jar:4.3.4.RELEASE]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.3.4.RELEASE.jar:4.3.4.RELEASE]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) ~[tomcat-embed-core-8.5.6.jar:8.5.6]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) ~[tomcat-embed-core-8.5.6.jar:8.5.6]
	at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:89) ~[spring-web-4.3.4.RELEASE.jar:4.3.4.RELEASE]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.3.4.RELEASE.jar:4.3.4.RELEASE]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) ~[tomcat-embed-core-8.5.6.jar:8.5.6]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) ~[tomcat-embed-core-8.5.6.jar:8.5.6]
	at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77) ~[spring-web-4.3.4.RELEASE.jar:4.3.4.RELEASE]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.3.4.RELEASE.jar:4.3.4.RELEASE]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) ~[tomcat-embed-core-8.5.6.jar:8.5.6]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) ~[tomcat-embed-core-8.5.6.jar:8.5.6]
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) ~[spring-web-4.3.4.RELEASE.jar:4.3.4.RELEASE]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.3.4.RELEASE.jar:4.3.4.RELEASE]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) ~[tomcat-embed-core-8.5.6.jar:8.5.6]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) ~[tomcat-embed-core-8.5.6.jar:8.5.6]
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) ~[tomcat-embed-core-8.5.6.jar:8.5.6]
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:108) [tomcat-embed-core-8.5.6.jar:8.5.6]
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) [tomcat-embed-core-8.5.6.jar:8.5.6]
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) [tomcat-embed-core-8.5.6.jar:8.5.6]
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) [tomcat-embed-core-8.5.6.jar:8.5.6]
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) [tomcat-embed-core-8.5.6.jar:8.5.6]
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349) [tomcat-embed-core-8.5.6.jar:8.5.6]
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:784) [tomcat-embed-core-8.5.6.jar:8.5.6]
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-embed-core-8.5.6.jar:8.5.6]
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:802) [tomcat-embed-core-8.5.6.jar:8.5.6]
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1410) [tomcat-embed-core-8.5.6.jar:8.5.6]
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-8.5.6.jar:8.5.6]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_101]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_101]
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-8.5.6.jar:8.5.6]
	at java.lang.Thread.run(Thread.java:745) [na:1.8.0_101]

Dependency tree of confirmdialog and spring boot vaadin starter

$ mvn dependency:tree
...
[INFO] +- org.vaadin.addon:confirmdialog:jar:2.1.3:compile
[INFO] |  \- com.vaadin:vaadin-server:jar:7.5.0:compile
[INFO] |     +- com.vaadin:vaadin-sass-compiler:jar:0.9.12:compile
[INFO] |     |  +- org.w3c.css:sac:jar:1.3:compile
[INFO] |     |  \- com.vaadin.external.flute:flute:jar:1.3.0.gg2:compile
[INFO] |     +- com.vaadin:vaadin-shared:jar:7.5.0:compile
[INFO] |     |  +- com.vaadin.external.streamhtmlparser:streamhtmlparser-jsilver:jar:0.0.10.vaadin1:compile
[INFO] |     |  \- com.vaadin.external.google:guava:jar:16.0.1.vaadin1:compile
[INFO] |     \- org.jsoup:jsoup:jar:1.8.1:compile
...
[INFO] +- com.vaadin:vaadin-spring-boot-starter:jar:1.1.1:compile
[INFO] |  +- com.vaadin:vaadin-spring-boot:jar:1.1.1:compile
[INFO] |  |  +- com.vaadin:vaadin-spring:jar:1.1.1:compile
[INFO] |  |  \- org.springframework:spring-webmvc:jar:4.3.4.RELEASE:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-web:jar:1.4.2.RELEASE:compile
[INFO] |  +- com.vaadin:vaadin-themes:jar:7.7.3:compile
[INFO] |  \- com.vaadin:vaadin-client-compiled:jar:7.7.3:compile
...

Workaround for now

<dependency>
    <groupId>org.vaadin.addon</groupId>
    <artifactId>confirmdialog</artifactId>
    <version>2.1.3</version>
    <exclusions>
        <exclusion>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-server</artifactId>
        </exclusion>
    </exclusions>
</dependency>

java.lang.NoSuchMethodError

I-m using vaadin 7.7.6 and recently, I also experienced error :
"java.lang.NoSuchMethodError: org.vaadin.dialogs.ConfirmDialog.addCloseListener(Lcom/vaadin/ui/Window$CloseListener;)Lcom/vaadin/shared/Registration"

DefaultConfirmDialogFactory: Use protected methods for accessing min/max width/height instead of constants

I need to override max dialog size. It could be relatively easy to do, except one crucial point - DefaultConfirmDialogFactory doesn't provide an option to provide min/max width/height values.

I propose to define bunch of protected methods (e.g. getMinHeight(), getMaxHeight() etc.) and get access to that constant values trough them (e.g. from getDialogDimensions())

Could prepare pull request if necessary :)

Dependencies

There are explicit dependencies for vaadin-server 7.0.0, vaadin-themes 7.0.0. and vaadin-client-complied 7.0.0. Is it possible to remove these dependencies so that the dependencies of the project will be used?

Enable rearranging the buttons of the ConfirmDialog

There should be an easy way of how to rearrange the buttons (yes/no/cancel) of the ConfirmDialog. BTW I don't know the exact statistics, but I do think that the most usual ordering, at least on web, is really yes/no/cancel, not the actual cancel/no/yes variant.

This feature is also questioned on SO: http://stackoverflow.com/questions/36326212/how-to-rearrange-buttons-on-vaadin-confirmdialog. The only suggested solution of overriding DefaultConfirmDialogFactory is working of course, but imagine that every client using this add-on needs to implement this over and over again, forced to copy-paste most of the original class (and merge it with newer versions thereafter). What is this good for ...? ;)

Solution proposal: It should be probably enough just to introduce a flag called "buttonOrder" (or similar) and put the created buttons into the actual "buttons" container in the selected order from inside the DefaultConfirmDialogFactory.create() method.

confirmdialog-2.0.5.jar does not point to a valid jar for a Class-Path reference

I get a bunch of warnings below when using this with vaadin 7.1.15 and deploying on wildfly 8.0.0

23:38:51,271 WARN [org.jboss.as.server.deployment](MSC service thread 1-9) JBAS015960: Class Path entry vaadin-shared-7.0.0.jar in /content/xxx-web.war/WEB-INF/lib/confirmdialog-2.0.5.jar does not point to a valid jar for a Class-Path reference.
23:38:51,272 WARN [org.jboss.as.server.deployment](MSC service thread 1-9) JBAS015960: Class Path entry vaadin-theme-compiler-7.0.0.jar in /content/xxx-web.war/WEB-INF/lib/confirmdialog-2.0.5.jar does not point to a valid jar for a Class-Path reference.
23:38:51,272 WARN [org.jboss.as.server.deployment](MSC service thread 1-9) JBAS015960: Class Path entry commons-logging-1.1.1.jar in /content/xxx-web.war/WEB-INF/lib/confirmdialog-2.0.5.jar does not point to a valid jar for a Class-Path refere

Not working with vaadin 7 alpha 3

ConfirmDialog add-on is not working with vaadin 7 alpha 3 release because of Label.ContentMode package changes. Please update the add-on

NoSuchMethodError with Window extension

I am using the add-on with a "custom" Window (nothing fancy, just a few extra methods to access the root layout more easily). With a proper use of the add-on, I get this

if (manager.hasConfigChanged()) {
    // The quickest way to confirm
    ConfirmDialog.show(getWindow(), "The configuration has changed, discard changes?",
            new ConfirmDialog.Listener() {
                public void onClose(ConfirmDialog dialog) {
                    if (dialog.isConfirmed()) {
                        doCloseTab(tabsheet, tabContent);
                    }
                }
            });
} else {
    doCloseTab(tabsheet, tabContent);
}


Caused by: java.lang.RuntimeException: Failed to remove confirmation dialof from the parent window.
    at org.vaadin.dialogs.DefaultConfirmDialogFactory$2.buttonClick(DefaultConfirmDialogFactory.java:145)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:512)
    ... 27 more
Caused by: java.lang.NoSuchMethodException: com.bsb.soliam.fo.incubator.vaadin.view.app.window.ViewWindow.removeWindow(com.vaadin.ui.Window)
    at java.lang.Class.getDeclaredMethod(Class.java:1937)
    at org.vaadin.dialogs.DefaultConfirmDialogFactory$2.buttonClick(DefaultConfirmDialogFactory.java:141)
    ... 32 more

The problem is that DefaultConfirmDialogFactory gets the declared method on the parent if it's a window instead of just getting the method. I would either use Window.class.getDeclaredMethod(... or parent.getClass().getMethod(...

Overriding the removeWindow in my Window extension by calling super is a good workaround for this issue.

crashes with exception thrown

Caused by: java.lang.NoSuchMethodError: org.vaadin.dialogs.ConfirmDialog.getContent()Lcom/vaadin/ui/ComponentContainer;
at org.vaadin.dialogs.DefaultConfirmDialogFactory.create(DefaultConfirmDialogFactory.java:75)
at org.vaadin.dialogs.ConfirmDialog.show(ConfirmDialog.java:114)
at org.vaadin.dialogs.ConfirmDialog.show(ConfirmDialog.java:90)
at com.spx.esales.sizingandselection.ui.layouts.AdminViewLayout$2.buttonClick(AdminViewLayout.java:160)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:508)
... 32 more

Missing License File

Hi. I noticed that the project does not contain a license file. How would you classify your project? Is it Apache like vaadin is?

EDIT: closed. I found this license.

getDeclaredMethod("removeWindow", Window.class) is not always effective

When the confirm diaglog is closing (In DefaultConfirmDialogFactory class) the removeWindow method is not called directly, but rather via reflection. This appears to be a bugfix for previous issue.

However the code:

Method m = parent.getClass().getDeclaredMethod( "removeWindow", Window.class);
m.invoke(parent, confirm);

is not always effective because it is possible that the window class is a subclass of Window rather than an instance. The reflection api method getDeclaredMethod will only check the actual instance class, and not superclasses, for the requested method.

To work robustly the code needs to scan all parent classes for the removeWindow method - in the same way that org.springframework.util.ReflectionUtils.findMethod(...) does.

upgrade?

Any predictions for support vaadin 7.1.0?

Error with Grails and Vaadin Plugin

Hi,

When i use the plugin with Grails and Vaadin Plugin it's not working, see the below error:

javax.servlet.ServletException: Servlet.init() for servlet VaadinServlet 0 threw exception
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:744)

groovy.lang.MissingMethodException: No signature of method: com.vaadin.grails.GrailsVaadinServletService.init() is applicable for argument types: () values: []
Possible solutions: wait(), wait(long), wait(long, int), find(), print(java.io.PrintWriter), print(java.lang.Object)
com.vaadin.grails.GrailsVaadinServlet.createServletService(GrailsVaadinServlet.groovy:25)
com.vaadin.server.VaadinServlet.init(VaadinServlet.java:113)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:744)

the code is:

ConfirmDialog.show(null, "Please Confirm:", "Are you really sure?",
"I am", "Not quite", new ConfirmDialog.Listener() {

            public void onClose(ConfirmDialog dialog) {
                if (dialog.isConfirmed()) {
                    // Confirmed to continue

                } else {
                    // User did not confirm

                }
            }
        });

CSS error in included css file

In the included CSS file, the firs line has a incalid CSS rule:

.v-popupbutton. .v-button-wrap * {
float: left;
}

It should be this:

.v-popupbutton .v-button-wrap * {
float: left;
}

Note the removed dot character after the v-popupbutton

Vaadin 8 version can't show ConfirmDialog

java.lang.NoSuchMethodError: org.vaadin.dialogs.ConfirmDialog.addCloseListener(Lcom/vaadin/ui/Window$CloseListener;)V
at org.vaadin.dialogs.DefaultConfirmDialogFactory.create(DefaultConfirmDialogFactory.java:60)
at org.vaadin.dialogs.ConfirmDialog.show(ConfirmDialog.java:148)
at org.vaadin.dialogs.ConfirmDialog.show(ConfirmDialog.java:95)
at com.dts.view.operation.WorkerJobTabLayout$2.click(WorkerJobTabLayout.java:114)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:510)
at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:203)
at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:166)
at com.vaadin.server.AbstractClientConnector.fireEvent(AbstractClientConnector.java:1021)
at com.vaadin.ui.renderers.ClickableRenderer.access$000(ClickableRenderer.java:42)
at com.vaadin.ui.renderers.ClickableRenderer$1.click(ClickableRenderer.java:139)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:158)
at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:119)
at com.vaadin.server.communication.ServerRpcHandler.handleInvocation(ServerRpcHandler.java:435)
at com.vaadin.server.communication.ServerRpcHandler.handleInvocations(ServerRpcHandler.java:407)
at com.vaadin.server.communication.ServerRpcHandler.handleRpc(ServerRpcHandler.java:273)
at com.vaadin.server.communication.UidlRequestHandler.synchronizedHandleRequest(UidlRequestHandler.java:90)
at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:41)
at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1422)
at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:380)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:474)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:783)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:745)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1437)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)

Here is my code

import org.vaadin.dialogs.ConfirmDialog;
grid.addColumn("Delete", record -> "Delete", new ButtonRenderer(
new ClickableRenderer.RendererClickListener() {
@OverRide
public void click(ClickableRenderer.RendererClickEvent e) {
ConfirmDialog.show(getUI(), "Are you sure?",
new ConfirmDialog.Listener() {
public void onClose(ConfirmDialog dialog) {
if (dialog.isConfirmed()) {
//OK STUFF
} else {
// User did not confirm
// CANCEL STUFF
}
}
});}}));

Please help

Custom theme compilation fails without exclusions on addon

Hello,

When adding

               <dependency>
			<groupId>org.vaadin.addon</groupId>
			<artifactId>confirmdialog</artifactId>
			<version>3.1.1</version>
		</dependency>

To a spring-boot Vaadin 8 project with a custom theme in `src/main/resources/VAADIN' the theme compilation fails:

ERROR] Fehler: Hauptklasse com.vaadin.sass.SassCompiler konnte nicht gefunden oder geladen werden
[ERROR] Compiling theme "VAADIN\themes\apples" failed
org.codehaus.mojo.gwt.shell.JavaCommandException: Command [[
C:\devkit\toolchain\jdk\jre\bin\java -Xmx1G com.vaadin.sass.SassCompiler C:\devkit\workspaces\vaadin8experiment\webinterface\src\main\resources\VAADIN\themes\apples\styles.scss C:\devkit\workspaces\vaadin8experiment\webinterface\src\main\resources\VAADIN\themes\apples\styles.css
]] failed with status 1
	at org.codehaus.mojo.gwt.shell.JavaCommand.execute(JavaCommand.java:330)

Sorry for the German locale. Basically the main class of the SassCompiler cannot be found.

When excluding the vaadin-server dependency of the addon the compilation works again.

               <dependency>
			<groupId>org.vaadin.addon</groupId>
			<artifactId>confirmdialog</artifactId>
			<version>3.1.1</version>
		 	<exclusions>
				<exclusion>
					<groupId>com.vaadin</groupId>
					<artifactId>vaadin-server</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

How to reproduce ?

Try adding the addon to this project: https://github.com/heutelbeck/VaadinUriTemplateNavigation

I actually have no idea what exactly is causing this issue. I at least wanted to document the workaround here if anybody else runs into it.

Thanks for putting the addon together.

NullPointerException when calling show method without message arg

java.lang.NullPointerException
at org.vaadin.dialogs.DefaultConfirmDialogFactory.getDialogDimensions(DefaultConfirmDialogFactory.java:178)
at org.vaadin.dialogs.DefaultConfirmDialogFactory.create(DefaultConfirmDialogFactory.java:156)
at org.vaadin.dialogs.ConfirmDialog.show(ConfirmDialog.java:114)
at org.vaadin.dialogs.ConfirmDialog.show(ConfirmDialog.java:77)

Possible to set ConfirmDialog Synchronous?

Hi,

I tried to make a user's validation on each object of a collection (in a loop), but actually ConfirmDialog.show() isn't blocking and the loop finish before to display it.

Have you an issue for this case? Or it's impossible actually?

Thank

(Sorry for my English)

Closing dialog needs to be equal to clicking the Cancel, not the No button

The ConfirmDialog should follow the "standard" yes/no/cancel dialogs behavior: when one presses Esc or clicks on the close icon in the dialog, the dialog's method isCancelled() needs to return true. Currently, it always return false (so the client code thinks "No" was pressed) due to setting the null-able isConfirmed variable without looking at whether we are showing the yes/no/cancel variant of the dialog. The listener which needs to be fixed in DefaultConfirmDialogFactory.java:

    // Close listener implementation
    confirm.addCloseListener(new Window.CloseListener() {

        private static final long serialVersionUID = 1971800928047045825L;

        public void windowClose(CloseEvent ce) {

            // Only process if still enabled
            if (confirm.isEnabled()) {
                confirm.setEnabled(false); // avoid double processing
                confirm.setConfirmed(false);
                if (confirm.getListener() != null) {
                    confirm.getListener().onClose(confirm);
                }
            }
        }
    });

The fix (adding one "if") seems to be very easy to do...

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.