All Answers

0 votes

I would also recommend trying this sample, which is more relevant and simpler!

It creates a handler in C# for the tab button’s double click event through the custom “MyTabControl” class.

Best,

Levie

0 votes

Hi Adrian,

It’s possible using JavaScript. Please see the initScript Property of the TabControl (of the attached project). This is a basic format you can use to achieve the double click functionality!

 

You can also play around with the selector to achieve a cleaner format if you want!

Let me know if this helps,

Best,

Levie

0 votes

Here is a third way to achieve the same. This one allows you to set the same culture multiple times since Equals() checks for the instance identity and it’s cleaner IMO since you can set your custom changes in one place.

 

Application.CurrentCulture = new MyCulture("ro-RO");

 

public class MyCulture : CultureInfo {
  public MyCulture(string name) : base(name, true) {
    this.NumberFormat.CurrencySymbol = "#";
  }
  public override bool Equals(object value) {
    return this == value;
  }
}
  • Luca answered May 19, 2020 - 3:44 pm
0 votes

WinForms and VWG don’t have Application.CurrentCulture. You can change the culture on the current thread without checks. Wisej checks if it’s the same culture using culture.Equals() which checks the name of the culture before altering the culture which triggers several updates in Wisej that are all missing from VWG and work differently on WinForms since the desktop is the same machine as the “server”.

I tried these two options and both work well:

 Program.Main() {
   var ro = new CultureInfo("ro-RO", true);
   ro.NumberFormat.CurrencySymbol = "#";
   Application.CurrentCulture = ro;
 }

 

 Program.Main() {
  var ro = (CultureInfo)CultureInfo.GetCultureInfo("ro-RO").Clone();
   ro.NumberFormat.CurrencySymbol = "#";
  Application.CurrentCulture = ro;
 }

If you set culture=”ro-RO” also in default.json you are setting the culture twice, the first time using the original “ro-RO” and then programmatically again but using the same culture (same name). Just set your modified culture the first time at startup.

 

  • Luca answered May 19, 2020 - 3:34 pm
  • last active May 19, 2020 - 3:35 pm
0 votes
In reply to: DataGridview summary

That’s the correct error. If the data grid is data bound then adding summary rows adds them to the data source, which is incorrect.

You can add rows programmatically or you can try the datagrid1.Fill() methods to load the data source without being data bound.

  • Luca answered May 19, 2020 - 3:17 pm
0 votes

Here’s a screenshot without using websockets, check the data in “Response” and the size in “Headers”.

0 votes

The Wisej Web Application template features one Form instance (Window1.cs).

The Wisej Web Page Application template features a Page instance (Page1.cs).

What you should use depends on your goal:

https://wisej.com/support/question/windows-or-pages

Best,

Levie

 

0 votes

Hi Glenn,

Are you using WebSockets?

You can view the size of the data that’s transmitted under app.wx in Network Source in Chrome (see the attached picture)

Let me know if you have any questions about it!

Best,

Levie

0 votes

Hi Luca,

After several testing and discussions with final client I’m still in trouble. I got your point, and I can change the culture with an existing one (in my case, ro-RO). The problem is that my client (and not only that client) want a mixture of settings (en-US as base with different date format, and some other differences). Every way I tried to create a new one by code failed.

In both winforms and Webgui the code I provided in my first post is working. In Wisej it’s not, and I didn’t find until now a workaround.

Please help!

0 votes

Hi Luca,

did the sample help?
Do you need additional information?

Thank you for looking into the problem.

1 vote

If you run code in a thread you must call Application.Update(). Browsers only receive a response if there is a request. WebSocket allows for a push update, which requires a push.

If Application.Update() works then it’s using WebSocket.

If you check Application.IsWebSocket in Program.Main it will always be false since the first request is always http.

HTH

 

 

  • Luca answered May 18, 2020 - 3:54 pm
0 votes

So here is my setup:

  • IIS installed on server 2019
  • One “Default Website” on that server.
  • One appliaction which was made with an earlier version of Wisej.
  • One application which was made with a newer version of Wisej (not sure how to check it).
  • The earlier website can run a simple clock (i.e), it updates every second.
  • The newer website seems to refresh only 5-20 seconds, here, also Application.IsWebsocket returns false.
  • The server has Web Socket installed on the IIS.
  • The code for both is quite simple:

Dim x As Integer = 2
Do
Invoke(Sub()
PanelContentContainer.Controls.Clear()
PanelContentContainer.Controls.Add(ShownPanelList(x))
End Sub)
ElaspedSeconds= 0
Do While ElaspedSeconds< ChangeSeconds
ElaspedSeconds+= 1
Invoke(Sub()
ProgressCircle1.Value = Math.Floor((ElaspedSeconds/ ChangeSeconds) * 100)
LabelTime.Text = Now.ToLongDateString & ” ” & Now.ToLongTimeString
End Sub)
Threading.Thread.Sleep(1000)
Loop
If x<> ShownPanelList.Count – 1 Then
x+= 1
Else
x= 0
End If
Loop

Edit 1#: This sub is inside a Thread.

Edit 2#: Adding Application.Update(Me) after setting the Invoke which sets the time seems to solve this issue, but still it’s not running in websocket mode.

  • László Fekete answered May 18, 2020 - 3:35 pm
  • last active May 18, 2020 - 3:48 pm
0 votes

Hi László,

I’m not sure I fully understand your setup. Can you please attach a small sample replicating the issue?

Best,

Levie

0 votes

Hi Huỳnh,

Wisej’s PdfViewer is not based on an iFrame. If you want to print it you should use another method. Print via PrintJS or something similar. PDF.js would work too.

