India Meetup Group Q&A Session

Hello Team,

It would be great if you could come up with set of tutorials with respect to developing pure Client Side Widget and integrating the same with Vaadin Backend. Though we have a wiki page it is not that exhaustive.
What I’m looking at is a good lauching pad to start writing a Client side Widget.

Can you please look in to it.

Thanks,
Krishna.

What precautions should be take if we change the existing component code as the new version of vaadin is released. Do you have any plugin or extenstion architecture like it is in Liferay

  1. Push notification from where is the question? If you have @Push annotated ui, you can just modify your uis from any other thread and the change will happen automatically for the client. Similarly if you have enabled “polling” as well. Be sure to change your UIs sychronously. Easiest and safest method is to use UI.access(Runnable) method.
  2. Panels (including splitpanel) have scrollable content by default. Using them is the easiest method, but you can also do “overflow:auto” hacks with CSS.
  3. Couple of tricks: You should only build your widgetset during clean build and ofter version updates. Widgetset building can also be split to separate module in multimodule maven project to avoid non relevant gwt compilations. During extension development you’ll naturally need to do this, but there you can use devmode/superdevmode. Updating to latest Vaadin version will also cut down the compilation time dramatically. GWT has developed a lot on this field lately.

Hi,

I’m afraid this is an issue we just cannot fix. WebSockets in Tomcat 7 are still very fragile and everything is not possible. If you can upgrade to Tomcat 8, or some other server like jetty, the issue should be resolved.
See this change
for more details.

cheres,
matti

  1. This has been on a list of possible technical articles for too long. Hopefully we can cover this soon. Practically my suggestion is use TestBench (or plain Selenium/WebDriver), write clean well structured cases, code “that is a story”. This way you’ll get the whole user stories written and can see in your test statuses how your application proceeds while doing actual development. And, you are testing the whole stack.
  2. With Spring and Vaadin and Hibernate, my suggestion is to grab
    vaadin4spring
    , use Spring Data JPA (hibernate by default) and just inject the auto generated repositories. This is very easy to do, I have used that in some examples. I also created an enhancement ticket to
    vaadin4spring project
    . If somebody wants to contribute to this effert, this would be an easy place to start.

As with other web apps. Just ensure it is serializable, so it can be moved to another server if for example one server goes down for maintenance. In any case, I suggest to use sticky sessions, as it is more efficient for the cluster. Also the session don’t necessary need to be serializable either, but then you’ll lose HA features and session failover.

UI.setPollInterval(milliseconds) or enable constantly open communication with @Push annotation and changes will happen right away.

Pretty much standard tools will do: browser inspector and java profiling tools for the server side. There can be various reasons which cause it, but most often it is a badly optimized DB query :slight_smile: One Vaadin specific helper is a dialog one can open in browser with “?debug” query parameter. With that you can see if latencies happen with the request (on server side) or in the browser (might be the case with lots of visible components and slow devices/browser, like IE6).

Definitely maven:

  • Commonly used elsewhere in the industry
  • Not just a package manager, but also does builds and adds project meta data
  • Excellent IDE support, your developers can use their IDE of choise without hazzles

A thing to note is that, although some of our eclipse plugins features are “tied” to IVY, you practically don’t need them with maven build. Maven build will update your versions, theme and widgetset, with a nice IDE integration, and the visual designer is there for you with maven builds as well.

TestBench eases writint tests quite a lot compared to plain selenium, but there might still be some things that need to be tackled by developers anyway. I always emphasis that test development shouldn’t be considered as a trivial task, often it might be even harder to do it well than to do the actual application developement. And this is not specific to web app development or vaadin development.

If you want to get started efficiently with TestBench, I suggest to order a training from our experts to your team. You’ll easier learn best practices for testing with Vaadin TestBench.

If you think there is a bug in TestBench itself, you should definitely file it to dev.vaadin.com. A new version is coming out soon so small issue might get fixed for that already.

This is quite generic “issue”, not even related to Vaadin: quering the size of a SQL table is very expensive in some cases. The bad thing is that if you want your entities in a “lazyloading” data table like we have in Vaadin, we just need to have the number for rows available.

If quering size is expensive, I’d first try to cache the value somehow. If not possible you probably just have to ditch lazy loading form you user interface and e.g. just always use a limit clause in your query and do “standard paging”. This is naturally possible with Vaadin as well. I think there are some helpers in the vaadin.com/directory.

I don’t remember that there is built in server side API to do the traditional “Are you sure you want to leave the page?” question. But with JavaScript you can add such a verification as with any other web application.

A built in feature like this might be handy. Dare to write an enhancement ticket to dev.vaadin.com ?

No built in features, but you can hook to pretty much any java authorization framework. Both Vaadin CDI add-on (for java ee world) and vaadin4spring add-on have some helpers to implement role based access control. Check out
this example
, it uses shiro, Vaadin CDI and runs on Java EE 6 servers. It currently just checks roles in the code to enable editing of user database, but we plan to add examples of views that only appear for “admin” role. If I remember correctly it happens simply by adding @RolesAllowed(“admin”) annotation to the view class.

Try
beanutils
or SerializationUtils for cloning, apache commons libraries are excellent helpers, don’t hesitate to use them in any java apps. You could also suggest implementinng Cloneable to dev.vaadin.com.

Could you post a code examle for your donut thingie?

No plans currently, but our experts can use airplane if necessary and it wouldn’t be the first time for them to travel to India. Online support is of couse available to all over the world.

Lots of large enterprises, and several large enterprises are implementing their Vaadin apps by India. See our
“who is using”
page for some references. As Vaadin is an OS product, we naturally only know a fraction of the users.

Try using maven archetype
“vaadin-archetype-widget”
as a basis. Then look help from
the Book
and
minitutorials
. You should get pretty far. But indeed, a tutorial for this would be awesome too, tutorials are great ways to get the basics.

Most often you need to do nothing. We try really hard not to break backwards compatibility. Just full rebuild (with the GWT compilation if you have client side extensions).

And yes, we have all the APIs you need to do extensions. As a proof you can scroll through the almos 500 extensions available in
the Directory
:slight_smile: And note, that there are also some that are not published there.

Thanks for all the valid questions raised! I case you have any other questions later, feel free to create new threads to generic groups of our forum. Our whole community is here to help you.

And when you need professional support, with guaranteed response time, our
pro support
is the service to use. There all questions are handled under NDA, so you can also share some “secret” code snippets easier and answers are easier to give.

Thanks!

Thanks Matti,

For your reply. I will think about writing a tutorial series and contributing back. May be this could help someone who are in real need. By gods grace, till date have not written a single Client side widget, but feel like this doesn’t lasts long.

Thanks,
Krishna.

Wow, nice to hear you have such a long history with Vaadin. You can contact me (sami.kaksonen@vaadin.com) and I’ll setup a meeting where we can go through the benefits of being a Vaadin Solution Partner in more detail.