EDIT :fixed on august 10 this was a short one :-)
I've learned recently to get the value of a tag using e.parameter.widgetName_tag
and it works nicely on widgets like ListBox
or other that can have a name but I tried to use it on a button using its ID (since it cannot be given a name) and something just weird happens...
It used to work without any problem and tonight it suddenly stopped returning its value and gives an ugly 'undefined' instead.
So my question is : how do I get the tag value of a widget that has no name ?
here is a test code I wrote that shows the error (deployed here)
function doGet(e) {
var app = UiApp.createApplication();
var panel = app.createVerticalPanel();
var lbl = app.createTextBox().setWidth('400').setId('lbl');
lbl.setText('Click here').setTag('tag value UI');
var btn = app.createButton('Test button with a tag value but no function').setId('btn').setTag('btn tag value')
app.add(panel.add(lbl).add(btn));
var CH = app.createServerHandler('showtag').addCallbackElement(panel);
lbl.addClickHandler(CH)
return app;
}
function showtag(e){
var app = UiApp.getActiveApplication();
var lbl = app.getElementById('lbl')
lbl.setText('TextBox tag value ='+e.parameter.lbl_tag+'---button tag ='+e.parameter.btn_tag);
return app
}