Feature Request: Page.getCurrent().post( String, String, String )

I wrote something at https://vaadin.com/forum#!/thread/8152096/10403579 and I think it is a good simple idea. You should add the possibility to a Page object to do a post. The post should be done from the browser and not the server to keep cookies and authentication. That way, we could have button that do an HTML form post like in the old times. I would let the programmer build the content of the post in case he want the post an XML instead of a form, that situation occurs. Here is an example of how it would work:

[font=courier new]
StringBuilder wContent = new StringBuilder();

wContent.append(URLEncoder.encode(“key1”, “UTF-8”));
wContent.append( “=” );
wContent.append(URLEncoder.encode(“value1”, “UTF-8”));
wContent.append( “&” );
wContent.append(URLEncoder.encode(“key2”, “UTF-8”));
wContent.append( “=” );
wContent.append(URLEncoder.encode(“value2”, “UTF-8”));

Page.getCurrent().post( “some url”, wContent.toString(), “_top” );

Note that this is pretty easy to implement yourself using a (JavaScript)Extension, or even Page.getJavaScript().execute().

You got me, I’m lazy. One of the reason I chose Vaadin is the idea that I won’t have to write Javascript. I hate Javascript as much as I love Java. The good news is, if it’s easy to implement for me, it’s easy to implement for Vaadin!

Well, then you can do a regular Extension and write the clientside in GWT :slight_smile: I’m not saying that it definitely will never happen, but the Extension API is there for a reason - we cannot add everyone’s favorite feature to the core even if an individual feature might be easy to implement. Do feel free to open an enhancement ticket at dev.vaadin.com though.