A component in the Unified Modeling Language "represents a modular part of a system, that encapsulates its content and whose manifestation is replaceable within its environment. A component defines its behavior in terms of provided and required interfaces". The best example of component can be found in ActionScript- Flash,Flex sdks. There you have UI components like buttons, labels, DataGrids, charts those are reusable, distributable etc.
Questions tagged [components]
11658 questions
54
votes
1 answer
How to pass custom component parameters in java and xml
When creating a custom component in android it is often asked how to create and pass through the attrs property to the constructor.
It is often suggested that when creating a component in java that you simply use the default constructor, i.e.
new…

Emile
- 11,451
- 5
- 50
- 63
50
votes
3 answers
How to pass data between sibling components without using $scope?
I am making a component that contains 3 child components in this way:
The main component contains list of heroes.
The header component contains two buttons that are suppose to switch the view…

Beslinda N.
- 4,808
- 5
- 27
- 33
49
votes
4 answers
Deactivate input in react with a button click
I have this basic component and I want the textfield to be deactivated or activated whenever I click on a button. How can I achieve this?
This is my sample code:
import React from "react";
import Button from 'react-button'
const Typing = (props) =>…

Second Son
- 1,481
- 1
- 15
- 26
49
votes
1 answer
Angular Component: no template replace option?
It looks like there is no "replace" option in new AngularJS 1.5 Component concept (like it was for directives).
What would you suggest if I want to have table row element as component? Is it not possible in terms of valid HTML?
Real example:…

Stepan Suvorov
- 25,118
- 26
- 108
- 176
49
votes
4 answers
Java Component based vs Request based frameworks
I was recently asked in an interview - In java, how do you compare component based frameworks to request based frameworks? I explained EJB as an example of Component based framework and Struts as a request based framework but was not convinced if I…

user150014
- 743
- 2
- 8
- 9
47
votes
6 answers
How to set a component non-reactive data in Vue 2?
I have a categories array, which is loaded once (in created hook) and then it is static all the time. I render these array values in a component template.
- {{ item }} …

Dave
- 473
- 1
- 4
- 6
47
votes
4 answers
React - Can A Child Component Send Value Back To Parent Form
The InputField & Button are custom components that go into a form to create a form. My issue is how do I send the data back up to form so that on button click, I can fire ajax on the form with data (username & password):
export default…

Kayote
- 14,579
- 25
- 85
- 144
47
votes
6 answers
ReactJs Global Helper Functions
Issue:
I have a lot of small helper functions that don't necessarily need to live in a component(or maybe they can but they will make that component bloated with a lot of code).My lazy side just wants to just let those all just be some sort of…

Nick Pineda
- 6,354
- 11
- 46
- 66
43
votes
4 answers
React.js - default prop is not used with `null` is passed
I have default props in my React component:
PropertyTitleLabel.defaultProps = {
bedrooms: 1,
propertyType: 'flat'
};
PropertyTitleLabel.propTypes = {
bedrooms: PropTypes.number,
propertyType: PropTypes.string
};
But when I'm passing…

Kosmetika
- 20,774
- 37
- 108
- 172
43
votes
1 answer
How to create a dialog like component that allows drop other controls inside it?
It is a Firemonkey component, however I could see that most of the component base is the same for VCL and FMX, so please if you know how to do that in VCL share your knowledge, it can be eventually the solution for my case.
I am using a TPopup as…

Eduardo Elias
- 1,742
- 1
- 22
- 49
42
votes
1 answer
Why is CommonJS only said to be suitable for non-browser apps?
Why not use it as a general component pattern for Javascript, including browser-executed Javascript?
At a glance, it seems to be a good way to modularize the project I'm currently working on, which consists of a large Javascript code-base, with lots…

Jonathan
- 32,202
- 38
- 137
- 208
42
votes
3 answers
Show Dialog from ViewModel in Android MVVM Architecture
About MVVM with new architecture components, I've a question, how should I implement if my app needs to display for example a Dialog with 3 options from some action that happened in my VM? Who is responsible for sending to Activity/Fragment the…

lucasb.aquino
- 657
- 1
- 6
- 10
42
votes
7 answers
What is better in vue.js 2, use v-if or v-show?
I'm working in a project with vue 2. I need to know in which case the performance is better: Use v-if or v-show?.
I have a long list and each item's list has a form hidden that I need show and hide to click a button that has each item list.
What is…

Jedidias
- 693
- 1
- 6
- 11
41
votes
5 answers
Angular - Observable with async pipe used multiple times in template... Good Practice or Bad?
If I have the need to bind multiple properties from the same observable within my component template...
For example:
...
...am I…

Mark
- 486
- 1
- 4
- 10
41
votes
9 answers
React - Dynamically Import Components
I have a page which renders different components based on user input. At the moment, I have hard coded the imports for each component as shown below:
import React, { Component } from 'react'
import Component1 from './Component1'
import…

LEJ
- 1,868
- 4
- 16
- 24