0

Below is snippet where I create a web page / app and show a list. Then on click of item in list I want to replace the list with another list. I try it by using vertical panel as root container and clearing and adding list to it. The web page though keeps showing old list even after handler for new list executes fine.

//user_list function updates vertical panel but the web page still shows old rep_list
 function doGet(e) {
   if(e == null || e.parameter.dvid == null) {
     return rep_list();
   }  
 }

function user_list(path) {

  var app = UiApp.getActiveApplication().setTitle("List Folders");

  var content = app.getElementById('root');

  content.clear();
  var list = app.createListBox();
  //populate list  

  content.add(list);
  return app;

}

function rep_list () {

  var app = UiApp.createApplication().setTitle("List Repositories");

  var content = app.createVerticalPanel().setId('root');
  var list = app.createListBox(true).setId('repoList').setName('repo');
  var handler = app.createServerHandler("listFolders");
  list.addClickHandler(handler)

  //populate list

  content.add(list);

  app.add(content);
  return app;

}

function listFolders(e){
  var repo = e.parameter.repo;
  user_list(repo);
}

Regards,

Miten.

1 Answer 1

1

Your listFolders() function isn't returning a new UI instance. Try:

function listFolders(e){
  var repo = e.parameter.repo;
  var app = user_list(repo);
  return app;
}
Sign up to request clarification or add additional context in comments.

2 Comments

script.google.com/macros/s/… please check it out in webpage it works on pc but not in android browser / android webview. any clue ?
It looks like the listbox works differently in mobile - I tried with iPhone. The box appears, and if you touch the pull-down, the list is there. You could post another question about that.

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.