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 8271799
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T06:56:12+00:00 2026-06-08T06:56:12+00:00

I’m trying to make a UI that allow users to select an action for

  • 0

I’m trying to make a UI that allow users to select an action for each agenda item in a spreadsheet. After a user select an action, I would like to update the spreadsheet with the selection. Since the data in the spreadsheet are not static, the UI was written dynamically.

This is how I created the listboxes :

// add labels and a drop down box of actions for each agenda item mark for today
for (i = 0; i < labels.length; i++) {
// labels is an array of objects
var topic = labels[i]['topic'];

// add label to grid
myGrid.setWidget(i, 0, myApp.createLabel(topic));

// the id of each listbox is the content of its corresponding label
var id = ObjApp.camelString(topic)
var lboxActions = myApp.createListBox().setId(id);

//add items to listbox
lboxActions.addItem('Select');
lboxActions.addItem('Add to agenda');
lboxActions.addItem('Move to another meeting');
lboxActions.addItem('Move to a special meetin');
lboxActions.addItem('Move to email');

//add drop down list to grid
myGrid.setWidget(i, 1, lboxActions);

}

I have 3 questions:

1) Which is a better design?

a) Design 1: a save button next to each listbox.

b) Design 2: one submit button at the bottom to save every entry

2) How would I collect information on what the user select? How would I write such handlers? I added the following code for each design but I don’t think I’m doing it right.

a) Design 1: the following lines of code were added to the for loop described above

var buttonSave = myApp.createButton('Save');
myGrid.setWidget(i, 2, buttonSave);

var handlerSelection = myApp.createServerHandler('selectAction');
handlerSelection.addCallbackElement(mainPanel);
buttonSave.addClickHandler(handlerSelection);

b) Design 2: the following lines of code were added outside the for loop

//update spreadsheet when user click "submit"
var handlerUpdate = myApp.createServerHandler('responseToSubmit');
handlerUpdate.addCallbackElement(mainPanel);
buttonSubmit.addClickHandler(handlerUpdate);

mainPanel.add(myGrid);
mainPanel.add(buttonSubmit);
myApp.add(mainPanel);

3) How do I write functions for the handlers? These are not correct because I wasn’t able to extract the information from the list boxes.

a) Design 1

function responseToSave(e) {

   var name = e.parameter.source;
   var selection = e.parameter.name;

   var selectionObj = new Object();

   selectionObj['status'] = selection;
   selectionObj['name'] = name;

   choicesMade.push(selectionObj)

   Logger.log(choicesMade);
   return choicesMade;
}

b) Design 2

function responseToSubmit(e) {
  var myApp = UiApp.getActiveApplication();

  for (i=0; i < labels.length; i++) {
     var lboxId = ObjApp.camelString(labels[i]['topic']);

     //[EDIT] e.parameter.lboxId would not work because lboxId is a string 
     var selection = e.parameter[lboxId];

     choicesMade[labels[i]] = selection;
     }

  Logger.log(choicesMade);
  return choicesMade;
}

Thanks

  • 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-08T06:56:13+00:00Added an answer on June 8, 2026 at 6:56 am

    Q1:
    The design purely depends on what your application is intended to do and how your users use it. There is no ‘better’ design – each of them has its own pros and cons and the choice would be based on how your app is used.
    However, do also consider Design 3 which is saving the changes when the dropdown box is changed. It will be one click less for the user

    Q2 and Q3:
    You should use the setName on the listBox

    var lboxActions = myApp.createListBox().setId(id).setName(id); 
    

    I generally use the same string for the id and the name to avoid confusion, but you should use setName
    After that you can access the item selected in the handler function as

    e.parameter.id
    

    Finally, on buttonSave, you should use the addClickHandler instead of addChangeHandler.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to create an if statement in PHP that prevents a single post
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace

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.