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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T04:52:30+00:00 2026-06-09T04:52:30+00:00

So, I know I can query for nodes not just in the entire DOM

  • 0

So, I know I can query for nodes not just in the entire DOM but also within a context node, like this:

var myNode = dojo.query('#formId', 'idContext');

This way I can get the right node even if there is another using the same id in the DOM.

What I’m trying is to create widgets based on a contextualized node. Instead of :

    new Form({
        method: 'post',
        action: 'aaa/bbb'
    }, 'formId');

I’m trying

    new Form({
        method: 'post',
        action: 'aaa/bbb'
    }, myNode);

But FBug logs the error:

TypeError: _13.hasChildNodes is not a function
[Break On This Error]   

while(_13.hasChildNodes()){

So, it seems I’m setting a wrong object in Form’s second parameter… The usage explained in dojo docs says:

Usage:
var foo = new dijit.form.Form(/* Object? */ params, /* **DomNode**|String */ srcNodeRef);

I feel I’m misunderstanding something here… Wut do you think?

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-09T04:52:33+00:00Added an answer on June 9, 2026 at 4:52 am

    It seems you are passing a dojo NodeList object as the second parameter to the Form constructor. The dojo.query method returns a NodeList, not a single dom element. The second (optional) parameter to a Widget constructor is a single dom node, not a Node List.

    The following works

    require(['dojo/dom','dijit/form/Form'],function(dom,Form){
        new Form({
            method: 'post',
            action: 'aaa/bbb'
        }, dom.byId('formId'));
    }); 
    

    It probably goes without saying that having multiple elements with the same ID on a page​ is a bad practice, but it you absolutely need to do that, you can do something like dojo.query('#testNode','idContext')[0] to get the first node with the id testNode rooted at the node with the id idContext.

    require(['dojo/query','dijit/form/Form'],function(query,Form){
        new Form({
            method: 'post',
            action: 'aaa/bbb'
        }, query('#formId','idContext')[0]);
    }); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know in an actual query, you can use auto_increment=1 but how is this
I have a query that I know can be done using a subselect, but
Does anyone know how I can reproduce this SQL Query as a SubSonic Query?
I know you can not set a key value dynamically, but what about the
This is something I know can be done somehow , because I've done it
You can know if the event stack is empty calling the gtk.events_pending() method, but
Suppose a tree structure is implemented in SQL like this: CREATE TABLE nodes (
I have a database that essentially looks like this: id uniqueidentifier NOT NULL data
Currently, this is how I perform a query using node-mysql client.query( sql, function( error,
I don't know if this is the place to ask about algorithms. But let's

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.