Questions tagged [parent-child]

A relationship between entities in which one acts in a major role and the other in a minor role. Also an inheritance relationship paradigm.

In software, a parent-child relationship may involve ownership and/or containership semantics.

Ownership usually makes allocation, initialization, and destruction of child nodes the responsibility of the parent node.

Containership in a visual system often makes rendering, coordinate systems, clipping, and z-order of the child nodes the responsibility of the parent node.

For Object Oriented inheritance the parent is the base class and the child is the derived class.

A C++ example of a parent class: A and a child class: B:

class A{};

class B : public A{};
5263 questions
36
votes
5 answers

Get children with tagname as

I have a HTML as:
...... ....
hello
hello
I m a grand child
hello
I want to get all the children…
Hardik Dave
  • 676
  • 1
  • 6
  • 17
36
votes
3 answers

Example of waitpid() in use?

I know that waitpid() is used to wait for a process to finish, but how would one use it exactly? Here what I want to do is, create two children and wait for the first child to finish, then kill the second child before exiting. //Create two…
user3063864
  • 661
  • 2
  • 7
  • 18
36
votes
4 answers

Close Bootstrap modal from inside iframe

Page which opens Twitter Bootstrap Modal with iframe inside:
32
votes
1 answer

React, get bound parent dom element name within component

Within my component, how can I access the name of the parent component it is nested inside? So if my render is thus: ReactDOM.render( , document.getElementById('radials-1') ); How can I retrieve the id…
Union find
  • 7,759
  • 13
  • 60
  • 111
31
votes
2 answers

Self referencing / parent-child relationship in Entity Framework

I read quite a number of posts of programmers that run into the Unable to determine a valid ordering for dependent operations. Dependencies may exist due to foreign key constraints, model requirements, or store-generated values -exception when using…
30
votes
3 answers

How to set default child view with Angular UI Router

Let's say I have the following 3 Angular UI Router states: $stateProvider .state('adminCompanies', { abstract: true, url: "/admin/companies", template: '
' }) …
egervari
  • 22,372
  • 32
  • 121
  • 175
27
votes
5 answers

PHP hierarchical array - Parents and childs

I use PHP and mySQL with Idiorm. That might not be relevant. My PHP array It's a relationship between parents and childs. 0 is the root parent. Example: Root parent 0 have the child 33 which have the child 27 which have the child 71. This array…
Jens Törnell
  • 23,180
  • 45
  • 124
  • 206
26
votes
4 answers

How to CenterParent a non-modal form

I have a non-modal child form which opens up from a parent form. I need to center the child form to its parent form. I have set property of child form to CenterParent and tried this: Form2 f = new Form2(); f.Show(this); but to no avail. This works…
nawfal
  • 70,104
  • 56
  • 326
  • 368
25
votes
4 answers

How to retrieve parent node using XQuery?

I am using XML and XQuerie. I usually use an XPath expression relative to a parent node to retrieve its child node. But, I am not sure how to do the opposite meaning if I have a child node, how do I retrieve its parent node.
sony
  • 1,557
  • 10
  • 36
  • 50
25
votes
3 answers

How to set multiple parent activities for using android back button

I have an application that calls an activity several times from different activitys. So, im trying to implement the "back button" in the action bar for this activity. For doing this im using: switch (item.getItemId()) { case android.R.id.home: …
25
votes
2 answers

Is it legal to have children of an anchor tag () in HTML?

Is it legal to have children of an anchor tag in HTML? For an example: Example It works fine in the browsers.But is it valid? Please help
Parveez Ahmed
  • 1,325
  • 4
  • 17
  • 28
24
votes
3 answers

Passing props to React Router children routes

I'm having trouble overcoming an issue with react router. The scenario is that i need to pass children routes a set of props from a state parent component and route. what i would like to do is pass childRouteA its propsA, and pass childRouteB its…
PhilVarg
  • 4,762
  • 2
  • 19
  • 37
24
votes
3 answers

Get to get all child scopes in Angularjs given the parent scope

I would like to know how to get a list of all child scopes given a parent scope. All I can find from the properties of the scope are $$childHead, $$childTail, $$nextSibling and $$prevSibling. The approach I'm using now is to get the childHead from…
ritcoder
  • 3,274
  • 10
  • 42
  • 62
23
votes
3 answers

Unity add child to children, but at top

I am trying to add a child object to a collection of children, but I want to make sure the the latest will be the first. Here is what I am trying to do: GameObject - (My new object here) - GameObject - GameObject - GameObject Here is the code I am…
Mansa
  • 2,277
  • 10
  • 37
  • 67