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

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
Rieko Saitoh
Posts: 39
Joined: Sat Apr 30, 2016 11:46 am

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

Post by Rieko Saitoh » Mon Jun 24, 2019 5:33 pm

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 20 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

MarkD
Posts: 626
Joined: Wed Dec 02, 2015 9:56 am

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

Post by MarkD » Thu Jun 27, 2019 9:47 am

Could you post screen shot(s) of the errors you see displayed?

Rieko Saitoh
Posts: 39
Joined: Sat Apr 30, 2016 11:46 am

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

Post by Rieko Saitoh » Fri Jun 28, 2019 2:27 pm

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 428 times
2.If you check the check box, the following error message will be displayed.
pic2.png
pic2.png (19.25 KiB) Viewed 428 times
Best regards,
Rieko Saitoh
LANSA japan

MarkD
Posts: 626
Joined: Wed Dec 02, 2015 9:56 am

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

Post by MarkD » Fri Jun 28, 2019 3:02 pm

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();
});

}

Rieko Saitoh
Posts: 39
Joined: Sat Apr 30, 2016 11:46 am

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

Post by Rieko Saitoh » Wed Jul 03, 2019 3:49 pm

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

MarkD
Posts: 626
Joined: Wed Dec 02, 2015 9:56 am

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

Post by MarkD » Thu Jul 04, 2019 9:16 am

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.

MarkD
Posts: 626
Joined: Wed Dec 02, 2015 9:56 am

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

Post by MarkD » Thu Jul 04, 2019 9:29 am

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)

Rieko Saitoh
Posts: 39
Joined: Sat Apr 30, 2016 11:46 am

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

Post by Rieko Saitoh » Tue Jul 09, 2019 12:12 pm

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

Post Reply