1

Can anyone confirm that HTML widgets accept ClickHandlers on the Server side ? I can't get my below code to work.

I create a serverHandler (and for good measure I have even added a useless callback element). Subsequently, I add it to a HTML.addClickHander (for good measure I have even added it to .addMouseUpHandler as well). The function is NOT executed.

var mouseclick = app.createServerHandler("handleTrainingClick_").addCallbackElement(lstFilter);
var params = [ "fromOrg", "trainingTitle", "dueDate", "medical", "status" ];
var resultSet = blSelectActiveTrainings_();
while (resultSet.hasNext()) {
    var training = resultSet.next();
    var html = TRAINING_ROW;
    for (var pI in params) {
        html = html.replace("$"+params[pI], training[params[pI]]); 
    }
     pnlList.add(app.createHTML(html).setId(training.id).addClickHandler(mouseclick).addMouseUpHandler(mouseclick)
                   .addMouseMoveHandler(mousemove).addMouseOutHandler(mouseout).addMouseOverHandler(mouseover));

}

function handleTrainingClick_(e) {
    Logger.log(e.source);
    var app = UiApp.getActiveApplication();
    return app;
}
5
  • 1
    Try to remove the _ in the end of the handler name, i.e. handleTrainingClick instead of handleTrainingClick_ Commented Sep 3, 2012 at 11:51
  • megabyte1024 : tried without the underscore - still does NOT work. Commented Sep 3, 2012 at 13:08
  • Can you create and publish a small example by using the Deploy Web App GAS feature and post a source link to this published project here? It will help to understand what is the problem. Commented Sep 3, 2012 at 13:14
  • My mistake, it was incorrect reference in my code. Server side HTML handlers work just fine. Appreciate your efforts. Commented Sep 3, 2012 at 14:05
  • Request: Please put the "it was incorrect reference in my code" in the answer box. (ie you answered your own question). Commented Sep 4, 2012 at 0:57

1 Answer 1

0

HTML widgets server side handlers work just fine. It was an incorrect reference in my code. Thanks all.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.