GWT communication problems

Dear Vaadin developer
I have a very big problem. I have integrated a gwt widget into my VAADIN project. Everything worked fine. But then i tested the commuication between the client and the server. And there was no communication. The UI got the information from the server and displays it correctly. But if a user enters some information into the UI and i want to send this information to the server no communication between the components is available.
I implemented everything as written in the VAADIN book. I used the VAADIN eclipse plugin to generate the widgetset and i override the method for sendin the information from the client to the server. But this method is never called. But it must be called if I trigger a button event on the compiled gwt widget.
Please help me, because I don’t know what to do and how to handle this problem. If you need more information just ask i will try to give you as much information as you need.

With best regards

Aleksandar

With this limited information, a few points to check.

First, to make it clear, please confirm whether the client side method that you want to send information from is actually called. Is the problem there or in that the server side method changeVariables() is not called?

If the client side method is not called, the problem is in registering a GWT listener or otherwise in the client side GWT code.

If the client side works but the server side method is not called:

Is the variable you are trying to use registered by the server side component (typically in paintContent()) with PaintTarget.addVariable()?
As a quick recap on terminology, attributes only go from server to client once when set whereas variables make a round trip (from server to client and then possibly multiple times back to the server when events occur on the client).

Also, note that calls to updateVariable() are queued on the client side until there is an “immediate” update from some component, at which time all queued updates are sent to the server.

Typically components let the server side set an “immediate” flag, e.g. an immediate TextField sends its value to the server as soon as it loses focus, whereas a non-immediate one only when a button is clicked or some other immediate event takes place.

Most components manage this by using an “immediate” attribute that the server communicates to the client to tell it how to call updateVariable(), whereas some (like the Button) are always immediate.

If these do not help, please provide more detailed information on what works and what doesn’t.

Henri

The client side method that i want to send information from is called. The server side method changeVariables() isnt’ called. There i have a question. When is the changeVariables() method called? Can i trigger the calling?

The variable is registerd in the paintContent() method and the variables are correct. That means from server to client the variables are correctly filled with the expected values.

Also the immediate state is set to true, so that all changes will be sent immediately to the server.
My main problem is the not calling of the changeVariables() method. How could i solve this problem.

With best regards

Aleksandar Tolev

On the client side, everything happens in ApplicationConnection. When an immediate variable change is queued, updateVariable() indirectly calls makeUidlRequest(), which actually sends all queued changed variables to the server.

You can see whether the correct variable changes are sent by appending “?debug” to your application URL. In the debug console, you should see "Making UIDL Request with params: "… followed by "Server visit took "… when making variable changes. It is a good idea to give a debug ID to your component with setDebugId() to make it easier to make sure the changes are sent with the correct component ID.

On the server side, all requests from the browser are received by AbstractApplicationServlet.service(). When a UIDL request is received from the client, it is immediately “forwarded” to CommunicationManager, which actually processes any UIDL (and file upload) requests. VariableOwner.changeVariables() should be called as soon as the request comes in.

In case you need to trace the execution on the server side, CommunicationManager.handleVariables() is the method that should call your changeVariables().

Hi Henri,
it works. I am not sure why, but now the changeVariables() method is called. Maybe it was an old widgeset compiled or anything else i am not sure, but now it works. Thank you very much for your help.
But now i have another problem.
If i want to load the widget again, it seems that the widget saves the state and displays what was displayed at last. If i am not wrong, anytime if i call my widget, the updateFromUIDL method should be called to send the new information and to update the client. Is that correct? If yes, then i think that this method isn’t called. Or is the widget everytime cleared and newly rendered if you call it?

With best regards

Aleksandar Tolev

I’m not sure what you mean by ‘load widget again’?

Generally, updateFromUIDL() is called when the server tells the client that the component has changed. If your problem is that you change the component on the server, but no changes are seen on the client, then you have probably forgot to call requestRepaint(), e.g:

    public void setCaption(String caption) {
        this.caption = caption;
        [b]
requestRepaint();
[/b]
    }

All setters that modify the component visually, should usually call requestRepaint().

If you look at the debug console that Henri mentioned above, you can actually see what the server sends - if the server does not send an update, then your problem is on the server side. If the server sends an update, but the widget still is not updated, then you have a client-side problem.

Example of the debug console showing Button UIDL:


If you instead want to
reset
the state of the component, then you should do so on the server side by resetting the objects state and then calling requestRepaint().

Best Regards,
Marc

