paged-tabs in Flow?

I’m new to Vaadin (and Maven) and am working through the book ‘Data-Centric Applications with Vaadin 8’, but with Vaadin Flow. The sample code provided for the book has been refactored for Flow, however I’m running into an issue with the dependency on paged-tabs and can not get certain projects within the sample code to run.

<dependency>
	<groupId>org.vaadin.tabs</groupId>
	<artifactId>paged-tabs</artifactId>
	<version>1.0.1</version>
</dependency>

This is the offending dependency. I see vaadin-tabs-flow-1.0.0.jar and vaadin-tabs-2.0.0.jar available in the Maven dependencies folder, but am not able to get either of those to work either. For instance:

<dependency>
	<groupId>org.vaadin.tabs</groupId>
	<artifactId>paged-tabs</artifactId>
	<version>2.0.0</version>
</dependency>

What should I put for the Flow version of Tabs?

Thanks.

Hi, you would have to provide more details. What is the exact problem? Does the project compile? Does it run? Are there any runtime exceptions? Does the application look wrong?

Hi,
I’m getting the following when trying to build the project in Eclipse:

.
.
.

[INFO]
 Downloading: http://maven.vaadin.com/vaadin-addons/org/vaadin/tabs/paged-tabs/2.0.0/paged-tabs-2.0.0.jar
[INFO]
 Downloading: https://repo.maven.apache.org/maven2/org/vaadin/tabs/paged-tabs/2.0.0/paged-tabs-2.0.0.jar
[INFO]
 ------------------------------------------------------------------------
[INFO]
 BUILD FAILURE
[INFO]
 ------------------------------------------------------------------------
[INFO]
 Total time: 3.362 s
[INFO]
 Finished at: 2018-08-14T12:47:37-07:00
[INFO]
 Final Memory: 16M/217M
[INFO]
 ------------------------------------------------------------------------
[ERROR]
 Failed to execute goal on project chapter-07: Could not resolve dependencies for project packt.vaadin.datacentric:chapter-07:war:2.0-SNAPSHOT: Could not find artifact org.vaadin.tabs:paged-tabs:jar:2.0.0 in vaadin-addons (http://maven.vaadin.com/vaadin-addons) -> [Help 1]

I have tried building with both versions 1.0.0 and 2.0.0, since the following jars are in the project:

C:\Users\darren.m2\repository\com\vaadin\vaadin-tabs-flow\1.0.0\vaadin-tabs-flow-1.0.0.jar
C:\Users\darren.m2\repository\org\webjars\bowergithub\vaadin\vaadin-tabs\2.0.0\vaadin-tabs-2.0.0.jar

I also tried building with the original 1.0.1 that was defined in the project as downloaded.

I have tried the remedies I could find online

  • clean the project
  • Maven Update Project (Force update of snapshots/releases)

I had the same problem with the chapter 2 project, but ended up skipping over it.

The project does not run, as a result of this error in the build.

Thanks.

You should use paged-tabs:1.0.1 which is the most recent (there’s no 2.0.0). However, I just checked on Vaadin Directory and the component is not available with Maven for some reason. I’ll ping the team in charge of this and let you know. Meanwhile you can git clone and mvn install [this project]
(https://github.com/alejandro-du/paged-tabs). to install the dependency in your local Maven repository.

Alright, 1.0.1 is now available with Maven. Please let me know whether you are able to solve the issue or not.

There seems to be a minor problem with the init. When I created 2 tabs eg. tab1 and tab2. When the view first displayed, the tab1 content will be displayed. Clicking on tab2 will display a blank content. However, clicking back on tab1 and then clicking another time on tab2 will then display tab2 content. Is there a way to fix this problem?

P Tan, can you share some code?

Yes - the project now builds successfully and runs well. Thanks Alejandro.

Good to hear. Enjoy the book!

	PagedTabs tabs = new PagedTabs();		
	WeekliesView weekliesview = new WeekliesView();  // VerticalLayout with grid
	SermonsView sermonsview = new SermonsView();     // VerticalLayout with grid

	Tab tabweeklies = new Tab();
	Button btnweeklies = new Button("Weeklies");		
	btnweeklies.setIcon(new Icon(VaadinIcon.OPEN_BOOK));
	tabweeklies.add(btnweeklies);		
	tabs.add(weekliesview, tabweeklies);
	
	Tab tabsermons = new Tab();
	Button btnsermons = new Button("Sermons");
	btnsermons.setIcon(new Icon(VaadinIcon.HEADPHONES));
	tabsermons.add(btnsermons);

	tabs.add(sermonsview, tabsermons);

P Tan, I wasn’t able to reproduce the issue. My guess is that the problem might be related to how you are composing the content of the tabs. Can you share a minimal runnable project to reproduce the problem?

The tabs were originally working after the component .jar was added for Maven, however once I added a login screen to the project, I am also now experiencing the same problem as P Tan.

Did anyone get to the bottom of that? I currently only have a project utilizing a database… if need be, I can try to create a minimal runnable project.

Darren B. Please do share a minimal runnable project and I’ll have a look at the issue.

Alejandro - I’ve got a runnable project to demonstrate the issue. How would you like that shared?

Thanks! An attached file here should work.

Here it is.
17229632.zip (70 KB)

Darren, it seems the file is corrupted. Can you please attach it again? (make sure you don’t include compiled code by running mvn clean before creating the zip file).

Trying it again
17233579.zip (36.9 KB)

Cannot download the file.

Sorry - was away on vacation… Another attempt - rename file to .zip and it seems to work for me now.
17252600.zap (36.9 KB)