This discussion is archived
2 Replies Latest reply: Jan 4, 2013 9:50 AM by Invinceable (Vince) RSS

UI Shell - TabContext.setMainContent Parameters

Invinceable (Vince) Newbie
Currently Being Moderated
Hi,
I need some help with a problem I'm having with the UI Shell.

To provide navigation, I use an af:tree object in the navigation facet. The tree object contains two types of data: Job Groups and Jobs. Each Job Group contains 1 or more Jobs. The selectionListener for the tree is mapped to method on a managed bean. When the user makes a selection, the method decides which taskflow to display based on the node type. I use the TabContext.getCurrentInstance().setMainContent() method to open the taskflow. I pass the following parameters:
1) the appropriate taskflow id to be opened
2) Map object containing application specific parameters. The Map object will contain a parameter named "selectedJobGroup" when a job group is selected. It will contain a parameter named "selectedJob" when a job is selected.

When I run the application, the first call to setMainContent() works as expected. Upon the second call, the content area is empty. When I look at the logs, I see the following message:
<MISSING_REQUIRED_PARAMETER> </WEB-INF/flows/scheduler/ViewJob.xml#ViewJob> selectedJob

When I select a job first, followed by a job group, I get the following message:
<MISSING_REQUIRED_PARAMETER> </WEB-INF/flows/scheduler/ViewJobGroup.xml#ViewJobGroup> selectedJobGroup

I am using J Developer 11.1.1.6.0 and testing on the IntegratedWebLogicServer.

Thanks in advance.

Edited by: Invinceable (Vince) on Jan 3, 2013 8:35 AM
  • 1. Re: UI Shell - TabContext.setMainContent Parameters
    Frank Nimphius Employee ACE
    Currently Being Moderated
    Hi,

    did you mark both parameters as required ? If so then a missing parameter will lead to this error. What I would do in this situation is to use two parameters as follows

    - task flow type : values are jobType and jobGroup
    - the second parameter then would be the valueId: Here you either pass the value of the jobType and jobGroup

    This way you can always pass the parameters to the task flow so that a required parameter doesn't hurt.

    Frank
  • 2. Re: UI Shell - TabContext.setMainContent Parameters
    Invinceable (Vince) Newbie
    Currently Being Moderated
    Frank thanks for your reply.

    I tried your idea. I first tried passing in the Job or JobGroup selected as the second parameter. However that doesn't work because setMainContent requires a Map as the second argument.

    I then tried putting the Job or JobGroup into a Map. If the user selects a Job I put that Job into the Map with key value of "selectedValue". Likewise, when user selected a JobGroup, I put the JobGroup into a Map with key value of "selectedValue". The error no longer occurred. However, the value in the pageFlowScope.selectedValue inside the task flow is always set to the first item selected. For example if a user starts out by selecting a job named "Jobxyz", the correct "Jobxyz" object was in the pageFlowScope.selectedValue. Subsequently, when the user selects a job named "Job123", the value in the pageFlowScope.selectedValue is the "Jobxyz" object. This also happens when I move between job groups and jobs. It's always the first value selected that makes its way to the pageFlowScope.selectedValue.

    Do I need to somehow reset the Map that the UI shell uses for passing in task flow parms?

    Thanks

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points