Web Client Control Add-Ins

eamonnoc
Member Posts: 3
Hi, I'm trying to create a control add-in for use in the NAV 2013 r2 web client written in C#.
However I'm stuck on how the winform can get displayed in the web client using javascript or if it's possible at all?
Currently I have embedded the winform project as a html object in my javascript manifest. This winform project has been registered as a class library dll with some [comvisible] methods. This works ok when I call a simple helloworld() method within this project that returns a string but I'm unsure how to call my main createcontrol() function that returns a form.
Does anyone have an example of a similar C# winform project for use in web client or can guide me in the right direction? Any help would be greatly appreciated.
Cheers.
Here's the manifest file;
<?xml version="1.0" encoding="utf-8"?>
<Manifest>
<ScriptUrls>
<ScriptUrl>http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.9.1.min.js</ScriptUrl>
</ScriptUrls>
<Script>
<![CDATA[
var LeaveCalendarObject = null;
var returntext = null;
function InitializeControl(controlId)
{
var leavecalendar = '<OBJECT id="DemoActiveX" classid="CLSID:A3C7EA29-CF01-47A1-B53A-F4623E0CC1F8" VIEWASTEXT></OBJECT>';
$("#" + controlId).append(leavecalendar);
LeaveCalendarObject = document.getElementById("DemoActiveX");
}
function SayHello() {
alert(LeaveCalendarObject.SayHello()); //This simple helloworld function works ok
LeaveCalendarObject.CreateControl() //this doesn't work
}
$(document).ready(function()
{
InitializeControl("controlAddIn");
Microsoft.Dynamics.NAV.InvokeExtensibilityMethod("ControlAddInReady");
});
]]>
</Script>
<RequestedHeight>360</RequestedHeight>
<RequestedWidth>640</RequestedWidth>
<VerticalStretch>true</VerticalStretch>
<HorizontalStretch>true</HorizontalStretch>
</Manifest>
However I'm stuck on how the winform can get displayed in the web client using javascript or if it's possible at all?
Currently I have embedded the winform project as a html object in my javascript manifest. This winform project has been registered as a class library dll with some [comvisible] methods. This works ok when I call a simple helloworld() method within this project that returns a string but I'm unsure how to call my main createcontrol() function that returns a form.
Does anyone have an example of a similar C# winform project for use in web client or can guide me in the right direction? Any help would be greatly appreciated.
Cheers.
Here's the manifest file;
<?xml version="1.0" encoding="utf-8"?>
<Manifest>
<ScriptUrls>
<ScriptUrl>http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.9.1.min.js</ScriptUrl>
</ScriptUrls>
<Script>
<![CDATA[
var LeaveCalendarObject = null;
var returntext = null;
function InitializeControl(controlId)
{
var leavecalendar = '<OBJECT id="DemoActiveX" classid="CLSID:A3C7EA29-CF01-47A1-B53A-F4623E0CC1F8" VIEWASTEXT></OBJECT>';
$("#" + controlId).append(leavecalendar);
LeaveCalendarObject = document.getElementById("DemoActiveX");
}
function SayHello() {
alert(LeaveCalendarObject.SayHello()); //This simple helloworld function works ok
LeaveCalendarObject.CreateControl() //this doesn't work
}
$(document).ready(function()
{
InitializeControl("controlAddIn");
Microsoft.Dynamics.NAV.InvokeExtensibilityMethod("ControlAddInReady");
});
]]>
</Script>
<RequestedHeight>360</RequestedHeight>
<RequestedWidth>640</RequestedWidth>
<VerticalStretch>true</VerticalStretch>
<HorizontalStretch>true</HorizontalStretch>
</Manifest>
0
Comments
-
I was looking for that too. The adding in NAV 2013 R2 his totally different thing than before. You need to look for JScript things, the output of the addin must be HTML which is included than in the client. I think that you cannot use the winform controls for that. Rather some HTML5 controls or something like that. But as I wrote, I am on same level like you in this... 8)0
-
It is correct that you cannot use WinForms controls in a Web Client control add-in. For these add-ins you need to use HTML and JavaScript.
For an introduction to the extensibility frameword for JavaScript-based control add-ins see this walkthrough document:
http://msdn.microsoft.com/en-us/library/dn182584(v=nav.71).aspx
Also consider watching this recording, which contains an introduction to the extensibility framework 26 minutes into the recording:
http://channel9.msdn.com/Events/Microsoft-Campus-Days/Microsoft-Campus-Days-2013/Web-client-2-0-for-NAV-2013R2_V2Best regards,
Thomas Søndergaard Jensen [MSFT]
This posting is provided 'AS IS' with no warranties, and confers no rights.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions