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
293
votes
15 answers

Make absolute positioned div expand parent div height

As you can see in the CSS below, I want child2 to position itself before child1. This is because the site I'm currently developing should also work on mobile devices, on which the child2 should be at the bottom, as it contains the navigation which I…
user557419
234
votes
31 answers

The specified child already has a parent. You must call removeView() on the child's parent first (Android)

I have to switch between two layouts frequently. The error is happening in the layout posted below. When my layout is called the first time, there doesn't occur any error and everything's fine. When I then call a different layout (a blank one) and…
blackst0ne
  • 3,134
  • 4
  • 16
  • 28
211
votes
8 answers

How to pass data from 2nd activity to 1st activity when pressed back? - android

I've 2 activities, Activity1 and Activity2. In Activity1 I've a Button and TextView. When the button is clicked Activity2 is started. In Activity2 I've an EditText. I want to display the data retrieved from EditText in Activity2 in the TextView in…
kumareloaded
  • 3,882
  • 14
  • 41
  • 58
193
votes
4 answers

node.js child process - difference between spawn & fork

This might seem like a basic question, but I could not find any documentation : What is the difference between forking & spawning a node.js process? I have read that forking is a special case of spawning, but what are the different use cases /…
Hitesh
  • 2,045
  • 2
  • 14
  • 9
148
votes
18 answers

Maven: Non-resolvable parent POM

I have my maven project setup as 1 shell projects and 4 children modules. When I try to build the shell. I get: [INFO] Scanning for projects... [ERROR] The build could not read 1 project -> [Help 1] [ERROR] [ERROR] The project module1:1.0_A0…
Will
  • 8,246
  • 16
  • 60
  • 92
125
votes
3 answers

How to append a childnode to a specific position

How can I append a childNode to a specific position in javascript? I want to add a childNode to the 3rd position in a div. There are other nodes behind it that need to move backwards (3 becomes 4 etc.)
Jarco
  • 1,635
  • 4
  • 14
  • 22
124
votes
7 answers

jQuery - selecting elements from inside a element

let's say I have a markup like this:
... ... ...
and I want to select #moo. why $('#foo').find('span') works, but $('span', $('#foo')); doesn't ?
Alex
  • 66,732
  • 177
  • 439
  • 641
113
votes
7 answers

How to set opacity in parent div and not affect in child div?

Hey i am searching in google but i can't fine any perfect answer I want to Opacity in parent DIV but not Child DIV Example HTML
Hello I am child…
Rohit Azad Malik
  • 31,410
  • 17
  • 69
  • 97
108
votes
5 answers

How to get only direct child elements by jQuery function

I have a table structure like this: ...
Jason Li
  • 1,194
  • 2
  • 11
  • 17
102
votes
4 answers

Angular EventEmitter Error: Expected 0 type arguments, but got 1

I am getting the type error, "Expected 0 type arguments, but got 1" despite following this tutorial to a T. https://youtu.be/I317BhehZKM?t=57s I have specified: newUserInfoComplete:boolean = false yet I am getting the error specified above on…
imnickvaughn
  • 2,774
  • 9
  • 25
  • 42
99
votes
13 answers

JavaScript DOM: Find Element Index In Container

I need to find an index of element inside its container by object reference. Strangely, I cannot find an easy way. No jQuery please - only DOM. UL LI LI LI - my index is 2 LI Yes, I could assign IDs to each element and loop through all nodes to…
Vad
  • 3,658
  • 8
  • 46
  • 81
97
votes
6 answers

Cross browser method to fit a child div to its parent's width

I'm looking for a solution to fit a child div into it's parent's width. Most solutions I've seen here are not cross-browser compatible (eg. display: table-cell; isn't supported in IE <=8).
mate64
  • 9,876
  • 17
  • 64
  • 96
87
votes
4 answers

How to find parent elements by python webdriver?

Is there any methods for python+selenium to find parent elements, brother elements, or child elements just like driver.find_element_parent? or driver.find_element_next? or driver.find_element_previous? eg: element based on selected
72
votes
4 answers

React.js -- How to pass properties object to child component?

I have a component called tileGroup that has a property that is a collection(array) of other properties. The parent component(tileGroup) renders a list of child components by using each set of properties in the collection to create a new…
Matt Foxx Duncan
  • 2,074
  • 3
  • 23
  • 38
1
2 3
99 100