KonamiCode and StyleCalendar widgets

Yeah! Thank you very much!

There seems to be a problem with the width-calculation when the field is set to 100% and added inside for example a Panel. The padding of the Panel cuts the right side of the input-field as it is not taken into account. I opened a ticket for that in your issue-tracker. Unfortunatly I don’t know enough GWT to provide a fix …

How to deselect the date which is selected in the calendar?
Any ideas how to do that?

Is there plane for creating Vaadin 8 version of StyleCalendar widget?

I was able to create V8 version with Migration Tool:

https://github.com/vaadin/framework8-migration-tool

It works for me, but it depence on vaadin-compatibility-* packages.

Here is my Vaadin 8 version of StyleCalendar:


https://github.com/lordmikefin/StyleCalendar/tree/Vaadin8

I used migration tool:
https://github.com/vaadin/framework8-migration-tool

The code works, but there is some problems with styles.
I had to include “stylecalendar.scss” and “stylecalendarfield.scss” style files manually into my theme.

Note: I use the code as part of my multi project application. So I’m not sure if I have broken something.
Well at least I’m able to compile and run the demo.

My applications build.gradle file includes packages:

compileOnly group:'com.vaadin', name:'vaadin-client-compiler', version:'8.1.4'
compile group:'com.vaadin', name:'vaadin-compatibility-client-compiled', version:'8.1.4'
compile group:'com.vaadin', name:'vaadin-compatibility-server', version:'8.1.4'
compile group:'com.vaadin', name:'vaadin-compatibility-client', version:'8.1.4'
compile group:'com.vaadin', name:'vaadin-compatibility-themes', version:'8.1.4'

Hi everyone and thanks Risto for these widgets! I’m using StyleCalendar and it suits perfectly to my needs, but it’s lacking some features and I’m struggling to see how to implement them.

For instance, I need to be able to select (and deselect) several days, but I find that I only can do so one at a time. It’s easy for me to store (and remove) the current set of selected days in a collection as I click on days on the calendar, but visually I don’t know how to style them accordingly. How do you do so?

EDIT:

Not so easy to select and deselect and then select the same day again. I think I’ve discovered a bug, which I reported in
https://github.com/ripla/StyleCalendar/issues/8
The thing is: click on a date (for instance, April 25th). You can get its value via StyleCalendar.getValue(). Click on it again to deselect it, and this time .getValue() will return null, so you have to get the unselected date via event.getProperty().getValue() inside the ValueChange method from the ValueChangeListener. Ok. But finally, click on it again in order to yet select it again, and none of the previous methods will work for getting the date: everything will return null.

How can I get the once again selected date??

EDIT 2:

Ok, I now understand the “null” value when deselecting is not a bug but a feature. I solved the multiple date selection by passing a global HashMap holding the dates to each instance of StyleCalendars (12, one for each month), and also having to check if the clicked day is inside it on beforeClientResponse() in order to properly paint it as selected or not. Not so pretty and also I had to edit and recompile the add-on but it works for me…

Mikko Niemelä:
Here is my Vaadin 8 version of StyleCalendar:

https://github.com/lordmikefin/StyleCalendar/tree/Vaadin8

I used migration tool: https://github.com/vaadin/framework8-migration-tool
The code works, but there is some problems with styles.
I had to include “stylecalendar.scss” and “stylecalendarfield.scss” style files manually into my theme.

Note: I use the code as part of my multi project application. So I’m not sure if I have broken something.
Well at least I’m able to compile and run the demo.

My applications build.gradle file includes packages:

compileOnly group:'com.vaadin', name:'vaadin-client-compiler', version:'8.1.4'
compile group:'com.vaadin', name:'vaadin-compatibility-client-compiled', version:'8.1.4'
compile group:'com.vaadin', name:'vaadin-compatibility-server', version:'8.1.4'
compile group:'com.vaadin', name:'vaadin-compatibility-client', version:'8.1.4'
compile group:'com.vaadin', name:'vaadin-compatibility-themes', version:'8.1.4'

Hi Mikko!

It’s great to hear there is a Vaadin 8 version :).
BUT I don’t know Gradle :frowning: Is there a Maven version? Or how can I use your artifact?

Thanks in advance!
Károly

Update:
I’ve made a Maven project from the Gradle one. I built it (only the addon folder), and I use in my own Spring Boot project (let’s say it’s MyCalendar). I managed to compile the widgetset, the “weird” .js, js.gz, eof, etc. files created in the widgetsets folder, I annotated my MyCalendarUI class with the @Widgetset(“widgetset.MyCalendarWidgetset”), and I started the Spring Boot application, but when I load the page in the browser it said:

Widgetset ‘widgetset.MyCalendarWidgetset’ does not contain an implementation for org.vaadin.risto.stylecalendar.StyleCalendar. Check the connector’s @Connect mapping, the widgetset’s GWT module description file and re-compile your widgetset. In case you have downloaded a vaadin add-on package, you might want to refer to add-on instructions.

