All Answers

0 votes

It appears to be a bug somewhere. You can fix the code I sent by adding

current.X = 0;

before

current.Y += delta;

in MoveSelection().

  • Luca answered Dec 7, 2020 - 8:31 pm
0 votes

It worked

Thank you!

0 votes

Hi Luiz,

you can query your MDI child windows with the MDIChildren collection.
Simply call Activate() on the window you want to be shown.

Best regards
Frank

0 votes

Dear Luca,

FYI, I replaced my approach with yours, as it is simpler (I don’t have to register events also for the datagridview but only for the UserComboBox) and it also taught me a lot!
I create the datagridview outside the inherited UserComboBox and pass it to it. So it is now a standalone component in my “library” that can be reused in other projects. The only thing that wasn’t working, was that when pressing the keys Up and Down, as soon as the position was outside the dropdown height, there was no scrolling going on, so the selected row was not visible. I banged my head on the screen for a few hours comparing your code to mine, and what I finally found was that this behaviour is due to my  RowHeadersVisible = false. With this setting, automatic scrolling does not work. You can reproduce it if you change your grid definition in your eaxample project as follows:
var dataGrid = new DataGridView() {
Focusable = false,
RowHeadersVisible = false
};

I don’t know if this is the intented behaviour or I found a minor bug.
Thanks again,
Alex

0 votes

It’s actually a lot easier than I thought with Wisej. I will attach a simple PrintPreviewDialog and PrintPreviewControl next week.

The usage is as simple as in winforms without code changes:

 PrintDocument pd = new PrintDocument();
 pd.PrintPage += OnPrintPage;
 pd.DocumentName = "Test";
 this.printDocumentViewer1.Document = pd;

 private void OnPrintPage(object sender, PrintPageEventArgs e)
 {
   e.Graphics.DrawString("TEST", this.Font, SystemBrushes.ControlText, 10, 10);
   e.HasMorePages = false;
 }

 

  • Luca answered Dec 5, 2020 - 11:58 pm
0 votes

You can use System.Drawing.Printing.PrintDocument but it will create the document on the server. Then you can download it to the browser and print using Application.DownloadAndOpen(). You just need to create a supported format, which is most likely a pdf.

Virtual UI is not a web system, it’s a remote desktop system rendered through the browser. Wisej creates web applications managed by the browser, so the printing is entirely up to the browser. To preview a document, create a pdf and preview it using the PdfViewer or an iframe or any third party javascript preview widget.

  • Luca answered Dec 5, 2020 - 10:43 pm
0 votes

Thanks, Luca!
Have a nice evening.

A

0 votes

See my sample, has row navigation too.

Accessing the database on every keystroke can be heavy. You can add a timer, say 500ms, wait for the user to stop typing and then filter. You can use either a Wisej.Web.Timer (client timer, causes the browser to fire an event) or a System.Threading.Timer (server side timer).

For the server side timer, see modified sample attached, processes FilterRows() only after 500ms that the user stopped typing:

// Wisej provides a System.Threading.Timer already bound to the context like this:
this.timer = Application.StartTimer(Timeout.Infinite, Timeout.Infinite, this.FilterRows);

// Then on every keystroke, restart the timer.
this.timer.Change(1000, Timeout.Infinite);

 

  • Luca answered Dec 5, 2020 - 9:00 pm
  • last active Dec 5, 2020 - 9:01 pm
0 votes

Thank you, Luca.
I think I did it. Setting the Focusable = false does indeed leave the focus to the textbox, but then you cannot use the arrows on the grid and press enter to select the current row.  What I did, was to handle the KeyPress event on the grid and transfer what is typed to the textbox. Using the KeyPress instead of KeyUp/Down was necessary, or I couldn’t get the typed character. The KeyPressEventArgs give access to the character, which was the easiest way to get hold of the greek character pressed, the KeyUp/down give the key code of the actual key pressed (the latin character). I works very nicely (till I find a new problem!).

I havn’t tried the AutoCompletMode, I’ll have a look.

Not hiding the rows but accessing the database on every key stroke wouldn’t be heavy?

I’ll check your sample. Thanks again.

Alex

0 votes

With the UserComboBox you can handle anything. What you see is the expected behavior because the drop down control is focusable so Wisej automatically sets the focus on the drop down, which is the expected default functionality: when the drop down is shown the focus and keyboard goes there.

