I took the liberty of slightly changing your example https://smartclient.com/smartclient-...indowsModality
by rewriting it for classes.
Here is my code.
And here's what I see on the screen.
by rewriting it for classes.
Here is my code.
Code:
import React, { Component } from 'react'; import 'smartclient-lgpl/release'; import { VLayout, HStack, IButton, Label, Window, DynamicForm, SelectItem, DateItem, ButtonItem } from 'smartclient-lgpl/react'; class App extends Component { constructor(param) { super(param); } onButtonClick = function () { window.touchButton.setTitle('Can\'t Touch This'); window.modalWindow.show(); }; onModalWindowCloseClick = function () { window.touchButton.setTitle('Touch This'); this.Super('closeClick', arguments); }; onButtonItemClick = function (form, item) { window.modalWindow.hide(); window.touchButton.setTitle('Touch This') }; render() { return ( <> <VLayout defaultLayoutAlign="center" width="100%" height="50%"> <members> <HStack membersMargin="10" ID="hStack" height="50" autoDraw="false"> <members> <IButton title="Touch This" ID="touchButton" width="120" /> <Label contents="<a href='http://www.google.com' target='_blank'>Open Google</a>" height="20" /> </members> </HStack> <IButton title="Show Window" ID="button" autoDraw="false" click={this.onButtonClick} /> </members> </VLayout> <Window autoCenter="true" isModal="true" autoSize="true" title="Modal Window" showModalMask="true" ID="modalWindow" autoDraw="false" closeClick={this.onModalWindowCloseClick}> <items> <DynamicForm height="48" padding="4" autoDraw="false"> <items> <SelectItem name="field1"> <valueMap> <value>foo</value> <value>bar</value> </valueMap> </SelectItem> <DateItem name="field2" /> <ButtonItem title="Done" click={this.onButtonItemClick} /> </items> </DynamicForm> </items> </Window> </> ); } } export default App;
Comment