components

Quick way to create JSF custom component

喜欢而已 提交于 2019-12-22 09:25:00
问题 I know of two ways of creating custom JSF components: 1. Native JSF way: creating JSF component class, tag, etc. 2. Facelets way: defining component in a xhtml file and then creating appropriate decrption in facelets taglib. Currently I work on a project in which introducing facelets is unfortunately out of the question. On the other hand, creating custom components the standard JSF way seems like a pain in the ass. Is there maybe a third party library that allows creating custom components

Get the type of React components propTypes definition

99封情书 提交于 2019-12-22 08:57:47
问题 Suppose the following code: TestComponent.propTypes = { text: React.PropTypes.string, myEnum: React.PropTypes.oneOf(['News', 'Photos']) }; I did the following in another file (that was using TestComponent): if (TestComponent.propTypes.text === React.PropTypes.string) {...} if (TestComponent.propTypes.myEnum === React.PropTypes.oneOf) {...} Well, to my satisfaction the first if worked. But the second if never returned true. I tried to modify it to the syntax below, but it did not help. if

VueJs Calling method in Child components

坚强是说给别人听的谎言 提交于 2019-12-22 08:35:31
问题 I have a prop <graph :active-metrics="$data.active_metrics"></graph> In my child component I can access the value export default { template: '<div>{{activeMetrics}}</div>', props: ['active-metrics'], methods: { What I need to do is trigger a method in the child whenever there is a change. How can I achieve this? 回答1: You can use v-bind to make the data from the parent flow down to the child. In your case it would look something like this: <graph v-bind:active-metrics="$data.active_metrics"><

Flex - Custom Component - Percentage Width/Height

心不动则不痛 提交于 2019-12-22 08:26:13
问题 I am trying to create a Custom Flex Component using the Flex Component framework: http://www.adobe.com/livedocs/flex/3/html/help.html?content=ascomponents_advanced_3.html. All good components allow you to define their dimensions using percentage values using: MXML: TextInput width="100%" or Actionscript at runtime: textinp.percentWidth = 100; My question is how do you implement percentage width/height in the measure() method of your custom component? More specifically, these percentages are

Angular2, why functions are called each time I move the mouse

牧云@^-^@ 提交于 2019-12-22 05:53:09
问题 I use Angular2 seed (https://github.com/mgechev/angular2-seed), and I encounter a problem. Indeed, in my template html, I use some bindings like {{test}} with a variable test in the component, and {{getTest()}} which calls the getTest() function. If I use a console log in getTest(), each time I move the mouse, I get a log. Is it the desired behaviour ? I was thinking it will update only if the value changes, like with an observer. Did I have to use an observer to avoid this call each time ?

How to get a BufferedImage from a Component in java?

丶灬走出姿态 提交于 2019-12-22 05:31:25
问题 I know how to get a BufferedImage from JComponent, but how to get a BufferedImage from a Component in java ? The emphasis here is an object of the "Component" type rather than JComponent. I tried the following method, but it return an all black image, what's wrong with it ? public static BufferedImage Get_Component_Image(Component myComponent,Rectangle region) throws IOException { BufferedImage img = new BufferedImage(myComponent.getWidth(), myComponent.getHeight(), BufferedImage.TYPE_INT_RGB

Angular: Pass Component to a Component

≯℡__Kan透↙ 提交于 2019-12-22 05:07:34
问题 I have this small gridComponent: @Component({ selector: 'moving-grid', templateUrl: './grid.component.html', styleUrls: ['./grid.component.css'] }) export class GridComponent { @Input('widgets') extComponents: Array<Component>; } And a second testComponent @Component({ selector: 'test', template: ` <div #content>I say hello<li>i</li><li>u</li><button (click)="test()">click me</button> world</div> ` }) export class TestComponent { @ViewChild('content') content: HTMLElement; getContent() {

How to use a variable from a component in another in Angular2

梦想与她 提交于 2019-12-22 04:57:18
问题 I was wondering if it is possible to use variable values from one component into another one without having to use the template of the first one, just need the value of the variable nothing else. Is it possible? 回答1: Yes possible, you can use the @Input() method or use write get method like below export class Demo { const sum = 10; get SumValue() { return this.sum; } } import-->Demo export class Demo2 { private sum: number; this.sum = Demo.SumValue(); } 回答2: Go to your app.module.ts and make

ERROR in AppComponent cannot be used as an entry component

烂漫一生 提交于 2019-12-22 04:37:28
问题 Hey I'm new to using Angular and web development, I've been walking through a few tutorials. When trying to incorporate use of my Firebase Database, upon compilation locally (using ng serve) my application is failing. Returning: "AppComponent cannot be used as an entry component" If you could offer any help that'd be great. Thanks in advance :) //app.component.ts import { Component } from '@angular/core'; import {AuthService} from "./services/auth.service"; import {Router} from "@angular

Freeware ZIP component for Delphi 2010/Delphi XE?

十年热恋 提交于 2019-12-22 04:16:24
问题 Do you know any free component, compatible with Delphi 2010 or XE to manage ZIP archives (actually, only reading archive contents and extracting files required)? Please no betas. I thought about ZipForge from ComponentAce, but it's free only for personal use. No software distribution allowed. 回答1: You can get the TurboPower Abbrevia for 2010 from: http://tpabbrevia.sourceforge.net/ 回答2: you can take a look at this if you like 7zip 回答3: If you only need decoding (developed for Delphi 2007, not