How to call JavaScript functions in tab menu click

Having problems with building or using the CefGlue .NET/Mono binding? Ask your questions here.

Moderator: fddima

How to call JavaScript functions in tab menu click

Postby amitbansal008 » Mon Sep 23, 2013 11:08 pm

Hi,

I am using the Xillium.CfeGlue.Demo.WinForms example. I want to be able to call different javascript functions inside my website when i click on any of the menu dropdown items. How do i go about doing this? Do we have any ExecuteScript functions that we can call for doing this?
Also, i want to hide the tab display (i want my website to be diaplayed as an application so the top toolstrip section where different tabs are displayed needs to be hidden). Is there a way for me to do this in the WinForms example?
amitbansal008
Techie
 
Posts: 10
Joined: Wed Sep 18, 2013 3:11 am

Re: How to call JavaScript functions in tab menu click

Postby amitbansal008 » Tue Sep 24, 2013 1:24 am

Hi, figured out how to make a javascript call. Now i need to remove/hide the tab section. Can anyone let me know how to get this done? I have attached a file Browser Snapshot with the section i want to remove highlighted.
Attachments
BrowserWindow2.jpg
Browser Snapshot
BrowserWindow2.jpg (119.98 KiB) Viewed 13431 times
amitbansal008
Techie
 
Posts: 10
Joined: Wed Sep 18, 2013 3:11 am

Re: How to call JavaScript functions in tab menu click

Postby fddima » Tue Sep 24, 2013 3:16 am

This tab is implemented in WinForms application. I'm not understand how it is connected to JS.
Explain please.

PS: Check commands from samples menu. You can perform any actions with active browser, including calling JS.
fddima
Master
 
Posts: 788
Joined: Tue Dec 07, 2010 6:10 am

Re: How to call JavaScript functions in tab menu click

Postby amitbansal008 » Tue Sep 24, 2013 4:10 am

Hi fddima,

I was able to execute javascript using <<_browser.CefBrowser.GetMainFrame().ExecuteJavaScript(script, "", 0);>> in the WebNavigationBox.cs.

Hiding the tab menu is a different issue and my project wants it hidden. Do i need to start a seperate thread for this?
amitbansal008
Techie
 
Posts: 10
Joined: Wed Sep 18, 2013 3:11 am

Re: How to call JavaScript functions in tab menu click

Postby fddima » Tue Sep 24, 2013 4:44 am

amitbansal008 wrote:I was able to execute javascript using <<_browser.CefBrowser.GetMainFrame().ExecuteJavaScript(script, "", 0);>> in the WebNavigationBox.cs.

So what problem with this?

amitbansal008 wrote:Hiding the tab menu is a different issue and my project wants it hidden. Do i need to start a seperate thread for this?

No, another thread not required. But i'm also did not understand your's question. Just not use tab boxes in you application. Demo application of course not designed to dynamically hide/show tabs.
fddima
Master
 
Posts: 788
Joined: Tue Dec 07, 2010 6:10 am

Re: How to call JavaScript functions in tab menu click

Postby amitbansal008 » Wed Sep 25, 2013 1:06 am

Hi,

I was able to remove the tabs by removing all references to the TabControl in MainViewImpl file. Thanks for the help :)
amitbansal008
Techie
 
Posts: 10
Joined: Wed Sep 18, 2013 3:11 am


Return to CefGlue Forum

Who is online

Users browsing this forum: No registered users and 16 guests