Hi
I mean, that i click on a button and then the widget is shown. If i do this twice, the widget shows me the last view and the new view. I am sure that the server sends the data i want to so i think it is a client side problem. I tried to call the requestRepaint() but i am not sure where to call it. I try to call the repaint method when i click on the button which shows the widget but it doesn’t have any effect.
To make it clearer here is a scenario.
A user clicks on a button. This action opens the gwt widget, which is shown correctly and everything works fine. The data is sent to the client and is shown correctly. After that the user saves his changes by clicking a button in the widget (this is a gwt event, it is called within the gwt widget). This calls the changeVariables method and the changes are saved. Now he leaves the widget and works on other parts on the website. Then he wants to get back to the widget. He clicks the button which opens the widget and now the old changes are shown and the new information are shown.
I hope this scenario explains my problem better. The solution is clear but i am not sure where to put the requestRepaint().
Thanks for your help

With best regards

Aleksandar

You need to reset the components state on the server, the call requestRepaint() - this will cause updateFromUIDL() to be called with the reset values. I really can’t tell you more specifically where to call requestRepaint(), without knowing more about your component.

class Foo  extends AbstractComponent {
   ...
   public void reset() {
      // you might want to do this in some other way, but as an example
      this.isBar = false;
      this.notes = "";
      requestRepaint();
   }
}

You might also benefit from reading a little documentation, especially
10. Developing custom components

Best Regards,
Marc

Hi,
I tried everything but it doesn’t work. so here is the relevant code. The client and server side and the class which calls the widget.
this is the server side component.


/*
 * The DecidR Development Team licenses this file to you under
 * the Apache License, Version 2.0 (the "License"); you may
 * not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

package de.decidr.ui.data;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpSession;

import org.apache.log4j.Logger;
import org.jdom.Document;
import org.jdom.Element;
import org.jdom.output.XMLOutputter;

import com.vaadin.data.Item;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
import com.vaadin.ui.AbstractComponent;

import de.decidr.model.acl.roles.Role;
import de.decidr.model.annotations.Reviewed;
import de.decidr.model.annotations.Reviewed.State;
import de.decidr.model.exceptions.TransactionException;
import de.decidr.model.facades.TenantFacade;
import de.decidr.model.facades.WorkflowModelFacade;
import de.decidr.model.logging.DefaultLogger;
import de.decidr.ui.view.Main;
import de.decidr.ui.view.windows.TransactionErrorDialogComponent;

/**
 * This class represents the server side component of the modeling tool widget
 * which is integrated into the Vaadin web portal. It is used to communicate
 * with the client side of the modeling tool widget. The modeling tool is an
 * abstract component which is wrapped by a window and displayed to the user.
 * 
 * @author AT
 * @author Jonas Schlaak
 */
@Reviewed(reviewers = { "RR" }, lastRevision = "2353", currentReviewState = State.Passed)
public class ModelingTool extends AbstractComponent {

    private static final long serialVersionUID = -2284244108529453836L;

    private Logger logger = DefaultLogger.getLogger(ModelingTool.class);

    private HttpSession session = null;
    private Long tenantId = null;
    private Role role = null;
    private TenantFacade tenantFacade = null;
    private WorkflowModelFacade workflowModelFacade = null;
    private Long workflowModelId = null;
    private HashMap<Long, String> userMap = null;
    private String name = "";
    private String description = "";

    /**
     * Initializes the server side components which are needed to gain access to
     * the database.
     */
    public ModelingTool(Long workflowModelId) {
        super();
        session = Main.getCurrent().getSession();
        role = (Role) session.getAttribute("role");
        tenantId = (Long) Main.getCurrent().getSession().getAttribute(
                "tenantId");
        tenantFacade = new TenantFacade(role);
        workflowModelFacade = new WorkflowModelFacade(role);
        this.workflowModelId = workflowModelId;
        this.setSizeFull();
        this.setImmediate(true);
        this.setDebugId("modelingTool");

        Main.getCurrent().getUIDirector().getTemplateView().getContent()
                .getWidth();
    }

    @Override
    public String getTag() {
        return "modelingtool";
    }

