react-jsf
Version:
JSF Compliant React Components
28 lines (24 loc) • 698 B
JavaScript
import React from 'react';
import PropTypes from 'prop-types';
import JsfElement from '../superclass/JsfElement';
export default class HGraphicImage extends JsfElement {
static propTypes = {
id: PropTypes.string,
library: PropTypes.string,
name: PropTypes.string,
onclick: PropTypes.func,
};
render() {
return (
<img id={this.state.id}
src={`/javax.faces.resource/${this.props.name}.jsf?ln=${this.props.library}&v=3_3_0_130416`}
onClick={this.props.onclick || (() => {
})}/>
);
}
}
HGraphicImage.contextTypes = {
getFormId: PropTypes.func,
registerAtAll: PropTypes.func,
registerAtForm: PropTypes.func,
};