Best,

Levie

0 votes

Hi Luca (ITG),

I am using crystalReport. It allows export to Memory stream pdf.

How to do showing Memory stream pdf into IFrame javaScript?

Thank you so much.

0 votes
In reply to: Theme

Hi Nello,

Would you be able to send us your theme with a small sample application that reproduces the spacing issue? It’s hard to tell the issue from here.

In regards to the icons not loading, I would suggest restarting your machine and checking that Internet Explorer is working correctly.

All the SVG’s you are supposed to see are rendered in mini IE browsers, so if they aren’t showing up there must be an issue with IE.

Let me know!

Best,

Levie

0 votes

Setting the style of the content element directly is overridden by the theme setting the properties and styles of the actual widget. In particular the margin property is translated to style positions since you cannot use margin in css with absolute positions by the underlying javascript layout engine.

Either you do it after the dom is rendered or it’s much simpler to change the theme.

You can:

  1. Create a custom theme based on an existing theme. This will limit you to the base theme.
  2. Create a mixin that alters only what you need to alter, this will allow you to pick any theme and keep your changes.
  3. Change the theme at runtime in code.

Solution 2 is the preferred one. New Item -> Mixin theme. see below and attached. Arrays are in the standard TRBL sequence.

 

{
 "name": "Application",

   "appearances": {
     "datefield": {
       "inherit": "datefield",
       "components": {
         "textfield": {
           "states": {
             "default": {
               "properties": {
                "margin": [ 0, 0, 0, 2 ]
              }
            }
          }
        }
      }
    }
  }
}

 

  • Luca answered May 15, 2020 - 4:29 pm
  • last active May 15, 2020 - 4:41 pm
0 votes

The issue is that the designer in Wisej fixes the error in the code but if you don’t save it you will get the error at runtime.

The code from VWG is wrong, and it may have worked because of a bug in VWG layout.

Anchoring anchors a control to the parent’s sides. Looking at the code you have coming from VWG, you can see that:

  • In BaseDataForm the continer (BaseDataForm) is 1051×526 (screenshot attached)
  • The dataGridView is 1042×353 anchored top,left,right,bottom.
  • In BaseDataForm the flowLayoutPanel1 is anchored left,right,bottom and it’s 895×28 at 4,371.
  • Both datagrid and flowLayoutPanel1 are relative to their parent splitContainer.Panel2 which is 1051×410.

This shows identical in the designer and at runtime. Anchoring the datagrid t,l,r,b means that the proportional distance on the 4 sides is maintained: when the container is resized, the distance of the datagrid’s 4 sides to the container is preserved.

Since the grid us 352 in height and the parent splitContainer.Panel2 is 410 in height, the bottom of the grid will always be 410-352 = 58 pixels from the bottom of the panel.

The wrong code is in InheritedDataForm:

  • InheritedDataForm in the code you attached is 1227×912 (line 183: this.Size = new System.Drawing.Size(1227, 912);)
  • The size of splitContainer.Panel2 is 1227×883
  • BUT the datagrid in InheritedDataForm has the wrong size (line 96: this.dataGridView.Size = new System.Drawing.Size(1073, 635);)
  • AND The flowLayoutPanel1 in InheritedDataForm has the original location (line 100: this.flowLayoutPanel1.Location = new System.Drawing.Point(196, 700);)

Looks like the designer code in InheritedDataForm was changed by hand or VWG generated the wrong dimensions.

Which means that in InheritedDataForm the size of the grid and the bottom of the grid are much smaller than the parent and the bottom grid will be 883-635=248 pixels from the bottom of the container.

The layout depends on the state of the layout engine and the corresponding calls to SuspendLayout() and ResumeLayout() and the designer is applying them in the design order to fix the layout, but you need to save it or the wrong code will run at runtime.

The only issue I see is that the designer didn’t mark the file as modified when it should. See screenshot 2, the designer changed the grid to be 1249 x 1021 to make it work but if it’s not saved the original proportions will be used at runtime.

 

 

  • Luca answered May 15, 2020 - 3:57 pm
  • last active May 15, 2020 - 3:58 pm
0 votes

Documents in browsers are loaded asynchronously. If you print after assigning the src the iframe is empty. You can use jsfiddle to test your javascript code. See https://www.w3schools.com/jsref/event_onload.asp

In your code you can try to change it like this:

var objFra = document.createElement('iframe'); // Create an IFrame.
objFra.style.visibility = "hidden"; // Hide the frame.
objFra.src = "ReadMe_001.pdf"; // Set source not done .pdf.
objFra.onload = function(){
   objFra.contentWindow.focus(); // Set focus.
   objFra.contentWindow.print(); // Print it  
};
document.body.appendChild(objFra); // Add the frame to the web page.

 

  • Luca answered May 15, 2020 - 3:16 pm
0 votes
In reply to: Spitter line color

Hi Nello,

If you downloaded Wisej from Wisej.com/builds it comes with the installation package. Try searching for Wisej.ThemeBuilder or Wisej in the search bar and make sure you filter by Applications. If you can’t find it, I’d recommend reinstalling Wisej.

 

Once you have a theme file you can add it to your project with the following:

  1. Right-click the “Themes” folder in your project
  2. Add -> Existing Item
  3. Navigate to your .theme file and select it.
  4. In the bottom left of the designer change “Blue-1” to your new theme.
  5. Open web.config and change the Wisej.DefaultTheme value to the name of your theme.

You can also load / change your theme at runtime with:

Application.LoadTheme("myThemeName");

You should be good to go then!

Let me know if you have issues.

Best regards,

Levie

Showing 4861 - 4880 of 11k results