    /*
     * (non-Javadoc)
     * 
     * @see com.vaadin.ui.AbstractComponent#changeVariables(java.lang.Object,
     * java.util.Map)
     */
    @SuppressWarnings("unchecked")
    @Override
    public void changeVariables(Object source, Map variables) {
        super.changeVariables(source, variables);
        logger.debug("[Modeling Tool]
 Trying to store the DWDL...");
        if (variables.containsKey("dwdl")) {
            String dwdl = variables.get("dwdl").toString();
            byte[] dwdlByte = dwdl.getBytes();
            try {
                workflowModelFacade.saveWorkflowModel(workflowModelId, name,
                        description, dwdlByte);
                logger.debug("[Modeling Tool]
 DWDL stored successfully.");
            } catch (TransactionException e) {
                Main.getCurrent().addWindow(
                        new TransactionErrorDialogComponent(e));
                logger.debug("[Modeling Tool]
 DWDL storing failed.");
            }
        } else {
            logger.debug("[Modeling Tool]
 Client variables did not"
                    + " contain a dwdl key.");
        }
    }

    /**
     * Converts a user map into an XML string. This has to be done because the
     * Vaadin interface can only transmit simple types.
     * 
     * @param userMap
     *            list of tenant users as map
     * @return xml formatted user list
     */
    private String convertUserMapToString(HashMap<Long, String> userMap) {
        Document doc = new Document();

        doc.setRootElement(new Element("userlist"));

        for (Long userId : userMap.keySet()) {
            Element user = new Element("user");
            user.setAttribute("id", userId.toString());
            user.setAttribute("name", userMap.get(userId));
            doc.getRootElement().addContent(user);
        }

        return new XMLOutputter().outputString(doc);
    }

    private String getDWDL() {
        try {
            Item workflowModel = workflowModelFacade
                    .getWorkflowModel(workflowModelId);
            name = workflowModel.getItemProperty("name").getValue().toString();
            description = workflowModel.getItemProperty("description")
                    .getValue().toString();
            logger.debug("[Modeling Tool]
 Retrieving dwdl document was"
                    + " successfull");
            return new String((byte[]) workflowModel.getItemProperty("dwdl")
                    .getValue());
        } catch (TransactionException e) {
            Main.getCurrent().addWindow(new TransactionErrorDialogComponent(e));
            logger.debug("[Modeling Tool]
 Retrieving dwdl document failed");
            return null;
        }
    }

    private String getUsers() {
        userMap = new HashMap<Long, String>();
        try {
            logger.debug("[Modeling Tool]
 Trying to get "
                    + "the tenant user list...");
            List<Item> users = tenantFacade.getUsersOfTenant(tenantId, null);
            for (Item item : users) {

                if (item.getItemProperty("username") == null
                        || item.getItemProperty("username").getValue() == null
                        || item.getItemProperty("username").getValue().equals(
                                "")) {
                    /*
                     * If the username is empty, we want to display the email
                     * address as username.
                     */
                    userMap.put((Long) item.getItemProperty("id").getValue(),
                            (String) item.getItemProperty("email").getValue());
                } else {
                    /*
                     * username is not empty, but we want to set the username to
                     * a more "fancy" string, for example: John Doe (jdoe42)
                     */
                    Long id = (Long) item.getItemProperty("id").getValue();
                    String username = (String) item.getItemProperty("username")
                            .getValue();
                    userMap.put(id, username);
                }
            }
            logger.debug("[Modeling Tool]
 Succeded retrieving "
                    + "tenant user list. No. of users: " + userMap.size());
            String userXMLString = convertUserMapToString(userMap);
            return userXMLString;
        } catch (TransactionException exception) {
            Main.getCurrent().addWindow(
                    new TransactionErrorDialogComponent(exception));
            logger.debug("[Modeling Tool]
 Failed retrieving tenant user list.");
            return null;
        }
    }

    /*
     * (non-Javadoc)
     * 
     * @see
     * com.vaadin.ui.AbstractComponent#paintContent(com.vaadin.terminal.PaintTarget
     * )
     */
    @Override
    public void paintContent(PaintTarget target) throws PaintException {
        super.paintContent(target);
        target.addVariable(this, "dwdl", getDWDL());
        target.addVariable(this, "users", getUsers());

        /*
         * Set width of the modeling too scroll panel. Height is a constant
         * because the getHeight() values are wrong
         */
        int width = new Float(Main.getCurrent().getUIDirector()
                .getTemplateView().getContent().getWidth()).intValue();
        target.addVariable(this, "width", width);
        // Main.getCurrent().getUIDirector().getTemplateView().getContent().getHeight();
        target.addVariable(this, "height", 500);

    }
}

This is the client side component.


/*
 * The DecidR Development Team licenses this file to you under
 * the Apache License, Version 2.0 (the "License"); you may
 * not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

package de.decidr.ui.view.client.ui;

import com.vaadin.terminal.gwt.client.ApplicationConnection;
import com.vaadin.terminal.gwt.client.Paintable;
import com.vaadin.terminal.gwt.client.UIDL;

import de.decidr.modelingtool.client.ModelingToolWidget;

/**
 * This class represents the client side from the modeling tool integrated in
 * the web portal
 * 
 * @author AT
 * @author JS
 */
public class VModelingTool extends ModelingToolWidget implements Paintable {

    /** Set the tagname used to statically resolve the widget from UIDL. */
    public static final String TAGNAME = "modelingtool";

    /** Set the CSS class name to allow styling. */
    public static final String CLASSNAME = "v-" + TAGNAME;

    /** Component identifier in UIDL communications. */
    String uidlId;

    /** Reference to the server connection object. */
    ApplicationConnection client;

    /**
     * The constructor should first call super() to initialize the component and
     * then handle any initialization relevant to Vaadin.
     */
    public VModelingTool() {
        super();
        // This method call of the Paintable interface sets the component
        // style name in DOM tree
        setStyleName(CLASSNAME);
    }

    @Override
    public void sendDWDLtoServer(String dwdl) {
        
        super.sendDWDLtoServer(dwdl);

        // Updating the state to the server can not be done
        // before the server connection is known, i.e., before
        // updateFromUIDL() has been called.
        if ((uidlId == null) || (client == null)) {
            return;
        }

       

        // Communicate the user interaction parameters to server.
        // This call will initiate an AJAX request to the server.
        client.updateVariable(uidlId, "dwdl", dwdl, true);

    }

    public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
        // This call should be made first. Ensure correct implementation,
        // and let the containing layout manage caption, etc.
        if (client.updateComponent(this, uidl, true)) {
            return;
        }

        // Save reference to server connection object to be able to send
        // user interaction later
        this.client = client;

        // Save the UIDL identifier for the component
        uidlId = uidl.getId();

        // Set the DWDL document received from server
        setDWDL(uidl.getStringVariable("dwdl"));

        // Set the user list received from server
        setUsers(uidl.getStringVariable("users"));

        // Set the scroll panel to the size given by the server
        
        setScrollPanelSize(uidl.getIntVariable("width"), uidl
                .getIntVariable("height"));
    }
}

And this is the method where i call the widget.


/*
 * The DecidR Development Team licenses this file to you under
 * the Apache License, Version 2.0 (the "License"); you may
 * not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

package de.decidr.ui.controller.show;

import java.util.Iterator;
import java.util.Set;

import com.vaadin.data.Item;
import com.vaadin.ui.Table;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;

import de.decidr.model.annotations.Reviewed;
import de.decidr.model.annotations.Reviewed.State;
import de.decidr.ui.controller.UIDirector;
import de.decidr.ui.data.ModelingTool;
import de.decidr.ui.view.Main;
import de.decidr.ui.view.SiteFrame;
import de.decidr.ui.view.windows.InformationDialogComponent;

/**
 * Opens the modeling tool.
 * 
 * @author AT
 */
@Reviewed(reviewers = { "RR" }, lastRevision = "2348", currentReviewState = State.Passed)
public class ShowModelingToolAction implements ClickListener {

    private static final long serialVersionUID = 1L;
    UIDirector uiDirector = Main.getCurrent().getUIDirector();
    SiteFrame siteFrame = uiDirector.getTemplateView();

    private Table table = null;

    /**
     * Constructor which stores the table where the workflow model is selected.
     */
    public ShowModelingToolAction(Table table) {
        this.table = table;
    }

    /*
     * (non-Javadoc)
     * 
     * @seecom.vaadin.ui.Button.ClickListener#buttonClick(com.vaadin.ui.Button.
     * ClickEvent)
     */
    @Override
    public void buttonClick(ClickEvent event) {
        Set<?> set = (Set<?>) table.getValue();
        if (table.getValue() != null && set.size() == 1) {
            Iterator<?> iter = set.iterator();
            while (iter.hasNext()) {
                Item item = (Item) iter.next();
                siteFrame.setContent(new ModelingTool((Long) table
                        .getItem(item).getItemProperty("id").getValue()));
            }
        } else {
            Main.getCurrent().getMainWindow().addWindow(
                    new InformationDialogComponent(
                            "Please select exactly one workflow model",
                            "Information"));
        }
    }
}

I hope this will help you. If not I can give you more information.

With best regards

Hi
is there anybody who can help me with this problem?

Aleks

Skimmed the source through, but I am not sure if I understand the problem correctly. Still some points to check:

In ShowModelingToolAction you are creating a new modeling tool for each buttonClick. Does the new modeling tool really contain the changed state?

In ModelingTool you update the component state stored in workflowModelFacade from changeVariables. Do you update the state by some other means also? Each method (in ModelingTool) that changes the state should call requestRepaint (in the same component) to ensure that the state will be sent to client asap. Call to requestRepaint is really cheap, so you can call it as often as you like.

Hi Joonas
i tried everything and i am going nuts. I don’t know why,but all the request repaints doesn’t work. I hope that the new modeling tool contains the new state. But i am not sure. Is there a way to get to know this? I think that everytime i create a new modeling tool it is newly built and replaces the old component. Or could it be that the widget is stored in the cache? But now i have a bigger problem. I worked with the debug console and i get a weird error message.



Here starts the error message

(TypeError): j is null fileName: http://localhost:8080/WebPortal/VAADIN/widgetsets/de.decidr.ui.view.MainWidgetset /2E523DE0F08B90E96989ECDDCC25C0B9.cache.html lineNumber: 5891 stack: t7f([object Object]
,[object Object]
)@http://localhost:8080/WebPortal/VAADIN/widgetsets/de.decidr.ui.view.MainWidgetset/2E523DE0F08B90E96989ECDDCC25C0B9.cache.html:5891 t2f(“\n\t\t\tWorkflow to organize a party!\n\t\t\n\t\t Party organization successfully finished!\n\t\t \n\t\t Boss\n\t\t \n\t\t boss@example.com\n\t\t \n\t\t\t\t\tSends all guest an invitation\n\t\t\t\t\n\t\t\t\t\t\tParty invitation\n\t\t\t\t\t\n\t\t\t\t\t\tDear friend, i would like to invite you to my party. \n\t\t\t\t\t\tYou soon will be prompted to fill out a form.\n\t\t\t\t\t\tRegards,\n\t\t\t\t\t\tMr. X\n\t\t\t\t\t\n\t\t\t\t\t1\n\t\t\t\t\n\t\t\t\t\t$guests\n\t\t\t\t\n\t\t\t\t\tAND\n\t\t\t\t\n\t\t\t\t\t\t\tTask to figure out who will attend the party\n\t\t\t\t\t\t\tand what he is going to bring.\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tjf54sdfasdfsdfeopei4\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$g\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tInvitation form\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tPlease fill in the form. It would be nice if somebody\n\t\t\t\t\t\t\t\tcan bring a cake and a barbecue. I’m looking forward\n\t\t\t\t\t\t\t\tto meet you.\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tyes \n\t\t\t\t\t\t\t”)@http://localhost:8080/WebPortal/VAADIN/widgetsets/de.decidr.ui.view.MainWidgetset/2E523DE0F08B90E96989ECDDCC25C0B9.cache.html:5763 AFg([object Object]
,[object Object]
)@http://localhost:8080/WebPortal/VAADIN/widgetsets/de.decidr.ui.view.MainWidgetset/2E523DE0F08B90E96989ECDDCC25C0B9.cache.html:6725 kMf([object Object]
,[object Object]
)@http://localhost:8080/WebPortal/VAADIN/widgetsets/de.decidr.ui.view.MainWidgetset/2E523DE0F08B90E96989ECDDCC25C0B9.cache.html:5395 d5e([object Object]
,[object Object]
)@http://localhost:8080/WebPortal/VAADIN/widgetsets/de.decidr.ui.view.MainWidgetset/2E523DE0F08B90E96989ECDDCC25C0B9.cache.html:4103 r3e([object Object]
,[object Object]
)@http://localhost:8080/WebPortal/VAADIN/widgetsets/de.decidr.ui.view.MainWidgetset/2E523DE0F08B90E96989ECDDCC25C0B9.cache.html:4141 DGd([object Object]
,[object Object]
)@http://localhost:8080/WebPortal/VAADIN/widgetsets/de.decidr.ui.view.MainWidgetset/2E523DE0F08B90E96989ECDDCC25C0B9.cache.html:2800 aHd([object Object]
)@http://localhost:8080/WebPortal/VAADIN/widgetsets/de.decidr.ui.view.MainWidgetset/2E523DE0F08B90E96989ECDDCC25C0B9.cache.html:2802 ([object Event]
)@http://localhost:8080/WebPortal/VAADIN/widgetsets/de.decidr.ui.view.MainWidgetset/2E523DE0F08B90E96989ECDDCC25C0B9.cache.html:2842

