Javascript in the HTML Markup Taskflow only runs once (Doc ID 1559545.1)

Last updated on JUNE 16, 2017

Applies to:

Oracle WebCenter Portal - Version 11.1.1.6.5 and later
Information in this document applies to any platform.
Javascript in the HTML Markup Taskflow only runs once.

Goal

Provide steps to run inline Javascript in the out of box 'HTML Markup Taskflow' so that it will run whenever you view HTML Markup's Page.

Sample steps that displays the issue that is not desired:

  1. Create a new Portal Group Space (for this test use "Documents Exchange" template), lets call it myGroupSpace.
  2. As a Moderator, Edit  "myGroupSpace".
  3. Navigate to Pages, Create two empty Pages (i.e. Page1, Page2)
  4. Navigate to Group Space Settings, Resources, Navigations.
  5. Create a New Navigation. Call it "myGroupSpaceNav".
  6. HighLight/select "myGroupSpaceNav". Under Edit (menu), select 'Show'.
  7. Highlight/select "myGroupSpaceNav". Under Edit, select Edit.
  8. Choose to add a Link. Input as follows:
    ID = LinkPage1
    Name = LinkPage1
    Path = (click the magnifying glass to search for Page1 in "myGroupSpace".
  9. Save the Link.
  10. Repeat the same, create a Link "LinkPage2" for Page2 in "myGroupSpace"..
  11. Back in the Group Space Settings, General (tab), select the newly created navigation "myGroupSpaceNav" for the "Navigation" property under "Dispaly Settings" section.
  12. Save the changes.
  13. Return to Group Space "myGroupSpace". Notice Links LinkPage1 and LinkPage2 are displayed. Test navigation by clicking on each link. Pages are blank since no content exists.
  14. Navigate to "Page2" and choose to edit the Page.
  15. Add the 'HTML Markup" taskflow to the Page.
  16. Edit the taskflow by clicking the little wrench.
  17. Copy/Paste the snippet of code below:
<script type="text/javascript">

document.write("This was Printed by Document.Write");

function codeAddress() {
   alert('Run Me Again! ');
   }
codeAddress();
</script>
<br/>
6.5.1.2 The HTML Markup Layout Component<br/>
The HTML Markup layout component is a simple text editor that enables the entry of text, HTML markup, Javascript, and Expression
Language (EL) expressions.

        Above code is expected to display an alert every time Page2 is accessed.

  18.  Navigate between Page1 and Page2 by clicking on the links. Notice, the alert is only displayed when Page2 is accessed the first time.  

Solution

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms