adding theme to reusable part embed in simple html 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
raulo
Posts: 3
Joined: Thu Nov 26, 2015 2:23 am

adding theme to reusable part embed in simple html page

Post 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,
dannyoorburg
Posts: 177
Joined: Mon Jan 04, 2016 9:50 am
Location: Australia

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

Post 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
raulo
Posts: 3
Joined: Thu Nov 26, 2015 2:23 am

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

Post 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.
dannyoorburg
Posts: 177
Joined: Mon Jan 04, 2016 9:50 am
Location: Australia

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

Post by dannyoorburg »

And in the CreateInstance event of your Reusable Part?
raulo
Posts: 3
Joined: Thu Nov 26, 2015 2:23 am

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

Post 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
Post Reply