Page 1 of 1

VL-Web: can't return from a widget to a web page

Posted: Mon Jun 24, 2019 5:33 pm
by Rieko Saitoh
Hi,

I created the following application
・Write HTML code in the HTML container and display the list. Place a check box in a specific column of the list.
・Calling widget when check box is clicked.

But, clicking on the check box causes an error. The widget generates an error and can not return to the calling web page.
I will attach this web page and widget.
lj12003.zip
Quickexports
(15.76 KiB) Downloaded 16 times
If you are experienced with widgets, could you check the definition of the widget? Could you point out where the problem is?

Thank you.

Best regards,
Rieko Saitoh
LANSA japan

Re: VL-Web: can't return from a widget to a web page

Posted: Thu Jun 27, 2019 9:47 am
by MarkD
Could you post screen shot(s) of the errors you see displayed?

Re: VL-Web: can't return from a widget to a web page

Posted: Fri Jun 28, 2019 2:27 pm
by Rieko Saitoh
Hi Mark,

Thank you for your interest in my question. The process of the error and the error message are below.

1.Display a table with check box columns.
pic1.png
pic1.png (5.14 KiB) Viewed 344 times
2.If you check the check box, the following error message will be displayed.
pic2.png
pic2.png (19.25 KiB) Viewed 344 times
Best regards,
Rieko Saitoh
LANSA japan

Re: VL-Web: can't return from a widget to a web page

Posted: Fri Jun 28, 2019 3:02 pm
by MarkD
I can get this to work, but I don't know much about jQuery:

PROTOTYPE.onRealizeControl = function( parentDiv )
{
var pThis = this;

// Provide the code to visualize the widget, FOR EXAMPLE...
parentDiv.appendChild( document.createTextNode( this.Caption ) );

$('.HR_MonthlyRoster tbody tr input:checkbox').on('click', function() {
pThis.firecheckboxClicked();
});

}

Re: VL-Web: can't return from a widget to a web page

Posted: Wed Jul 03, 2019 3:49 pm
by Rieko Saitoh
Hi Mark,

Thank you for your reply.
I changed the widget code as below. However, unfortunately the console log is not written. Also, processing can not be returned to VL-Web. Is my code incorrect?
---------------------------
code:
---------------------------
PROTOTYPE.onRealizeControl = function( parentDiv )
{
var pThis = this;

parentDiv.appendChild( document.createTextNode( this.Caption ) );

$('.HR_MonthlyRoster tbody tr input:checkbox').on('click', function() {
console.log("Check box is clicked1");
pThis.firecheckboxClicked();
});

}
---------------------------

Sorry to bother you again.
Thank you.

Best regards,
Rieko Saitoh
LANSA japan

Re: VL-Web: can't return from a widget to a web page

Posted: Thu Jul 04, 2019 9:16 am
by MarkD
You are using jQuery to fire the click event, which seems to be where the root of the problem is.
As I mentioned, unfortunately I don't know anything about using JQuery.

Re: VL-Web: can't return from a widget to a web page

Posted: Thu Jul 04, 2019 9:29 am
by MarkD
I do notice that in your web page your widget does not have a Parent()? Try

Define_Com Class(#LJ12003) Name(#LJ12003) Displayposition(2) Parent(#COM_OWNER) Tabposition(2)

Re: VL-Web: can't return from a widget to a web page

Posted: Tue Jul 09, 2019 12:12 pm
by Rieko Saitoh
Hi Mark,

As you advised, I did not specify the widget's Parent on the web page. By specifying Parent, the web page can detect the widget's signal.
Now my goal can be achieved. Thank you so much for your advice!!

Best regards,
Rieko Saitoh
LANSA japan