Custom widgetsets with Portlet 2.0

Hello,

How to develop custom widgets for Portlet 2.0 Vaadin application?

I tried Vaadin widget wizard that Eclipse plugin provides. And compiled it. And changed widgetset parameter in portlet.xml. But it doesn’t work. Portlet prints empty.

Then I tried copying VAADIN folder to webapps/ROOT/html/VAADIN. Then my portlet printed message that widgetset doesn’t contain implementation for my widget.

The widgetset cannot be loaded from the portlet so you must deploy it to webapps/ROOT/html/VAADIN/widgetsets. It sounds like your second approach is the correct but there seems to be a problem with building your widgetset as it does not contain an implementation for your widget.

Have a look at the widgetset compilation output (enable verbose output in Eclipse if using the plugin) and make sure the component is listed in the list of widgets included in the widgetset. If it is not listed, it won’t work. If there is an ERROR message, chances are you need to fix that problem.

I enabled verbose output and recompiled widgetsets. It didn’t show any errors and my custom component was listed in the verbose output. But it still doesn’t work.

Currently my widget is inside the portlet project and I just copy VAADIN folder to ROOT/html folder. Widget classes and gwt xml definition are in the portlet classpath. Is this correct or do I need have them somewhere else as well?

What is the recommended way to do this? I have Liferay Extension Environment also. Should I add my widgets to the Liferay Extension Environment and deploy them with it?

Were you able to resolve your issue? I am running into similar problems.

Preferred method is to use portal-wide widgetset served within liferay. You have to copy your compiled custom widgetset in liferays html -directory.

BUT…
You can also create your own ApplicationPortlet (extend porletapplication2) and override getWidgetsetURL method. Example you can run liferay in non-root context and portlets can use widgetset that is loaded from another context.

hello, I have enabled (and changed) this entry


  <portlet>
   ...
        <init-param>
            <name>widgetset</name>
            <value>org.vaadin.markstein.icepush.widgetset.IcepushdemoWidgetset</value>
        </init-param>

in portlet.xml