The ?debug window and the Chrome Developer Network tab show no errors.

My widgetset gwt xml file path is the following:
src/main/resources/widgetset/MyCalendarWidgetset.gwt.xml

It’s content (auto generated):

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.8.0//EN" "http://gwtproject.org/doctype/2.8.0/gwt-module.dtd">
<module>
    <inherits name="com.vaadin.DefaultWidgetSet"/>

    <inherits name="org.vaadin.risto.stylecalendar.StyleCalendarWidgetset"/>

    <inherits name="com.vaadin.v7.Vaadin7WidgetSet" />
</module>

The dependecies in my pom.xml are the following:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<groupId>x.z.y</groupId>
	<artifactId>my.calendar.vaadin8</artifactId>
	<version>1.0-SNAPSHOT</version>
	<name>my.calendar.vaadin8</name>

	<parent>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>2.1.6.RELEASE</version>
		<relativePath/>
	</parent>

	<properties>
		<java.version>1.8</java.version>
		<vaadin.version>8.9.0</vaadin.version>
		<vaadin.plugin.version>8.9.0</vaadin.plugin.version>
		<dockerfile.dependency.path>target/dependency</dockerfile.dependency.path>
	</properties>

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>com.vaadin</groupId>
				<artifactId>vaadin-bom</artifactId>
				<version>${vaadin.version}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<dependencies>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter</artifactId>
			<exclusions>
				<exclusion>
					<groupId>org.springframework.boot</groupId>
					<artifactId>spring-boot-starter-logging</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-log4j2</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-actuator</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-web</artifactId>
		</dependency>
		<dependency>
			<groupId>com.vaadin</groupId>
			<artifactId>vaadin-spring-boot-starter</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-configuration-processor</artifactId>
			<optional>true</optional>
		</dependency>

		<dependency>
			<groupId>org.vaadin.addons</groupId>
			<artifactId>stylecalendar</artifactId>
			<version>2.2.0-vaadin8-kkotay</version>
		</dependency>
		<dependency>
			<groupId>com.vaadin</groupId>
			<artifactId>vaadin-compatibility-client</artifactId>
		</dependency>
		<dependency>
			<groupId>com.vaadin</groupId>
			<artifactId>vaadin-compatibility-shared</artifactId>
		</dependency>
		<dependency>
			<groupId>com.vaadin</groupId>
			<artifactId>vaadin-push</artifactId>
		</dependency>
		<dependency>
			<groupId>com.vaadin</groupId>
			<artifactId>vaadin-compatibility-client-compiled</artifactId>
		</dependency>
		<dependency>
			<groupId>com.vaadin</groupId>
			<artifactId>vaadin-themes</artifactId>
		</dependency>
		<dependency>
			<groupId>com.vaadin</groupId>
			<artifactId>vaadin-compatibility-themes</artifactId>
		</dependency>
	</dependencies>

	<build>

		<resources>
			<resource>
				<directory>src/main/resources</directory>
				<!--<filtering>true</filtering>-->
			</resource>
			<resource>
				<directory>src/main/webapp</directory>
			</resource>
		</resources>

		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-clean-plugin</artifactId>
				<version>3.0.0</version>
				<!-- Clean up also any pre-compiled themes -->
				<configuration>
					<filesets>
						<fileset>
							<directory>src/main/webapp/VAADIN/themes</directory>
							<includes>
								<include>**/styles.css</include>
								<include>**/styles.scss.cache</include>
							</includes>
						</fileset>
					</filesets>
				</configuration>
			</plugin>
		</plugins>
	</build>

	<repositories>
		<repository>
			<id>spring-milestones</id>
			<name>Spring Milestones</name>
			<url>https://repo.spring.io/milestone</url>
			<snapshots>
				<enabled>false</enabled>
			</snapshots>
		</repository>
		<repository>
			<id>vaadin-addons</id>
			<url>http://maven.vaadin.com/vaadin-addons</url>
		</repository>
	</repositories>

	<profiles>
		<profile>
			<id>vaadin</id>
			<build>
				<plugins>
					<plugin>
						<groupId>com.vaadin</groupId>
						<artifactId>vaadin-maven-plugin</artifactId>
						<version>${vaadin.version}</version>
						<configuration>
							<extraJvmArgs>-Xmx2G -Xss1024k</extraJvmArgs>
							<webappDirectory>${basedir}/src/main/resources/VAADIN/widgetsets</webappDirectory>
							<draftCompile>false</draftCompile>
							<compileReport>false</compileReport>
							<style>OBF</style>
							<strict>true</strict>
						</configuration>
						<executions>
							<execution>
								<goals>
									<goal>resources</goal>
									<goal>update-theme</goal>
									<goal>update-widgetset</goal>
									<goal>compile-theme</goal>
									<goal>compile</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

</project>

Any help would be appreciated!
Cheers! Károly