How to Completely destroy a wijmo control

Posted by: dharric on 8 August 2018, 5:57 am EST

    • Post Options:
    • Link

    Posted 8 August 2018, 5:57 am EST

    I have a function that dynamically generates React jsx code depending on a value of a field. This function will generate one of two wijmo Comboboxes depending on the value of a field. However whenever one field has first been generated and then the value of the field is changed the new Combobox does not show, instead the old one keeps showing. This is happening despite the fact that a label is also dynamically changed and that label does update properly. Do I need to destroy the Combobox somehow each time?

    
    getParamView() {
            let paramView = null;
            if (this.state.selectedReport === "MarketingMaterial") {
                paramView = (
                    <div className="col-md-9">
                        <div className="pm-form-grouping">
                            <label className="dropdown-label label-inline pm-label">SMAFact Card:</label>
                            <span className="padding-interior padding-bottom pm-dropdown-container">
                                <ComboBox 
                                    id="mm"                    
                                    displayMemberPath="header"
                                    selectedValuePath="binding"
                                    itemsSource={this.marketingMaterialsEntities}
                                    selectedIndexChanged={this.marketingMaterialsEntityChanged}
                                />
                            </span>
                            <span className="padding-interior padding-bottom pm-form-grouping">
                                    <label className="dropdown-label label-inline pm-label">Period Date:</label>
                                    <InputDate 
                                        id="mmPeriodDate"
                                        min={this.state.minDate}
                                        max={this.state.maxDate} 
                                        valueChanged={this.marketingMaterialsPeriodDateChanged}
                                        value={this.state.marketingMaterial.periodDate}
                                        format="MMMM yyyy"
                                        selectionMode="Month" />
                            </span>
                            <span className="padding-interior padding-bottom pm-form-grouping">
                                <button className="btn btn-outline-secondary" type="button" onClick={this.viewReport}>View Report</button>
                            </span>
                        </div>
                        <div className="mm-report">
                            <iframe src={this.state.url} width="820px" height= "765px" frameBorder="0" scrolling="no" />
                        </div>
                    </div>
                );
                debugger;
            } else if (this.state.selectedReport === "DataPak") {
                paramView = (
                    <div className="col-md-9">
                        <div className="pm-form-grouping">
                            <label className="dropdown-label label-inline pm-label">Data Pak:</label>
                            <span className="padding-interior padding-bottom pm-dropdown-container">
                                <ComboBox 
                                    id="datapak"
                                    displayMemberPath="header"
                                    selectedValuePath="binding"
                                    itemsSource={this.dataPakEntities}
                                    isRequired={Boolean(true)}
                                    selectedIndexChanged={this.dataPakEntityChanged}
                                />
                            </span>
                            <span className="padding-interior padding-bottom pm-form-grouping">
                                    <label className="dropdown-label label-inline pm-label">Period Date:</label>
                                    <InputDate 
                                        min={this.state.minDate}
                                        max={this.state.maxDate} 
                                        valueChanged={this.dataPakPeriodId}
                                        value={this.state.dataPak.period_id}
                                        format="MMMM yyyy"
                                        selectionMode="Month" />
                            </span>
                            <span className="padding-interior padding-bottom pm-form-grouping">
                                <button className="btn btn-outline-secondary" type="button" onClick={this.viewReport}>View Report</button>
                            </span>
                        </div>
                        <div className="datapak-report">
                            <iframe src={this.state.url} width="1070px" height= "765px" frameBorder="0" scrolling="no" />
                        </div>
                    </div>
                );
                debugger;
            }
    
            return paramView;
        }
    
    
  • Posted 8 August 2018, 8:23 pm EST

    Hi,

    We are sorry but we are unable to replicate the issue at our end.

    Our implementation steps include creating a react sample in a similar manner as the code snippet provided.

    Here is the sample used in testing:-

    https://stackblitz.com/edit/react-ezh13q?file=index.js

    In the sample above each time we toggle flag, combo box with correct properties is rendered. Please have a look at the sample and let us know if we are missing something important to replicate the issue.

    P.S. We used the latest Wijmo release 5.20182.500 in Windows 10 environment. If the issue is for a specific environment then please let us know about your environment so that we may test the issue on the

    ~Manish

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels