SOLVED - Working application now fails with blank screen

Answered
0
0

Hi All

I went to modify some working and previously deployed code in Visual Studio, but when I try debugging via VS the page loads (with the spinner), but then just displays a blank page (Note: WiseJ Network and Session timeout messages are still displayed at correct intervals).  Debugging never hits the first breakpoint in Program.Main and no compiling errors displayed.

Configuration:

  • Windows 7
  • Visual Studio 2013
  • Default.json – {“url”: “Default.html”,”culture”: “en-UK”,”startup”: “MyApp.Program.Main, MyApp”,”sessionTimeout”: 300}
  • WiseJ version – 1.4.95.0 with valid license till 2019

Stuff I have tried:

  • Disabling websockets in default.json
  • setting debug in default.json
  • setting mainWindow in default.json

Items noted:

  • IE reports a Websocket error when Websockets is turned on or off, but have been unable to work out why since this was a working configuration.
  • Websocket error – Incorrect HTTP response. Status code 200, OK

Any ideas?

  • Kevin Caine
    Additional Information: * Creating a brand new default project is working, so somehow this must be a setting in my existing project. In the interim I am going to try copy over code to the new project, and include all the various references until something breaks again.
  • You must to post comments
Best Answer
1
1

Hi again Kevin,

Please have a look at https://github.com/iceteagroup/wisej-examples/tree/master/HtmlJsonAndMain/

The MultiHtml project uses sub-applications (json files) in the root of the project and in folders. Some json files use “startup” while other use “mainWindow”. Some buttons use html relative address while others navigate to the relative path, without any extension (/folder/page.html vs /folder/page). So I can confirm the json setting “mainWindow” is working all right in release 1.4.99.

The ChangedNames project was re-tested, and the Readme.txt file corrected. In a nutshell:

  1. If you type an url that ends with “.html”, if the file exists, Wisej tries to find the matching json file (same name, json extension instead of html) and uses it.
  2. If you type an url that ends with “/” like “folder/”, Wisej uses “folder/Default.json”.
  3. if you type an url that doesn’t end with “.html” like “Customer”, Wisej appends .json to this name and use as the json file, in this case uses “Customer.json” .
  4. If you type an url that ends with “.html”, if the file exists and Wisej can not find a matching json file (same name, json extension instead of html) the wisej.wx script reloads the same page.

This was tested under release 1.4.99.

If you feel that something is not working as described, please send a sample.

  • Kevin Caine
    Thanks Tiago, your reply dated 10 July 2018 10:40pm is now the correct solution/usage in current versions. Tested and works as intended even under 1.4.95
  • You must to post comments
Great Answer
0
1

SOLVED
But still a bug that didn’t exist previously.

Explanation:
When calling <script src=”wisej.wx”></script> from ANY other html file, the script fails to load correctly (and call the Program.Main). ONLY Default.html file can have the script tag and have it work. Since my application called a new html file after calling Default.html, the script failed to load trigger the Program.Main().

Resolution:
Create a .json configuration file for ANY html file that contains the <script src=”wisej.wx”></script> and configure the entry point and html file name accordingly in that file. NB json file MUST be named exactly as the html file (eg: Bob.html must have corresponding Bob.json)

Hope this helps someone else in the future, cos that is 6 hours of my life I won’t get back 😀

  • You must to post comments
0
0

Hi Kevin,

Sorry to hear about your troubles.

I’m not sure I understood your scenario.

Wisej supports the scenario of using more than one HTML file. An example will be added shortly to Wisej-Examples.

Say you want to use a different URL for application administration. On Visual Studio, you should right click on the project and

Add => New Item

On the Add New Item form, select Wisej on the left side and choose Application. Set the Name (say Administration) and click Add.

Wisej creates 3 files:

  • Administration.cs
  • Administration.html
  • Administration.json

You will notice that Administration.json will look like this

Snippet

{
	"url" : "Administration.html",
	"startup": "<ProjectName>.Administration.Main, <ProjectName>"
}

This json file instructs Wisej to show the Administration.html file and execute Administration.Main method on startup.

Note that Administration.html also loads wisej.wx

You may alseo notice that, in this new (sub-)application, the Administration.Main method is the startup method. Use this method to set the Application:MainPage or whatever you want to show on the adminsitration part of you application.

Last, in case you want to set up an Administration button, you can navigate to the Administration (sub-)application like this

Snippet

Application.Navigate("Administration");

 

Sub-applications are different entry points in your application, independent URL you can use for whatever purpose you decide. On a brand new project, by default Wisej creates:

  • Default.json
  • Default.html
  • Program.cs (this name is used because that’s the name we are used to in WinForms)

When you create a new Application, Wisej uses the same base name for all three files. Of course you can change these names; you just need to also change the json file.

  • Kevin Caine
    Hi Tiago I understand that this is the new config, but the site I was working on used the default.json file information which happily worked (and is still working in production) on previous version (see http://www.twaliz.co.za, there is no ktrax.json file on that site that matches ktrax.html, the wisej script is only in the ktrax.html on that site). Because my development machine changed to a new version (auto upgraded), the site on my development machine developed this “bug”, or as we say nowdays “feature” – he he. The answer is still relevant though in case someone else hits the issue
  • You must to post comments
0
0

Hi Kevin

Please have a look at the GitHub ChangedNames example
I hope it helps to clarify the Html, Json and Main relationships.

Quote Readme.txt filein the ChangedNames project

Removed as inaccurate.

 

  • You must to post comments
0
0

QUOTE: (fromTiago information)
The Default.json file on this projects looks like this:
{
“url”: “ChangedNames.html”,
“startup”: “ChangedNames.Startup.Main, ChangedNames`
}

Now Wisej knows it must show ChangedNames.html. This is very important, since browsers need an HTML file and Wisej needs the browser to load and execute wisej.wx

The second piece of information Wisej gets from the json file is the startup method, in this case
– method ChangedNames.Startup.Main
– assembly ChangedNames
Please note that the “startup” setting in the json file is optional, you can use the “mainWindow” setting instead.

Response:

This is not the way the current version behaves, so maybe this is still a bug? Changing the url setting to the page with the script, does not work unless the json file is exactly the same. Also, calling mainWindow also failed in my case.

Sample Test: Default.json file with url setting set to ktrax.html (see original question) still fails with blank page.

As mentioned before, this is either something that changed between versions, was maybe a bug in a previous version (no idea what the original version was), but the behaviour has changed somewhere in between. So, until 100% tested, I cannot see why people shouldn’t just add the json file for each html file? Besides that already gives me a huge bit of flexibility I didn’t know I had before.

  • Tiago (ITG)
    It seems some details I gave are wrong. I’ll fix the sample, the Readme.txt file and get back to this thread.
  • Tiago (ITG)
    Kevin, I presume the current version you mention is 1.4.99. Can you confirm?
  • Kevin Caine
    1.4.95
  • Kevin Caine
    Thanks Tiago, your reply dated 10 July 2018 10:40pm is now the correct solution/usage in current versions. Tested and works as intended even under 1.4.95
  • You must to post comments
0
0

Hi Kevin,

Please have a look at 3. Rules for finding the .json file at GitHub as there was a small change in Wisej 1.5.4

  • You must to post comments
Showing 6 results
Your Answer

Please first to submit.