There are two seperate ways to call the modeling tool.

  1. If you click on a button and this button opens a window. In this window you can enter a text (e.g. name). If you then click on the ok button in this window the modeling tool is opened with a given id. This id is selected from a table and passed through the constructors of the action and the window.
  2. The second way is, you choose an item from a table and the user clicks on the edit button. From the selected item the id is passed to the modeling tool, so it can generate the process which should be displayed in the modeling tool widget.

I got this error message if i call the modeling tool described in the second way.
Is this a known error or does somebody has this error, too. If yes, i would appreciate if someone could tell me how he fixed this problem.

With best regards

Aleks[size=3]

[/size]

The error message indicates a javascript error occurs. Your best bet would be to recompile your widgetset using Pretty or Detailed mode. Then the javascript method names will be similar to the java method names instead of something like “t7f” and you will be able to find out what is causing the error.

If you are using the Eclipse plugin to compile the widgetset, go to project preferences → Vaadin and change “Javascript style”. If you are using something else, add “-style DETAILED” to the compiler call.

Another option is to set up the OOPHM hosted mode (
guide
). Then you can debug the client side also and set a breakpoint e.g. for NullPointerException and trace what is going on.

A little note about that guide:

There is instructions on how to set up a hosted mode launch configuration, but it is much easier to use Eclipse + Vaadin plugin to set it up, if you use those tools. You do it like this click on the project → Properties → Vaadin → Create hosted mode launch. It will create a .launch file in your project that in turn can create the launch configuration.

