Form not submitting with FormSender

Hey guys, im new to vaadin i am trying to submit a simple form with FormSender, but it does not seem to redirect me to my page while submitting it…

here is all my code:

the code for my first Window

package com.example.formsenderexample;

import org.vaadin.risto.formsender.FormSender;

import com.vaadin.ui.Button;
import com.vaadin.ui.Label;
import com.vaadin.ui.TextField;
import com.vaadin.ui.Window;
import com.vaadin.ui.Button.ClickEvent;

public class FirstWindow extends Window{
	
	Label l1 = new Label("I am a main window");
	TextField t1 = new TextField("Enter anything");
	Button btn = new Button("Press me after entering the value");
	final FormSender formSender = new FormSender();
	String url;
	
	public FirstWindow(final Window SecondWindow) {
		// TODO Auto-generated constructor stub
		addComponent(l1);
		addComponent(t1);
		addComponent(btn);
		
		formSender.setFormMethod(FormSender.Method.POST);
		url = (String)SecondWindow.getURL().toString();
		
		
		formSender.setFormTarget(url);
		
		btn.addListener(new Button.ClickListener() {
			
			@Override
			public void buttonClick(ClickEvent event) {
				// TODO Auto-generated method stub
				formSender.addValue("value", (String)t1.getValue());
				System.out.println(url);
				
				formSender.submit();
				
			}
		});
	}

}

The code for my Second Window

package com.example.formsenderexample;

import java.util.Map;

import com.vaadin.terminal.ParameterHandler;
import com.vaadin.ui.Label;
import com.vaadin.ui.Window;

public class SecondWindow extends Window
							implements ParameterHandler{
	
	Label l1 = new Label();
	
	public SecondWindow() {
		// TODO Auto-generated constructor stub
		
		l1.setValue("I am a 2nd Window");
		addComponent(l1);
	}
	
	@Override
	public void handleParameters(Map<String, String[]> parameters) {
		// TODO Auto-generated method stub
		//super.handleParameters(parameters);
		
		if(parameters.containsKey("value")){
			String value = parameters.get("value")[0]
;
			
			Label l2 = new Label("Value from the 1st window: " + value);
			
			addComponent(l2);
		}
	}

}

and here is the main application

package com.example.formsenderexample;

import com.vaadin.Application;
import com.vaadin.ui.*;

public class FormsenderexampleApplication extends Application {
	
	
	@Override
	public void init() {
		
		final Window secondWindow = new SecondWindow();
		secondWindow.setName("secondWindow");
		addWindow(secondWindow);
		
		final Window mainWindow = new FirstWindow(secondWindow);
		
		addWindow(mainWindow);
		
		setMainWindow(mainWindow);
		
	}

}

Cmon guys 8 views and no replies…

I hardly think not getting a reply within 8 views is a problem? You should remember that evryone here gives their help for free, so don’t expect
answers right away. If that is what you want, Vaadin Pro is for you. In addition, Formsender is not part of the core, so it may be that most people are
not using it.

Now to answer your original question. FormSender is a component like any other, therefore you need to add it to the layout with the addComponent method.

Hi Rob,

Thanks for the reply…and sorry for being impatient, its just that i have this project due in two days…and im still stuck on it…anyways, thanks again for the reply

how stupid of me, its an abstract component…anyways, thanks alot Rob u saved a life…:grin:

Im in trouble here…

The following code does not return me any errors… but for some reason the POST does not get executed.
The new form is shown, but my BIRT does not receive the parameters or gets called.


private void runReport(HashMap<String, String> params) {
		// TODO Enviar post ao BIRT
		final FormSender formSender = new FormSender();
		Window mainWindow = new Window();
		formSender.setFormMethod(FormSender.Method.POST);
		formSender.setFormTarget("http://localhost:8080/birt/frameset");

		formSender.addValue("__report", "erro.rptdesign");

		for (Entry<String, String> entry : params.entrySet()) {
			formSender.addValue(entry.getKey(), entry.getValue());
		}

		System.out.println(formSender.getValues());

		mainWindow.setImmediate(true);
		mainWindow.addComponent(formSender);
		formSender.submit();
		formSender.requestRepaintRequests();

		getMainWindow().setContent(mainWindow);
	}

I have an issue with FormSender .
I am able to succesfully compile the widgetset and I see the output in \src\main\webapp\VAADIN\widgetsets.
However still when I run the application I get the error :

Widgetset does not contain implementation for org.vaadin.risto.formsender.FormSender. Check its component connector’s @Connect mapping, widgetsets 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.

Any ideas where it would be going wrong

I got this working. There was a dependency on jasper reports , which when when I modified and recompiled, it worked correctly