You can disable it simply by setting Focusable = false to your control in the drop down.

You can also enable the automatic drop down when the user types by setting AutoCompleteMode = Suggest.

Then you can handle the keyboard navigation either on the client side or the server side in the KeyDown or KeyUp events. See attached sample and video. It should be a good starting point. If you use a data source you don’t have have to hide the rows, simply you the DataView filter with SQL syntax.

https://drive.google.com/file/d/1jKYhBPtYwhDWKZMGrPCmD4EphDvsa6K6/view

 

  • Luca answered Dec 5, 2020 - 7:47 pm
0 votes

IndexDB or any browser feature can be accessed from JavaScript. Wisej only runs on the server. You can add your disconnected JavaScript client-side only code in the /Offline directory.

  • Luca answered Dec 5, 2020 - 5:41 pm
0 votes
In reply to: MessageBox Width

Hi Luca.

I think I found the issue with the patch not being called in my Solution. It looks like if the Assembly Name has spaces in it, it just won’t load the patch, which is my case. I have changed your sample’s Assembly Name from “Wisej.MessageBoxPatch” to “Wisej MessageBoxPatch” and it results in the same issue. I attached it here.

Now, I don’t know if this is an issue or a feature. Is it a bad practicing with Wisej to have spaces in the DLL names?

0 votes

Levie (ITG)

Thank you.

 

0 votes
In reply to: MessageBox Width

No, the maxWidth and maxHeight are absolute properties. I checked the js code and the wisej.web.MessageBox class (https://github.com/iceteagroup/wisej-js/blob/master/wisej.web.MessageBox.js) limits itself to the window.innerWidth which unfortunately means that it may exceed the Desktop child control. See the _onAppear(e) method.

You can override it with a js patch, see attached zip. Gives you 2 options: 1- maximize the messagebox (which could be a good idea on mobiles), 2-limit the size to the parent.

  • Luca answered Dec 4, 2020 - 5:37 pm
0 votes

Hi,

i attach the simple Wisej example. Please take a look at it.

Page

0 votes
In reply to: Modal Mask on controls

That is true!
It worked like a charm.

Thank you.

0 votes
In reply to: Modal Mask on controls

If you use the last option it is automatically persisted also across a refresh:

  1. In the InitScript property of the NavigationBar put “this.getBlocker().setBackgroundImage(null);”
  2. Now you can use the property this.NavigationBar.ShowLoader = true/false.
  • Luca answered Dec 4, 2020 - 5:16 pm
0 votes

Hi Takao,

Using Chrome’s Lighthouse tool we can evaluate what’s causing the issue. In this case, under the Progressive Web App Installable section, you see “Does not register a service worker that controls page and start_url” (see the attached image). It then goes on to explain why in the description.

 

If we navigate to the manifest.json file, we can see the default start_url is “/Default.html”. In this case, the base part of the URL it’s looking for is “localhost”, but when you use Local IIS, the path is changed to a virtual directory at the specified project name (by default it’s /WisejPWAWebApplication1).

So, if we want to test it with Local IIS we can change the start_url to “/WisejPWAWebApplication1/Default.html” or you can use a wildcard (*), such as “*/Default.html” if you like.

I’ll try to log an enhancement to update the default start_url so it encompasses development in both IIS Express and Local IIS.

If you have any questions or this isn’t clear, please let me know!

Best regards,

Levie

  • Levie (ITG) answered Dec 4, 2020 - 4:28 pm
  • last active Dec 4, 2020 - 4:30 pm
0 votes
In reply to: MessageBox Width

Thank you Luca for the help, this gives me a starting point.

But I guess I should deal with the size right before I show the message, since the Desktop control could be any size at this moment and then I should take the Desktop width into consideration to be able to calculate the MessageBox width and make sure it would be a bit narrower than its Desktop parent. Can this be accomplished just having a different mixin?

0 votes

Please attach your Wisej sample. In general. ASP.NET is based on html page navigation and string concatenation since it’s not an SPA system. Wisej, being an SPA, doesn’t navigate so you either authenticate before loading the first page or use the dynamic SSO approach.

I can send you an SSO sample for Azure AD, Google, LinkedIn and Facebook. Contact support at wisej.com directly

  • Luca answered Dec 4, 2020 - 2:20 pm
Showing 4301 - 4320 of 11k results