I guess this should be documented into the OOPHM guide.

The only downside with this way is that the launch configuration doesn’t give you the url parameter in its console which you need, while the guide way of doing it will. The parameter is something like /?gwt.hosted=localhost:9997 in the end of the url.

Contributions to wiki page are welcome :wink:

Hi
thank you for your fast response. The -style argument helped me a lot. I couldn’t find the error yet, but now i have a direction where to go :grin:
I tried using the OOPHM, but i recognized that it is more difficult than explained in the wiki. My prolbem is that i am working with Vaadin 6.0. And i need a MainWidgetSet to build my widgets. I tried using Vaadin 6.2, but then i got errors from some methods, for example createWidget needs one more parameter. Also i tried the button in the toolbar but here i have a question. How can i insert something to my classpath? If I add some inheritance to the gwt.xml i have to add it in the classpath, too. This i have done before in the compilewidgetSet.launch file. But now there isn’t such a file.
I know everything sounds confusing, because i am trying several ways at the same time. To make it clear.

  1. If I am using VAADIN 6.0 do I have to pay attention on something, or can i do the step by step without paying attention on anything?
  2. Would it be possible to use VAADIN 6.2 and to compile my widget via the button in the eclipse toolbar and adding inheritances to my gwt.xml?
  3. If i use the OOPHM way now,it tells me that he failed to load the widgetset, when he tries to download it.

