Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8117199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T04:05:10+00:00 2026-06-06T04:05:10+00:00

What steps will reproduce the problem? Create a MenuBar object (createMenuBar) Create a Server

  • 0

What steps will reproduce the problem?

  1. Create a MenuBar object (createMenuBar)
  2. Create a Server Handler point to menuHandler function (createServerHandler)
  3. Add an item to MenuBar object with the parameters: Name and Handler object;

What is the expected output? What do you see instead?
At the handler function is expected that the parameter return the name of source object that was clicked. Now I see a null value.

On which browser & OS?
Chrome 19.0.1084.56 m
Windows 7 SP1 x64

Please provide any additional information below.

function buildMenu() {
    var app = UiApp.createApplication();

    var myRootMenu = app.createMenuBar(false);
    var txtTest = app.createTextBox().setText("test").setId("txtTest");
    var myHandler = app.createServerHandler("menuHandler").addCallbackElement(txtTest);

    myRootMenu.addItem("File", myHandler );

    app.add(myRootMenu);

    return app;

}

function menuHandler(e) {
    Logger.log(e);
}

The logging output is:
{parameter=null}

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T04:05:12+00:00Added an answer on June 6, 2026 at 4:05 am

    First : this is not an issue tracker, please post what you think are issues where it should be

    Second : if you don’t add any callBackElement to a serverhandler it cannot return any value. Please read the docs carefully.

    Edit : following your comment :

    the value returned by the CallBackElement is linked to its name, so your code should be like this :

    app.createTextBox().setName('test').setText("test").setId("txtTest");
    

    Here is a working example :

    function buildMenu() {
        var app = UiApp.createApplication();
        var myRootMenu = app.createMenuBar(false);
        var txtTest = app.createTextBox().setText("Got it !").setName('test');
        var myHandler = app.createServerHandler("menuHandler").addCallbackElement(txtTest);
        myRootMenu.addItem("File", myHandler );
        app.add(myRootMenu);
      var doc = SpreadsheetApp.getActive();
      doc.show(app);
    }
    function menuHandler(e) {
        Logger.log(e);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Android 2.1 - Eclipse What steps will reproduce the problem? 1. Create new Texture(managed)
I found a strange ToolStripButton double click problem. These steps will reproduce the problem:
I'm trying to create a bookmarklet which will use the jquery-ui - what steps
Steps to reproduce: Create a new C# console project. Write some code: class Foo
Steps to reproduce: set up S3 bucket set up streaming disrtibution generate cloudfront key
Ok steps to reproduce this: prompt> rails test_app prompt> cd test_app prompt> script/generate model
Using the TFS API, I am able to create a TFS item, no problem.
Is this possible to setup Steps To Reproduce field so it's required? It's always
Steps: Run the build including unit tests. Expected result: the unit tests are executed
First steps in FreeBSD: trying to run my installation script. Fast help needed: #

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.