var app = UiApp.createApplication();
//Create a penel which will hold all the elements
var panel = app.createVerticalPanel();
//Create a label, also set a tag to that label. Tag value must be same as the label text
var label = app.createLabel('This is my Label').setId('myLabel').setTag('This is my Label');
var button = app.createButton('Submit');
//Create a invisible label which will be visible after submit,
//and hold the tag value/label text
var labelInfo = app.createLabel().setVisible(false).setId('labelInfo');
//Create a handler for the button
var handler = app.createServerClickHandler('showDates');
//add the panel as a callback element
handler.addCallbackElement(panel);
button.addClickHandler(handler);
//Add all the lements to the panel
panel.add(label).add(button).add(labelInfo);
//Add the panel to the application
//this function will show the dates
//get the active aplication
var app = UiApp.getActiveApplication();
//get the tag value which is equal to the label text
var labelText = e.parameter.myLabel_tag;
app.getElementById('labelInfo').setText(labelText).setVisible(true);