Also, why don’t you use the HostedMode compiler from gwt? Now if I recognized it correctly you use the GWTShell compiler in your documentation?

With best regards

Aleks

Have you seen the upgrade instructions in
the release notes
?

Hi
this helps a lot, and i updgraded it, but the thing with another project doesn’t seem to work. I exported a gwt project into a jar and added it to my pom.xml because i am using maven. Then I clicked on the compile widget button and he compiles only the files for the default widget set and not for my specific gwt widget. In my .gwt.xml there is only the user agent property and the inheritance for the default widget set.
In earlier version there were a lot more inheritance tags, for inheriting external jars.
A step by step tutorial would be perfect if one exists,if not any other help is useful, too.

Aleks

Your project widgetset should inherit each external widgetset/GWT module you need (typically the DefaultWidgetSet and your own GWT modules).

Here are some ways I remember for adding the “inherits” statements:

  • use the Eclipse plugin 1.1 and drop a JAR with a GWT module to the project (especially WEB-INF/lib; note that Maven dependencies are not in the project but only referenced)
  • use the new vaadin-maven-plugin Maven plugin (goal vaadin:update-widgetset) to add Maven dependencies to your widgetset (use the latest Maven Vaadin archetypes or see
    Vaadin Maven integration
    )
  • run the Vaadin widgetset compiler or updater class (WidgetsetCompiler or WidgetsetBuilder? I don’t remember right now) with the modules on the classpath
  • edit the widgetset by hand

The JARs with GWT modules (including the client side sources) should be on the widgetset updater / GWT compiler classpath.