CommandLinks do not Change Tabs After 1st Attempt (Doc ID 1381535.1)

Last updated on MARCH 08, 2017

Applies to:

Oracle WebCenter Portal - Version: 11.1.1.5.0 and later   [Release: 11g and later ]
Information in this document applies to any platform.

Symptoms


Have a bounded task flow with a panelTabbed. Add bindings to the tabs. Add a commandLink to change to another tab with the help of the following managed bean method called by the Action Listener:

  public void linkAction(ActionEvent actionEvent) {
    // Add event code here...
    System.out.println(" 1. Tab 1 setDisclosed status  "+tab1.isDisclosed());
    this.tab1.setDisclosed(false);
    System.out.println(" 2. Tab 2 setDisclosed status  "+tab2.isDisclosed());
    this.tab2.setDisclosed(true);
    System.out.println(" 3 . Finally , Tab 1 setDisclosed status  "+tab1.isDisclosed());
    System.out.println(" 4 . Finally , Tab 2 setDisclosed status  "+tab2.isDisclosed());
    
  }


Add this task flow to a WebCenter page.

When you click on the commandLink for the 1st time then it changes the tabs correctly. Then you change back to the original tab and you click on the commandLink once more. From then on, the tab is not changed and there is no exception shown in JDeveloper. The output is the same in JDeveloper, both when it works and when it does not work:

"
1. Tab 1 setDisclosed status true
2. Tab 2 setDisclosed status false
3 . Finally , Tab 1 setDisclosed status false
4 . Finally , Tab 2 setDisclosed status true
"

So it seems that the Disclosed property gets set correctly, nevertheless, the tab does not change on the UI.

The same problem occurs when using imageLink instead of commandLink.
The problem does not occur when placing the task flow to a JSF page, outside of WebCenter.


Steps to Reproduce
==================
1. Create a new bounded task flow based on page fragment

2. Add a panelTabbed with 2 showDetailItem (i.e. Tab 1 and Tab 2)

3. Create a managed bean with the following code:

package myapps.model;

import javax.faces.event.ActionEvent;

import oracle.adf.view.rich.component.rich.layout.RichShowDetailItem;


public class ManagedBean {
  public ManagedBean() {
    super();
  }
 

private String myText;
private RichShowDetailItem tab1;
private RichShowDetailItem tab2;


  public void setMyText(String myText) {
    this.myText = myText;
  }

  public String getMyText() {
    return myText;
  }

  public void setTab1(RichShowDetailItem tab1) {
    this.tab1 = tab1;
  }

  public RichShowDetailItem getTab1() {
    return tab1;
  }

  public void setTab2(RichShowDetailItem tab2) {
    this.tab2 = tab2;
  }

  public RichShowDetailItem getTab2() {
    return tab2;
  }

  public void linkAction(ActionEvent actionEvent) {
    // Add event code here...
    System.out.println(" 1. Tab 1 setDisclosed status  "+tab1.isDisclosed());
    this.tab1.setDisclosed(false);
    System.out.println(" 2. Tab 2 setDisclosed status  "+tab2.isDisclosed());
    this.tab2.setDisclosed(true);
    System.out.println(" 3 . Finally , Tab 1 setDisclosed status  "+tab1.isDisclosed());
    System.out.println(" 4 . Finally , Tab 2 setDisclosed status  "+tab2.isDisclosed());
    
  }
}


4. Add the following bindings to Tab 1 and Tab 2 respectively:


#{viewScope.managedBean.tab1}
#{viewScope.managedBean.tab2}


5. Add a commandLink or a commandImageLink with the following actionListener to Tab 1:


#{viewScope.managedBean.linkAction}

6. Create a new JSF page

7. Add the task flow to the page

8. Execute the page and notice that it works perferctly.

When clicking on the commandLink on Tab 1 it changes to Tab 2 as expected. This can be repeated any number of times.
So far so good.

9. Deploy the task flow to a jar file

10. Create a new File System connection to point to the containing folder of the jar file

11. Create a new WebCenter Portal application

12. Drag and drop the task flow from the File System connection to the home.jspx

13. Edit the jazn-data.xml (under Application Respurces -> Descriptors -> META-INF) to add a new permission to the anonymous-role with a code like this:

    <permission>
        <class>oracle.adf.controller.security.TaskFlowPermission</class>
        <name>/WEB-INF/task-flow-definition.xml#task-flow-definition</name>
        <actions>view</actions>
    </permission> 

You can obtain the name of the task flow from the page definition of home.jspx (homePageDef.xml) i.e:

<taskFlow id="taskflowdefinition1"
              taskFlowId="/WEB-INF/task-flow-definition.xml#task-flow-definition"
              activation="deferred"
              xmlns="SR1322581336237" >http://xmlns.oracle.com/adf/controller/binding"/>


Here you need to use the value of taskFlowId for the permission name.

14. Execute the page home.jspx

15. Click on the commandLink
Notice that the tab changes to Tab 2 as expected

16. Change back to Tab 1

17. Click on commandLink again
notice that it no longer changes tabs

Cause

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