Page 1 of 1

Angular Designer - language selection not working

Posted: Thu Feb 06, 2025 12:51 pm
by Antonin H.
Hello,

I am using the Stimulsoft Designer component for Angular and I ran into a problem with language selection.

I provide a directory with languages with the following code:

Code: Select all

public static void SetLocalizationDirectory(this StiAngularDesignerOptions options, string subdirectory)
{
            var localizationDirectory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, subdirectory);
            options.LocalizationDirectory = localizationDirectory;
}
The code is run (and the designer options are therefore correctly updated in the backend controller constructor, so definitely before getting a new designer result from the backend .NET server. Upon opening the designer I then see the selection options:

Image

However when I try to select any of the language options, the language does not switch and I get the following client-side error:

Code: Select all

ERROR TypeError: Cannot read properties of undefined (reading 'action')
    at StiMobileDesigner.GetMvcActionUrl (<anonymous>:28549:84)
    at StiMobileDesigner.PostForm (<anonymous>:28604:42)
    at locControl.action (<anonymous>:129125:30)
    at locMenu.action (<anonymous>:129100:28)
    at menuItem.action (<anonymous>:115470:14)
    at menuItem.onclick [as __zone_symbol__ON_PROPERTYclick] (<anonymous>:115437:14)
When making the selection, no call to the server seems to happen, no data is transferred, the whole interaction gets cut off by this bug.

The XML localization files all are present on the server and they match with the selection of languages seen in the screenshot above. The documentation for Angular does not contain anything about the language selection UI element.
Am I missing something or is this a known Stimulsoft Angular issue?

Thanks in advance for any information about this topic.

Re: Angular Designer - language selection not working

Posted: Fri Feb 07, 2025 2:24 pm
by Vadim
Hello

Will be fixed from next version.
Note that it will not change Designer language automatically - you need to reload Designer to apply changes

Re: Angular Designer - language selection not working

Posted: Fri Feb 07, 2025 4:39 pm
by Antonin H.
Hello,

Thank You for the quick response. I will wait for the next version then.

If the selection will require reloading a designer, will I be able to react to some sort of language change action or something like that in a way that will allow me to return a new designer result after the change is made without losing unsaved changes on the report?

Re: Angular Designer - language selection not working

Posted: Mon Feb 10, 2025 7:54 am
by Vadim
Hello

You should control unsaved changes yourself.
Here is sample code to catch SetLocalization menu action:

Code: Select all

<stimulsoft-designer-angular #designer (designerLoaded)="designerLoaded()">
...
@ViewChild('designer') designer: StimulsoftDesignerComponent;
...
designerLoaded() {
    let jsObject = this.designer.designerEl.nativeElement.firstChild.jsObject;

    jsObject.localizationControl.action = () => {
      alert(jsObject.localizationControl.locName);
    }   
  }