开发者

Submit Form without transferring to the target(Vaadin)

I'm using an FormSender addon of Vaadin to send some data to my servlet via POST works like that:

FormSender formSender = new FormSender();
    formSender.setFormMethod(FormSender.Method.POST);
    formSender.setFormTarget("Servlet URL");

If(event.getSource() == Submit){
            formSender.addValue("UserName", (String) UserName.getValue());
            formSender.addValue("Password", (String) Password.getValue());
            formSender.addValue("DataBase", (String) DatabaseName.getValue());

if(!UserName.getValue().equals("")&& !Password.getValue().equals("")&& !DatabaseName.getValue().equ开发者_开发问答als("")){
                formSender.submit();
}
    }

now if I click on Submit button I get transferred away from my current page to the target ("Servlet URL"). is there a way to just notify the user when he clicks the button that the i've got the values without transferring him from the current page?

Info: I'm working with eclipse(Helios) on a Liferay(6.0) Portal with the Vaadin(6.6.6) plugin in a Vaadin portlet


Im not sure if you can accomplish this without getting transfered as long as you use the FormSender addon, however, you coudl let vaadin use a regular java urlconnection to send the data "manually" to the server. Here is a post on the vaadin forum to help you

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