All Answers

0 votes
In reply to: Wisej.AI Trial Version

No, you need to become a Technology Partner for access to Wisej AI. You can contact sales AT wisej.com for more information.

0 votes
In reply to: Testing a session ID
0 votes

See attached test case.

You need to put all of the js code in a single file, in this case I put it in a file called startup.js.

If you want to load the js code from a file instead of setting it as a string in the InitScript, you need to create a new class that derives from Widget.

Public Class NewWidget
Inherits Wisej.Web.Widget
Public Overrides Property InitScript As String
Get
Return GetResourceString("WidgetTestApp.startup.js")
End Get
Set(value As String)
End Set
End Property
End Class

Note this line of code: Return GetResourceString("WidgetTestApp.startup.js") is where you are telling it where to find the js code. In VB.NET you don’t need to include the folder name like you do in c#. See https://docs.wisej.com/docs/concepts/embedded-resources#resources-and-platform-folders

0 votes
In reply to: Moving Up

You can find the VSIX installer for Wisej 4.0 here: https://wisej.com/builds/ It’s the first VSIX as you start scrolling down, the second one is Wisej 3.

You can add a user control the same way as in Wisej 3: Right-click in the solution explorer, Add -> New Item. Choose “Wisej.NET 4” from the left hand side and then choose “User Control”

0 votes

Thanks Julie!  As I mentioned, this is my first try at this.   The code make this look simple, add the widget, .js file, and a call, but I’m still unsure.

I added the “init” file OverlayCanvasWidget.js. In it’s Properties I set the Build Action to “Embeded Resource” and the Copy to Output Directory to “Copy if Newer”.

In the actual Widget I placed on my page I set the Package Name and Source, however in the InitScript, I’m not sure of the syntax of identifying the “init” file, which is “Scripts/Widgets/OverlayCanvasWidget.js”.  I assume this is what it is looking for, but it doesn’t work.  I can’t find in the documentation how to do this specifically.

Another suggestion or two would be helpful.

Thanks much!

Gerry

 

0 votes

Try setting the InitScript of the widget to your js code
https://docs.wisej.com/api/wisej.web/content/widget#initscript

0 votes

The PivotGrid is going to be blank unless you set measures.
PivotGrid doesn’t support just displaying raw data.
You can test this by looking at the demobrowser code and commenting out the measures section- the PivotGrid is then blank. You’re better off using a Kendo TreeList for something like this.

  • Julie(ITG) answered Aug 4, 2025 - 4:17 pm
  • last active Aug 4, 2025 - 4:18 pm
0 votes

Hello,

We would need a compliable test case in order to assist you. You have provided some code, but it’s not in a runnable test case.

Julie

1 vote

Another resource you should consider using is the AI search feature on our website: https://wisej.com/blog/your-wisej-net-questions-answered-powered-by-ai/

For example, if I search “How to prevent the user from closing the browser” I get this result:

You cannot fully prevent a user from closing their browser or tab, but you can warn them before they leave the page using the browser’s built-in “beforeunload” event.

To show a warning when a user tries to close the tab or browser:

window.addEventListener('beforeunload', function (e) {
  e.preventDefault();
  e.returnValue = '';
});
  • This triggers a confirmation dialog when the user tries to close the tab, refresh, or navigate away.
  •  Modern browsers do not allow you to customize the dialog text for security reasons.
  •  Users can still choose to leave, so this only acts as a warning, not a true prevention.

There is no way to completely block a user from closing their browser or tab, as this would be a security and usability risk. Use the “beforeunload” event to warn users, but always design your application to handle unexpected exits gracefully.

Here you should use the Application.EnableUnloadConfirmation, see documentation here:  https://docs.wisej.com/api/v3.5/wisej.web/general/application#enableunloadconfirmation Simply set Application.EnableUnloadConfirmation = true;

See also this forum thread: https://wisej.com/support/question/how-can-i-implement-a-notification-or-warning-message-in-wisej-when-a-user-attempts-to-close-the-browser-or-tab

0 votes

Yes. You’ll need to set the BoldedDates property to the dates that you want to set the backcolor for. Then modify the theme to set the back color.
See my answer here, which includes a a sample with the modified theme. https://wisej.com/support/question/datetimepicker

0 votes

Hi,

I’m back with a compilable test case that shows the issue, including the URL I’ve been testing.
The behavior is exactly as I previously described:

01. If you load the tree view with all elements, the JavaScript does not execute at all.

02. If you load it with only 4 elements, the JavaScript executes and displays a message that nothing was found (which is not the issue we’re discussing).

Execute the two buttons in different sessions, not one after another in one session.

Please find source code attached. It is based on NET 4.8

Kind regards!

 

  • mgmst answered Jul 30, 2025 - 5:06 pm
