Hello dear developers
, I decided to try using the smartclient in react and immediately ran into one problem...
Version SNAPSHOT_v13.1d_2024-01-23
In a very simple example, the code of which I give below, the ButtonItem is not displayed on the screen, although its object is created in HTML
in HTML, I found a button object with rather strange properties
, I decided to try using the smartclient in react and immediately ran into one problem...
Version SNAPSHOT_v13.1d_2024-01-23
In a very simple example, the code of which I give below, the ButtonItem is not displayed on the screen, although its object is created in HTML
Code:
import React, { Component } from 'react'; import CONSTANT from "shared-lib/src/CONSTANT"; import EvolutionServer from "shared-lib/src/server/EvolutionServer"; //import EvolutionDataLoader from "shared-lib/src/server/EvolutionDataLoader"; import LoadingPanel from "shared-lib/src/components/LoadingPanel"; import MessagesPanel from "shared-lib/src/components/MessagesPanel"; import 'smartclient-lgpl/release'; import { ButtonItem, DynamicForm, TextItem} from 'smartclient-lgpl/react'; class App extends Component { static initData = [ CONSTANT.APPLICATION, CONSTANT.ACTIONS, CONSTANT.STRINGS, CONSTANT.RIGHTS, CONSTANT.USER ]; constructor(param) { super(param); this.state = { inited: false, loading: true, selectedFile: null } EvolutionServer.init(); EvolutionServer.initApplication(App.initData, this.onApplicationLoaded.bind(this)); } onApplicationLoaded(error) { if (!error) { this.setState({ inited: true, loading: false }); } } onButtonItemClick = function(form, item) { return window.isc.say('Hello ' + form.getValue('you') + '!') }; render() { if (this.state.inited) { return ( <> <DynamicForm numCols="3" autoFocus="true"> <items> <TextItem defaultValue="my friend" name="you" title="Enter your name" wrapTitle="false" selectOnFocus="true"/> <ButtonItem icon={CONSTANT.BUTTONS_ICONS + "info1.png"} title="Hello" width="80" startRow="false" click={this.onButtonItemClick}/> </items> </DynamicForm> <LoadingPanel show={this.state.loading} /> <MessagesPanel show={false}/> </> ) } else { return ( <LoadingPanel show={this.state.loading} /> ); } } } export default App;
Comment