All Answers

0 votes

The state is “hovered”.

When you click on the checkbox (or radiobutton) icon in the ThemeBuilder it will select the inner “icon” component in the left tree. There you will see only 1 property “inherit”: “icon-dark”. It means that the “icon” component in the “checkbox” widget inherits its states, styles and properties from the “icon-dark” appearance.

When you navigate to the “Icon Dark” appearance (the dash is displayed as a space) you can see that the state “hovered” sets the text color of the icon, which Wisej applies to the monochrome svg icon. If you use pngs you need a different png.

If you change the textColor property in “Icon Dark” then all icons that inherit its values will also use the new values. You can simply override the inherited state by adding it directly to the “icon” component in the “checkbox” widget.

HTH

  • Luca answered Apr 9, 2018 - 4:12 pm
0 votes
In reply to: Ribbonbar Extension

You need the new build coming up. Or comment out the method completely. The base Wisej.Web.Control already has a ValidateActiveControl() – which changed in the new build to take in consideration the values of AutoValidate and CausesValidation.

  • Luca answered Apr 9, 2018 - 3:34 pm
0 votes

Hi Luca,

thank you for the explanation 🙂

Bye

Cristian

0 votes

FF and Edge don’t support transitions on background images. I’ll see if it’s easy to implement an image fading switch. Not having the simple css transition makes it more difficult since you need 2 elements instead of one and rotate the images while fading one in and the other out and viceversa. With chrome is’s enough to set 1 css style.

  • Luca answered Apr 7, 2018 - 3:59 pm
1 vote
In reply to: PDF Viewer question

I don’t know what is wrong with the code. I can tell you that the PdfViewer in Wisej returns a stream and it works. This is the source code from Wisej, in case it helps you find the error. The first part sends back a pdf stream, the second a pdf file.

 /// <summary>
 /// Process the http request.
 /// </summary>
 /// <param name="context">The current <see cref="T:System.Web.HttpContext"/>.</param>
 void IWisejHandler.ProcessRequest(HttpContext context)
 {
 HttpRequest request = context.Request;
 HttpResponse response = context.Response;

 response.ContentType = "application/pdf";
 response.AppendHeader("Access-Control-Allow-Origin", "*");
 response.AppendHeader("Content-Disposition", new ContentDisposition() { DispositionType = "inline", FileName = Path.GetFileName(this.PdfSource) }.ToString());

 if (this._pdfStream != null)
 {
   try
   {
     if (this._pdfStream.CanRead)
     {
       try
       {
         this._pdfStream.Position = 0;
       }
       catch { }

       this._pdfStream.CopyTo(response.OutputStream, 1024);
     }
   }
   catch (Exception ex)
   {
     LogManager.Log(ex);
   }
 }
 else
 {
   try
   {
     string filePath = this.PdfSource;
     if (!Path.IsPathRooted(filePath))
       filePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, this.PdfSource);

     response.TransmitFile(filePath);
   }
   catch (Exception ex)
   {
     LogManager.Log(ex);
   }
 }
 response.Flush();
}

 

  • Luca answered Apr 7, 2018 - 3:57 pm
0 votes

There is a (hopefully) working sample in /examples.

I don’t know all the functionality of chart js, it’s here: https://www.chartjs.org/

  • Luca answered Apr 7, 2018 - 12:07 am
0 votes
In reply to: PDF Viewer question

Even tried this:

setting the PdfSource = http://localhost:64730/images.ashx  (via a text box and button at run time)

 

My current .ashx handler:

try
{
System.Web.HttpResponse response = System.Web.HttpContext.Current.Response;
response.Clear();
response.ClearContent();
response.ClearHeaders();

byte[] buffer;
using (FileStream fs = File.OpenRead(@”c:\test\test.pdf”))
{
int length = (int)fs.Length;

using (BinaryReader br = new BinaryReader(fs))
{
buffer = br.ReadBytes(length);
}
}

response.Buffer = true;
response.ContentType = “application/pdf”;
response.BinaryWrite(buffer);
response.Flush();
catch (Exception ex)
{
string ls = ex.Message;
throw;
}

If i put that URL in my browser it comes up and shows the PDF so its definitely sending it out- but nothing shows in PDF.js at all.

I think I’m about out of attempts. Anyone done anything similar ? I thought this last try would work.

 

0 votes

I set it to 26px, created an AutoSize label and it seems correct. Do you mean that when opening the window or page they are not scaled automatically if the font in the theme was changed?

  • Luca answered Apr 6, 2018 - 9:04 pm
0 votes
In reply to: PDF Viewer question

So,  When I set the pdfsource property from within the code to a file on thedrive like this: “c:\test\test.pdf” then PDF.js can load it.

 

I need to send it from a url like this: images.ashx?image=abc.pdf for example

The URL is from the same site right now – trying to at least get it working first.

I wrote a handler that does this (.ashx within the same application):

// context.Response.ContentType = @”application/pdf”;
// context.Response.WriteFile(@”c:\test\test.pdf”);
// context.Response.End();

System.Web.HttpResponse response = System.Web.HttpContext.Current.Response;
response.ClearContent();
response.Clear();
response.ContentType = @”application/pdf”;
response.AppendHeader(“Content-Disposition”, “attachment; filename=test.pdf;”);
response.TransmitFile(@”c:\test\test.pdf”);
response.Flush();

 

But pdf.js gives an error: Invalid or corrupt pdf file:PDF.js v2.0.480 (build: a7a034d8)
Message: Invalid PDF structure

Do you have an example on how to properly stream a file to pdf.js from a url ? (I tried 2 methods above – Googled it for a while, looks like i’m doing it correctly)

 

  • edmond girardi answered Apr 6, 2018 - 1:11 am
  • last active Apr 6, 2018 - 8:33 pm
0 votes

I attached a demo project.

In the project we have 3 html and json files. All files are embedded. Special case for adminWithExistingJson.json because this file will be also copied to the output directory. The LoadConfiguration event is in WisejHost.cs:159

When you launch it three browser windows will popup.

  • Default.html: works beside no json file in output directory
  • Admin.html: not working. Uses default.json
  • AdminWithExistingJson.html: working, but only because we have the json in output directory.

In the console output you will also see that only default and adminWithExistingJson are requested.

I hope this shows the problem.

  • Bernhard Lang answered Apr 6, 2018 - 6:36 am
  • last active Apr 6, 2018 - 6:38 am
0 votes

Sorry, forgot. Here it is. This sample should get you started. You can refer to the .NET standard System.ComponentModel docs to explore the TypeConverters and UITypeEditor features.

  • Luca answered Apr 5, 2018 - 6:57 pm
1 vote
In reply to: Speech synthesis?

IE doesn’t support the speak api. Try with chrome. Also, the extension supports speech recognition as well.

  • Luca answered Apr 5, 2018 - 6:41 pm
1 vote

Wisej.Application.exe

  • Luca answered Apr 5, 2018 - 4:44 pm
0 votes

Hi Valeriano,

You can use Application.Browser.Device to detect the device type.

Possible values are Desktop, Mobile, Tablet.

Best regards
Frank

 

0 votes

Users are very complicated…

If we enter http://demo.wisej.com/CodeProject, open some wisej windows (ex. Open DataBinding Example) and then open new tab and also navigate again to http://demo.wisej.com/CodeProject the windows are already open. Like we have left the first tab. Now the user closes the wisej windows. But in the first tab the window is still available. But no matter what the user clicks within the DataBinding Example nothing happens. This is confusing for our users. If you open google.com, do something and open a new google tab it has no impact on the first tab. But the browser passes the same session (cookies).

With favorites I mean the browser favorites (IE) or bookmarks (Chrome & FF). Where you “remember” a page and by clicking on it the browser navigate to it. In cookieless we have the ?sid parameter included in the favorite. Our users have links like http://demo.wisej.com/CodeProject#Control1 and http://demo.wisej.com/CodeProject#Control2/objectid as favorite to allow a quick navigation to specific functions to our app. With cookieless the sid is included in the link. Therefor we have the same problem again.

Using the window.sessionStorage would be perfect because then the sid would not be visible in the url and multiple instances would be possible.

Thank you very much

0 votes

I’m not sure I understood the issue. Can you send me some steps to reproduce?

Also with the LoadConfiguration event you don’t even need a json file. You can simply create Configuration object from the json definition and return it instead of assigning the file path. It lets you store the json config in an embedded resources or build it by code.

  • Luca answered Apr 5, 2018 - 2:47 pm
2 votes

The HostService extension is provided with the source code to be compiled to match your requirements. There are many OWIN middlewares that you can add to your host service to add authentication, filtering, logging, etc. Basically it lets you build your own web server with the features you need. The one we provide is the base skeleton. For example, we have included the file system middleware to browser files, but you may want to remove it.

The same goes for the Standalone exe. We provide the basic window and two options (IE and Chrome). Usually a final project wants to change the logo at startup, the loader, the exe icon, and maybe add a toolbar or status bar or other controls.

You also may want to change the default port. Or may want to handle certain requests in a custom way. To compile it you need VS2015 because the code uses some constructs available with the C# 6 compiler.

I have attached the precompiled exe. Please be aware that Windows 10 (or maybe also 8) will block any service trying to listen to 80 and all domains. So if you want to start the service listening to * and port 80 you need to start it as admin.

See also  https://wisej.com/blog/self-hosting-and-standalone-web-apps/

To start the one I attached:

  • Copy the exe to the root of your Wisej project (same level as /bin).
  • You can register multiple instances of the same service (i.e. for load balancing in case you also use NGINX as reverse proxy), simply assign a different name (it shows in the task manager or service manager).
  • Start it from the command line to test like this: Wisej.HostService -d:localhost -p:8080
  • Now you can browse to localhost:8080
  • If you want to accept external connections: start the command line as admin and run Wisej.HostService -d:* -p:80  (or 8080, depends on your firewall)
  • To install as a service use -i and optionally -n to set the name.

We are using it here: http:/demo.wisej.com:8080

 

  • Luca answered Apr 5, 2018 - 2:42 pm
0 votes

Users want different things 🙂

Sharing the session cookie among tabs it’s not a Wisej feature. All browsers do that and all web systems that use session ids in cookies have the same behavior, including ASP.NET/MVC, PHP, JSP. It gets mitigated if you use URL navigation with ASP.NET, but most apps use update panels and single page and end up in the same place.

The refreshActiveTab option is meant to sync tabs and avoid messing up applications that were not designed to operate on multiple tabs. It’s documented but it’s not online yet.

The only way to differentiate a session between tabs is to use the cookieless option. I don’t understand what “favorites” are and how it makes the cookieless option not work? Any javascript based option doesn’t work because a refresh loses everything stored in memory and you are left only with the URL to distinguish sessions.

A new option could be to use window.sessionStorage for the session id cookie. This one is isolated for each tab. I can log an enhancement issue.

 

 

  • Luca answered Apr 5, 2018 - 2:24 pm
0 votes

Hi Tobias,

yes, see “notSupportedUrl” in default.json

Best regards
Frank

0 votes

Can you please provide my a short answer please ? This features has been asked by a customer and I want to provide any feedback.
Thank you.

  • Tobias answered Apr 5, 2018 - 8:23 am
Showing 7581 - 7600 of 11k results