0 votes

Hi there,

I tried to reproduce the issue exactly like you stated, and I couldn’t reproduce.

Furthermore, having a TreeView with more than 4 nodes works, there’s no relation as to why having a TreeView with more than 4 nodes would fail evaluating javascript in the WebBrowser component.

At this point, we’re trying to guess what you’re trying to accomplish and it’s beyond the scope of free Wisej.NET support, please verify the javascript you’re trying to execute and make sure everything is escaped correctly.

The only way for us to verify this is to have a compilable, ready-to-run sample that demonstrates the issue reported.

Best Regards,
Alaa

0 votes

Hi,

I’m coming back with a solution to the problem, whose cause and fix turned out to be utterly absurd.

If a SplitContainer contains a TreeView and a Wisej.Web.WebBrowser, and the TreeView has more than 4 nodes, then Wisej.Web.WebBrowser.Eval(js) does not execute.
But if the number of nodes is 4 or fewer, the JS does execute.

This bizarre bug makes it impossible to implement an e-book scenario with a browser and a tree view containing more than 4 topics — which is, to put it mildly, EXTREMELY ANNOYING.

Please find images attached.

  • mgmst answered Jul 29, 2025 - 11:09 pm
0 votes

Perfect 🙂

0 votes
0 votes
In reply to: DateTimePicker

It’s not supported.

The closest thing is, you can use a MonthCalendar and set the BoldedDates. You can then theme the background color of the Bolded Dates.

The theme would look like this:
“datechooser”: {
“components”: {
“day”: {
“states”: {
“bolded”: {
“styles”: {
“css”: “{\”font-weight\”:\”900 !important\”, \”overflow\”:\”visible !important\”,\”display\”:\”flex\”,\”alignItems\”:\”center\”,\”justifyContent\”:\”center\”}”,
“backgroundColor”: “green”
},

See attached test case with a modified version of the bootstrap theme.

You could also consider using FullCalendar for something like this.

0 votes

Hi mgmst,

we need a compilable test case that shows the issue including the URL that you have been testing.
Otherwise we cannot help any further.

Best regards
Frank

0 votes

When it is in the test application (please find attached), I at least receive “Nothing found” message, which points that JS works.

When it is in a my control for books’ content loading- JS not works at all! Why so? Please advice.

 


Public Class C_Books_Container
Inherits Panel
Private ОWebBrowser As New CUtils.CInterfaceIni.CInterface.C_Wisej_Web_WebBrowser
Public WithEvents OTV As New CUtils.CInterfaceIni.CInterface.CTreeViewS.CTreeView.CTreeView_basic_01(Guid.NewGuid)
Private OSplitContainer As New SplitContainer

Public Sub New(INOStrURLText As String, INOSTRDelimiter As String, INOSTRDelimiter_Internal As String)
ОWebBrowser.Dock = DockStyle.Fill
OTV.Dock = DockStyle.Fill

With OSplitContainer
.Dock = DockStyle.Fill
.Panel1.Controls.Add(OTV)
.Panel2.Controls.Add(ОWebBrowser)
End With
ОWebBrowser.Url = New Uri(INOStrURLText)
Dim OStringPageContent As String = GetTextFromUrl(INOStrURLText)
F_TableОfContents_Get(OTV, OStringPageContent, INOSTRDelimiter, INOSTRDelimiter_Internal)

Me.Dock = DockStyle.Fill
Me.Controls.Add(OSplitContainer)

End Sub

Private Sub OTV_NodeMouseClick(sender As Object, e As TreeNodeMouseClickEventArgs) Handles OTV.NodeMouseClick

Dim searchText = “5”

Dim js As String =

var found = false;
var elements = document.getElementsByTagName(‘*’);
for (var i = 0; i < elements.length; i++) {
if (elements[i].innerText && elements[i].innerText.includes(‘” & searchText.Replace(“”””, “\”””) & “‘)) {
elements[i].scrollIntoView({behavior: ‘smooth’, block: ‘center’});
elements[i].style.backgroundColor = ‘yellow’;
found = true;
break;
}
}
if (!found) {
alert(‘Nothing found.’);
}

ОWebBrowser.Eval(js)

End Sub

End Class

 

 

 

  • mgmst answered Jul 27, 2025 - 2:38 pm
  • last active Jul 28, 2025 - 5:21 am
0 votes

Javascript is executed by the browser. So I used google and found why your “code” doesn’t work.

https://stackoverflow.com/ questions/3999101 /get-iframes-document-from-javascript-in- main- document

  • JD answered Jul 27, 2025 - 12:25 pm
0 votes

Nothing at all, complete silence and darkness.

  • mgmst answered Jul 27, 2025 - 11:11 am
Showing 141 - 160 of 11k results