Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    REACT Window.show() bug

    I took the liberty of slightly changing your example https://smartclient.com/smartclient-...indowsModality
    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="&lt;a href=&apos;http://www.google.com&apos; target=&apos;_blank&apos;&gt;Open Google&lt;/a&gt;" 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;
    And here's what I see on the screen.
    Click image for larger version

Name:	Zwischenablage-1.jpg
Views:	179
Size:	14.6 KB
ID:	271824

    #2
    This should be fixed as of the SC 13.1d nightly builds dated 2024-03-22.

    Comment

    Working...
    X