parent-child

Iterate through all form fields within a specified DIV tag.

I need to be able to iterate through all the form fields within a specified DIV tag. Basically, any given DIV tag can have multiple form fields (which is easy enough to parse through), but it can also any number of tables or even additional DIV tags (adding additional levels of hierarchical layering). I've written a basic function that...

Testing for undefined and null child objects in ActionsScript/Flex

Hi Everyone, I use this pattern to test for undefined and null values in ActionScript/Flex : if(obj) { execute() } Unfortunately, a ReferenceError is always thrown when I use the pattern to test for child objects : if(obj.child) { execute() } ReferenceError: Error #1069: Property child not found on obj and there is no defau...

Communication between parent and child

Hi every one ! I have a little problem. I have to code a simple C application that creat a process and his child (fork()) and I have to do an operation. Parent initialize the values and child calculate. I write this : #include <stdlib.h> #include <signal.h> #include <fcntl.h> #include <stdio.h> #include <unistd.h> typedef struct { ...

Windows Forms: Unable to Click to Focus a MaskedTextBox in a Non TopLevel Form

Like the title says, I've got a Child form being shown with it's TopLevel property set to False and I am unable to click a MaskedTextBox control that it contains (in order to bring focus to it). I can bring focus to it by using TAB on the keyboard though. The child form contains other regular TextBox controls and these I can click to f...

WPF parent-child window: binding reference problem

I have a WPF Window that open a modal child window to load some data. Both window have a own viewmodel, now I have this problem: after I close the child window it seems still running in background! To close the child window I set DialogResult from viewmodel command; now, if I create a new data and then I edit it from parent window (with...

Help with manipulating child/parent elements with jQuery

Currently I have this JQuery script var img = $(this); img.wrap('<div class="photo"></div>'); img.parent().append("<p>" + img.attr("alt") + "</p>"); which successfully turns the following: <img src="photo.jpg" alt="caption"> into this <div class="photo"> <img src="photos.jpg" alt="caption"/> <p>caption</p> </div...

Question regarding parent/child relationships with dynamically generated checkboxes using jquery

I have a form of checkboxes, that is dynamically generated based on the users content. Sections of checkboxes are broken up by categories, and each category has projects within. For database purposes, the category values have checkboxes, that are hidden. IF a category has sub items that have checkboxes that are checked, THEN the categor...

How to determine which thread is created from another?

Is there any way in .NET for a thread to determine its 'parent', i.e. the thread that created it? I'm diagnosing a timing issue with a black box third party API and would like to find out what custom code of mine it is executing on which thread. ...

nHibernate storage of an object with self referencing many children and many parents

I have an object called MyItem that references children in the same item. How do I set up an nhibernate mapping file to store this item. public class MyItem { public virtual string Id {get;set;} public virtual string Name {get;set;} public virtual string Version {get;set;} public virtual IList<MyItem> Children {g...

add width li's to parent ul

i would like to calculate the width of the li's for each submenu en then put in the ul element. example <ul> <li>level 1</li> <li> <ul style="widht:??;"> // total width li's added here 70px <li>level 2</li> // width of this li 20px <li>level 2</li>/ width of this li 50px </ul> </li> <li>level 1</li> <li>level 1 <ul styl...

Multilevel nested product categories display with asp.net and sql server?

I have a product category table with the following fields: cat_id (PK) Cat_name Cat_desc Parent_Cat_Id Now when a user wants to add a product he should be able to select multiple categories from a listbox(multiselection enabaled). But to let the user know the hierarchy of the categories, I need to display them in the following style...

nhibernate - problem with merging collections

I have parent/child relationship, and child have composite id Parent <id name="Id" type="Int32"> <generator class="identity" /> </id> <set name="Children" table="CTable" cascade="all-delete-orphan" inverse="true" lazy="false" > <key column="ParentId"/> <one-to-many class="ChildrenClass"/> </set> Child <composite...

PHP: "Call to undefined method" error when calling static method from parent

How is the correct way to call a child class method from a parent class if both are static? When I use static classes it returns the error "Call to undefined method A::multi()", however when I use non-static methods there is no problem, for example: //-------------- STATIC ------------------ class A { public static function calc($a...

Search products with parent and child categories

Hello I'm building a shopping cart website and using SQL tables CATEGORY Id int, Parent_Id, Description varchar(100) Data: 1 0 Electronics 2 0 Furniture 3 1 TVs 4 3 LCD 5 4 40 inches 6 4 42 inches PRODUCTS Id int, Category_Id int Description... Data: 1 5 New Samsung 40in LCD TV 2 6 Sony 42in L...

Parent/Child(ren) Hierarchy / "Nested Sets", in Python/Django

I'm using Django/Python, but pseudo-code is definitely acceptable here. Working with some models that already exist, I have Employees that each have a Supervisor, which is essentially a Foreign Key type relationship to another Employee. Where the Employee/Supervisor hierarchy is something like this: Any given Employee has ONE Super...

How to get parent node of element using tinyxml

Is there a way to get a parent node from a TiXmlElement? For example... TiXmlElement *parent = child->ParentElement( "someName" ); If you can't do this in tinyxml, are there any other xml parsers that allow this? ...

MVC add child to parent

Hi, assuming I have a Child and Parent object each of which has a repository and a controller. Update: A Parent has many Child objects. the parent's controller for creating would look something like. the post to create will be made using the auto-generated form. public ActionResult Create() { return View(); } ...

Jquery - Immediate children

Hello, I have a structure like this: <ul id="mycustomid"> <li><a>Item A</a> <ul class="children"> <li><a>Child1 of A</a> <ul class="children"> <li><a>Grandchild of A</a> <ul class="children"> <li><a>Grand Grand child of A</a></li> ...

Rails: UI to add children from large record set to parent model in HABTM relationship

Given the parent / child HABTM relationship: class List < ActiveRecord::Base has_and_belongs_to_many :items end class Item < ActiveRecord::Base has_and_belongs_to_many :lists end I need to set up a UI to add Items (children) to a List (parent) from the List create / edit form. The wrinkle is that there are far too many Items reco...

SharePoint tasks fields dependencies

Hi all, I have a list of tasks and one of its fields is reference to another task in the list, and another field is boolean value. the boolean value of the tasks is false. I want the booleans to be dependent on the related task's boolean value. One can't be true unless the other one is changed to true. Sort of Parent-Child Relationshi...