Guest User

Untitled

a guest
Oct 18th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. diff --git a/src/client/react/module/common/component/rjs-form-component.tsx b/src/client/react/module/common/component/rjs-form-component.tsx
  2. index 4719d92..a680d9d 100644
  3. --- a/src/client/react/module/common/component/rjs-form-component.tsx
  4. +++ b/src/client/react/module/common/component/rjs-form-component.tsx
  5. @@ -30,22 +30,23 @@ export default class RJSFormComponent extends React.Component<IRJSFormComponentP
  6. });
  7. }
  8.  
  9. - public render() {
  10. - const formData = toJS(this.props.data);
  11. - const fields = { layout: LayoutField };
  12. + public getFormProps() {
  13. + return {
  14. + schema: this.props.dataSchema,
  15. + uiSchema: this.props.uiSchema,
  16. + formData: toJS(this.props.data),
  17. + onChange: this.props.change.bind(this),
  18. + onSubmit: this.props.submit.bind(this),
  19. + showErrorList: false,
  20. + fields: { layout: LayoutField },
  21. + transformErrors: this.transformErrors,
  22. + };
  23. + }
  24.  
  25. + public render() {
  26. return (
  27. <div>
  28. - <Form
  29. - schema={this.props.dataSchema}
  30. - uiSchema={this.props.uiSchema}
  31. - formData={formData}
  32. - onChange={this.props.change.bind(this)}
  33. - onSubmit={this.props.submit.bind(this)}
  34. - showErrorList={false}
  35. - fields={fields}
  36. - // transformErrors={this.transformErrors}
  37. - >
  38. + <Form {...this.getFormProps()}>
  39. <div className="rjs-button">
  40. <Button color="success" type="submit">Save and Continue</Button>
  41. </div>
Add Comment
Please, Sign In to add comment