Tags:
create new tag
view all tags

SID-01269: Depending lists: web and topics

Status: Answered Answered TWiki version: 4.3.2 Perl version: 5.10.1
Category: CategoryJavaScript Server OS: Debian Last update: 14 years ago

Hi,

I'm trying to create two lists (html select): in the first should be all webs of my twiki. After the user has chosen a web out of the list the second list should show all topics in the selected list.

The code should be part of a template. I tried to pass the first value to %TOPICLIST% via javascripts innerHtml(), but then the %TOPICLIST% is not working.

I'd be glad about any suggestion.

Thanks!

-- CarlaReitzenstein - 2011-09-08

Discussion and Answer

%TOPICLIST% is not working because it is handled on the server, and your JavaScript runs on the browser.

You could either (1) pre-load all webs and topics, or (2) load only the web list and load the topic list dynamically.

The first option can be slow if you have many topics in total. If you take this option look into TreePlugin and TreeBrowserPlugin.

The second option is better if you have many topics in total. You would need some Ajax magic to load all topics once a web is selected.

-- PeterThoeny - 2011-09-09

Hi Peter,

thanks for your answer! I should have noticed, that with javascript runing on the browser it's not possible to use a variable ...

So I'll have a look in an AJAX documentation to find a way to implement your second suggestion.

-- CarlaReitzenstein - 2011-09-09

For Ajax you could use the pre-installed jQuery plugin, or a handcrafted solution as described in BlogEntry201101x2.

-- PeterThoeny - 2011-09-10

      Change status to:
ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
SupportForm
Status Answered
Title Depending lists: web and topics
SupportCategory CategoryJavaScript
TWiki version 4.3.2
Server OS Debian
Web server Apache 2.2.17
Perl version 5.10.1
Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2011-09-10 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.