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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T03:15:03+00:00 2026-06-18T03:15:03+00:00

I am using Dojo 1.8.3 I want to develop a Customizable Form using dnd.

  • 0

I am using Dojo 1.8.3

I want to develop a Customizable Form using dnd. I have a list of form elements in the left dojo/dnd/Source and the container in the right dojo/dnd/Target which is supposed to generate dijits when I drop on it.

<div class="normal" style="width: 99%;  height: 99%;" data-dojo-type="dijit/layout/BorderContainer" 
     data-dojo-props="design:'sidebar', gutters: true, liveSplitters: true">
   <div data-dojo-type="dijit/layout/ContentPane"  class="normal" style="width: 30%;  height: 80%;" 
                         data-dojo-props="splitter: true, region: 'left'">

     <div data-dojo-type="dojo/dnd/Source" data-dojo-id="form_tools" id="form_tools"  data-dojo-props="copyOnly: true"   
                                 class="container" style="width:99%;">
                        <div class="dojoDndItem" dndtype="heading">Heading</div>
                        <div class="dojoDndItem" dndtype="textbox">Text Box</div>
                        ... 
                </div>
        </div>
        <div data-dojo-type="dijit/layout/ContentPane" class="normal" id="form_container" 
                         style="width: 68%; height: 80%;" data-dojo-props="splitter: true, region: 'center'">

                <div data-dojo-type="dojo/dnd/Target" data-dojo-id="form_items" id="form_items" class="container" style="height: 80%;" accept="heading,textbox">
                        <script type="dojo/on" event="DndDrop"> form.transform_item(arguments[0], arguments[1], arguments[2], arguments[3]);//source, nodes, copy, target </script>                        </div>
        </div>
</div>

In my js function transform_item, I am doing this:

this.transform_item = function(){ 
var dragged_items = arguments[3].selection; 

form_items.forInSelectedItems(function(item, id, map){ 
          var dnditem = dojo.byId(id); 
          switch(item.type[0]){ 
            case "textbox": 
              var textbox = new dijit.form.TextBox({ 
                  name: "textbox", 
                  value: "This is a TextBox" 
              }, "textbox_text"); 

              // HERE IS WHERE I SHOULD INSERT THE CODE FOR GENERATING A TEXTBOX 

              require(['dojo/parser'], function(parser){ 
                parser.parse('textbox_text'); 
              }); 

              break; 
 } 
 }); 
    } 

At this point I’m getting an error when I drop over the Target :

dojo/parser::parse() error 
TypeError: root is null 

var node = root.firstChild; 

How can I make Dojo generate, for example a dijit.form.TextBox when I drag an “textbox” dndtype?

  • 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-18T03:15:05+00:00Added an answer on June 18, 2026 at 3:15 am

    Solved: I have just inserted the textbox in the wrong parent, textbox_text does not exist.So No need of parse();

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

Sidebar

Related Questions

I am using Dojo Toolkit and I want form elements to serialize into array,
I have an HTML form using dojo and have the following code for a
Using dojo.dnd, I want to allow a user to drag only one item at
I have this problem I'm using DataGrid + dojo.store.JsonRest as store. I want to
I am using DOJO 1.8 iand spring mvc. I want to convert my form
I have been using Dojo and Dijit for more than a year to develop
I am using a dojo column chart. I want to add a custom line
I'm building a web-application in JavaScript using the dojo framework. I want to create
I'm using Dojo.dnd to transfer items between to areas. The problem is: the items
I am using the dojo dateTimePicker in my application. Now i want to limit

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.