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

  • SEARCH
  • Home
  • 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 7075879
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:13:50+00:00 2026-05-28T06:13:50+00:00

I have a web app (JSPs and Servlets along with jQuery) that I am

  • 0

I have a web app (JSPs and Servlets along with jQuery) that I am using a DynaTree to show a set of files found using a user search. The user can of course put in different values, resulting in a different set of matching files.

So, my Q:

Given that a tree is statically coded thusly in my JSP’s JavaScript:

$("#tree").dynatree({
  ...
  children: [
    {title: "Folder 2", isFolder: true, key: "folder2",
      children: [
        {title: "Sub-item 2.1"},
        {title: "Sub-item 2.2"}
      ]
    },
    {title: "Item 3"}
  ]
...

How do I create this structure programmatically? I assume some way to create or access a root and then use addChild( aNode ) or some such, but I don’t find a good example/reference.

Has anyone done this ? 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-05-28T06:13:51+00:00Added an answer on May 28, 2026 at 6:13 am

    Got it to work. Here’s the jQuery:

        $('#findFiles').click(function() {  // Locate HTML DOM element with ID "findFiless" and assign the following function to its "click" event...
        chosenSite = document.getElementById("siteName").value;
        searchVal = document.getElementById("searchFor").value;
        searchTyp = document.getElementById("searchType").value;
        $.get('FileSearchServlet', {siteName: chosenSite, searchFor: searchVal, searchType: searchTyp}, function(responseJson) {    // Execute Ajax GET request on URL of "FileSearchServlet" and execute the following function with Ajax response JSON...
            //-- toClient
            var resultsToClientNode = $("#tree").dynatree("getTree").selectKey("resultsToClient");
            resultsToClientNode.removeChildren();
            toClientFilenames = responseJson.toClient;  //0-N filenames
            $.each(responseJson.toClient, function() {
                resultsToClientNode.addChild({
                  title: this
                });
            });         
           ...
    

    Here’s the JSON in the response (use Firebug > Net > XHR to see it):

    fromClient
    ["O_TE015308_XX_343_182754070041.OLD", "O_TE015308_XX_343_182755030040.OLD", "O_TE015308_XX_353_131142014034.OLD"]
    
    toLab
    []
    
    fromLab
    []
    
    toClient
    ["R_TE015308_XX_340_154659.OLD"]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing a web app using servlets and jsps. I have a question
I have a web app consisting of some JSPs that were previously running on
I'm currently maintaining a small-medium sized java web application (using only plain JSPs/Servlets) that
I've done lots of java web development using jsps and servlets, and I have
I have a web app that users upload files to. I want to authenticate
I currently have a primary Java Web App Project which houses some Servlets, JSPs
I have a web app(ASP.NET 2.0 using C#) that I am working on. In
I have a web app that has standard user model information. I am building
I have a web app which connects to a server using a TCP connection
I have a web app for commercial property management that needs spreadsheet-like functionality for

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.