あなた自身の答えに続く単なる提案:
ID からウィジェット名を取得する変換テーブルをどこかに置くことで、おそらく機能させることができます。
たとえば、次のように定義できます。
ScriptProperties.setProperties({'widgetID1':'Name1','widgetID2':'name2'},true)
その後
widgetvalue = e.parameter[ScriptProperties.getProperty(e.parameter.source)]
私はこのコードをテストしませんでしたが、論理的に思えます ;-)、そうでない場合は教えてください (今はテストする時間がありません)
編集:期待どおりに動作します。結果を表示するテストシート、以下のテストコードです。
function Test(){
var app = UiApp.createApplication().setTitle('test');
app.add(app.createLabel('Type anything in upper textBox and then move your mouse over it...'))
var p = app.createVerticalPanel()
var txt1 = app.createTextBox().setId('txt1').setName('Name1').setValue('value in TextBox1')
var txt2 = app.createTextBox().setId('txt2').setName('Name2').setValue('waiting to mouseOver textBox1')
p.add(txt1).add(txt2)
app.add(p)
var handler = app.createServerHandler('mouseOver').addCallbackElement(p);
txt1.addMouseOverHandler(handler);
ScriptProperties.setProperties({'txt1':'Name1','txt2':'Name2'},true);//save the name, only txt1 will be used here
var ss=SpreadsheetApp.getActiveSpreadsheet()
ss.show(app)
}
function mouseOver(e) {
var app = UiApp.getActiveApplication();
var widget = app.getElementById(e.parameter.source);
var widgetValue = e.parameter[ScriptProperties.getProperty(e.parameter.source)]; // ScriptProperties knows the Widget's name
app.getElementById('txt2').setValue(widgetValue) ;// Use the other widget to show result
return app;
}