Topaz WiseJ integration

0
0

Hi

We are migrating from Visual WEbgui to Wisej and trying to integrate the topaz sigweb library in WiseJ. https://www.sigplusweb.com/sigwebtablet_demo.html

What is the best way to integrate this.
thanks
praveena

  • You must to post comments
0
0

Hi Luca

I tried with the changes you mentioned. But this.getParent().GetSigString(“hello”) gives error “getParent() is not a function”. Tried with just this.parent, no erorr but it didn’t seem to execute the web method.

Is there a way that i can call a method in Javascript from the C# and get a return value. When the dialogs OK button is clicked and if I have a JS method in my html file that returns a value like below.

function OkButtonClick() {
var value = window.document.getElementById(‘hiddenTextField’).value;

return value;
}

Is there a way that i can call the method from C#  when the OK button is clicked and obtain the value returned ?

I am just trying to think of options to get the signature string on the server side for further execution. So if we can get one of these options- either from JS to C# or C# to JS working, that should be good.

 

thanks

praveena

 

  • You must to post comments
0
0

Looking at the sample you attached:

Remove this override. It’s not needed and the wiredEvent is not declared correctly.

 //Register the WebMethod
 protected override void OnWebRender(dynamic config)
 {
 base.OnWebRender((object)config);

  config.webMethods = new[] { "GetSigString" };
 config.wiredEvents.Add("changeSig(Text");
 }

This is almost correct and it’s all you need. Simply remove “static”. In Wisej web methods work in the instance (which is quite hard if not impossible with other web frameworks.)

 [Wisej.Core.WebMethod]
 public static void GetSigString(string sigString)
 {
 //// System.IO.File.WriteAllText(@"C:\temp\TEST_Filled_FORM.html", CKData);
 AlertBox.Show(sigString);
 //SignatureString = sigString;
 }

Then in your js code I did’t find any call to the web method. In Wisej the server side C# web methods are automatically mapped to the client side java script.

Since your js code is running in he HtmlPanel (a child of TopazHtmlDialog) simply call the web method like this:

 

this.getParent().GetSigString("hello");

If it doesn’t work add a “debugger;” statement in javascript and debug using chrome dev tools. Check that “this” is the html panel.

 

  • You must to post comments
0
0

Hi Levie

Adding the iframe panel helped in activating the topaz signature and i was able to capture the signature successfully.  Now i am trying to see how to get the signature string back to the server so that it can be saved and used to render in future.

In the attached project, when Save is clicked the onDone  JS function will be executed. I added a web method on the C# side and I was trying to call it from the JS (Lind 2183 in HtmlPage1.html).  I tried it while in the OnDOne method or with the click of OK button.

But somehow i am not able to do it successfully. Could you please check and advise what i am doing wrong here.

The plan is to use the signature string to display it on the widget control on the main form.

thanks

praveena

 

  • You must to post comments
0
0

Hi Levie

Thank you for your response.

I am attaching a sample code that I created from an existing wisej project.

I added a widget control in the main form and on widget click event i am loading the topaz signature dialog. This dialog has an html panel and i am setting the htmlsource(HtmlContent.txt under Resources folder) to populate the htmlpanel. The html file have the js script inline.

It loads the html content fine in the panel. But it does not invoke any javascript functions when the buttons are clicked. Is there anything else to be added to htmlpanel for it to invoke the js within the html file?

The reason I need to open a new dialog to capture the topaz signature is because in the main form the control can be resized to any size. And eventually the plan is to capture the signature and load it in the widget on the main form.

Please let me know how i can get the js functions involed once the dialog is loaded with the Topaz html content.

 

thanks

praveena

Attachment
  • Levie (ITG)
    Hi Praveena, in your case I would suggest using an IFramePanel and setting the url to “/MyPage.html” in the project root. The HtmlPanel is not meant for mixing in JS like that. Setting the source of the HtmlPanel is similar to assigning that content to the innerHtml of the DOM element. Best regards, Levie
  • You must to post comments
0
0

Hi Praveena,

If you want to integrate it with Wisej (beyond showing an HTML page in an iFrame), you’ll want to start with a Widget.

  1. Add the sigplusweb packages to Widget.Packages
  2. Configure the InitScript to initialize the widget.
  3. Use this.fireWidgetEvent(type, {some:”data”}) to fire events from the client-side Widget and handle them in the Widget’s WidgetEvent.
  4. Add methods on the client using this.someMethod = function(data) {} and call them from the server using this.widget1.Call(“someMethod”, “some data”);

 

Check out the Widget class documentation.

I believe you’ve also looked at using the Syncfusion EJ2 Signature control, but if not it’s available here: https://github.com/iceteagroup/wisej-ext-syncfusion2

If you need help integrating the widget beyond basic support, I encourage you to contact sales AT Wisej dot com to get a quote for a consulting package!

 

Best regards,

Levie

  • You must to post comments
Showing 5 results
Your Answer

Please first to submit.