Search This Blog

Friday, September 23, 2011

Embedding Pagelet to a Page

Never tried embedding the Pagelet to a page before. I have tried it on the home page or under a component. For those who have not tried this; below are the steps to do it.

Create a pagelet and publish it on the home page tab.



And make sure on the 6th step; that is on the publish pagelet step; to check the embedd pagelet option.



Now use the following code and place it under the event you like.

import PTPPB_PAGELET:*;
Local object &PWAPI, &Pagelet;
&PWAPI = create PTPPB_PAGELET:PageletWizard();
&Pagelet = &PWAPI.getPageletByID("ASDASD", False);
AMM_DERIVED.HTMLAREA = "
" | &Pagelet.Title |
"
" | &Pagelet.Execute() | "
";


AMM_DERIVED.HTMLAREA is the HTML area that you place on the page to display the embedded pagelet.

And the pagelet on the page will look like the one below.



Interesting right? Try it out!

1 comment: