Embed a Reusable Part in a 3rd Party 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
soa
Posts: 311
Joined: Mon Dec 07, 2015 3:15 pm

Embed a Reusable Part in a 3rd Party Web Page

Post by soa » Fri Nov 01, 2019 12:58 pm

I have a simple RP a PRIM_PANL containing a FilePicker. The file picker has a logo and text.

In a WEBEVENT fulction I have

<div id="LANSAFrame" style="width:50px;height:50px;">

<script type="text/javascript">

var myPart = null;

LANSA.init({sys:"dc-pgmlib",part:"V40",lang:{ def:"ENG",code: { "ENG":"en-AU" } },splash:{ limg:"spin",txt:"Loading..." } } );

LANSA.showPart( "GEN0006", "LANSAFrame", function( newPart ) {
myPart = newPart;
LANSA.setProperty( myPart, "EntityType", "<RDML MERGE="WEBETC_CT">" );
LANSA.setProperty( myPart, "EntityId", "<RDML MERGE="WEBEID_CT">" );
LANSA.setProperty( myPart, "UserId", "<RDML MERGE="WEBUSR_CT">" );
LANSA.setProperty( myPart, "UploadCAPTION", "Select a project" );
LANSA.invokeMethod( myPart, "CheckAuthority" );
});

</script>

This is executing and the #SYS_WEB.Console.Log entries in the RP show that the code is executing but there is nothing on the screen. The PRIM_PANL and FilePicker are both set to visible but they're not.

Any ideas?

soa
Posts: 311
Joined: Mon Dec 07, 2015 3:15 pm

Re: Embed a Reusable Part in a 3rd Party Web Page

Post by soa » Fri Nov 01, 2019 3:53 pm

There's an issue with the DIV definition above. I've replaced it with

<div id="VLUPLOADER" style="top:0px;left:0px;width:250px;height:80px;">Div goes here</div>

The issue now is that I can see the phrase 'Div goes here' where I expect them but the upload control with icon flash briefly elsewhere in the page. I'm sure its related to the div style but the document example uses an absolute position which is no good for a webevent component.

soa
Posts: 311
Joined: Mon Dec 07, 2015 3:15 pm

Re: Embed a Reusable Part in a 3rd Party Web Page

Post by soa » Fri Nov 01, 2019 4:08 pm

OK I now have

<div id="VLUPLOADER" style="position:relative;top:0px;left:0px;width:200px;height:45px;"></div>

and this puts the control right where I want it. The issue is now is that when the page renders it seems to jump down to ensure that the newly rendered control is in focus which is a bit jarring.

Any ideas?

Post Reply