Page 1 of 1

adding theme to reusable part embed in simple html page

Posted: Wed Mar 07, 2018 1:51 am
by raulo
Hi guys,

If you use a reusable part, inside an external html page (not a LANSA Web Page), meaning, adding lines like this to the html:

<script src="/xxxpgmlib/lansa_14_1_50_0/lansa.js"></script>
...
LANSA.init({sys:"xxxpgmlib",part:"xxx",lang:{ def:"ENG",code: { "ENG":"en-US", "FRA":"fr-FR", "JPN":"ja-JP" } },splash:{ limg:"spin",txt:"Loading..." } } );
...
LANSA.showPart( "a034rp", "LANSAFrame", function(pPart)

as per the documentation here: http://docs.lansa.com/14/en/lansa017/index.htm#lansa/vlwebeng02_0035.htm

the reusable part is shown in the web page and you can interact with their events, methods and properties...

:?: BUT, as reusable parts inherit the theme from the Web Page, how can we pass a Theme to this reusable part that now is living by itself in a non LANSA html page? We want the reusable part to have a blue theme, but currently everything is just gray.

Thank you,

Re: adding theme to reusable part embed in simple html page

Posted: Wed Mar 07, 2018 9:54 am
by dannyoorburg
Hi,

I haven't tried it, but I expect the following line to work, even in this scenario...

#SYS_WEB.WebPage.Theme <= #SYS_THEME<2015Blue>

Cheers,
Danny

Re: adding theme to reusable part embed in simple html page

Posted: Wed Mar 07, 2018 12:46 pm
by raulo
thank you for the reply. I tried adding the line #SYS_WEB.WebPage.Theme <= #SYS_THEME<2015Blue> in a method, then invoke the method first from the html web page, but no change at all. the theme change is ignored.

Re: adding theme to reusable part embed in simple html page

Posted: Wed Mar 07, 2018 12:52 pm
by dannyoorburg
And in the CreateInstance event of your Reusable Part?

Re: adding theme to reusable part embed in simple html page

Posted: Thu Mar 08, 2018 1:08 am
by raulo
Thank you. That did the trick!

The solution was adding this in the reusable part:

Evtroutine Handling(#Com_owner.CreateInstance)
#SYS_WEB.WebPage.Theme <= #SYS_THEME<2015blue>
Endroutine