7 Replies Latest reply: Jan 7, 2013 3:11 PM by Jothimoni RSS

    ADF Dynamic Regions with Parameter

    848013
      Hi,

      I am calling an ADF page built with dynamic regions from mutiple taskflows from an OAF page. I want to pass a parameter to the page and whenever a call is made, the page should open up and execute based on this parameter.

      My ADF page has 4 links at the left and each link will display different region on the right. Wheneevr i click on any link, it has to make use of the parameter value and execute the VO acordingly.

      Can we achieve this?

      Thanks,
      Lakshmi.
        • 1. Re: ADF Dynamic Regions with Parameter
          Navaneetha Krishnan Nataraj
          Have the dynamic region that loads the corresponding taskflow to have ParameterMap.

          <taskFlow id="dynamicRegion1"
          taskFlowId="${backingBeanScope.TestPageBean.dynamicTaskFlowId}"
          activation="deferred"
          xmlns="http://xmlns.oracle.com/adf/controller/binding"
          *parametersMap="#{backingBeanScope.TestPageBean.parameters}"/>*

          When reloading the taskflow, ensure that the necessary parameters are loaded into the taskflow.

          Check this example exactly based on your use-case:
          http://adfsampleapplications.googlecode.com/svn/trunk/TaskflowParamSampleApp.zip

          Thanks,
          Navaneeth
          • 2. Re: ADF Dynamic Regions with Parameter
            848013
            Hi navneeth,

            Where are you assigning the values to these parameters? In my case, i call the main page from OAF using a link. My ADF page should take the call and run the first region.

            Thanks,
            Lakshmi.
            • 3. Re: ADF Dynamic Regions with Parameter
              Navaneetha Krishnan Nataraj
              Hi,

              As you understand from the above post, the dynamic region has parametersMap configured in TestPageBean.

              <taskFlow id="dynamicRegion1"
              taskFlowId="${backingBeanScope.TestPageBean.dynamicTaskFlowId}"
              activation="deferred"
              xmlns="http://xmlns.oracle.com/adf/controller/binding"
              *parametersMap="#{backingBeanScope.TestPageBean.parameters}"/>*


              If you take a look at the TestPageBean, we have a class level variable named *parameters* and
              this is populated whenever the user clicks on any of the link - based on the task-flow parameters corresponding to the task-flow to be loaded.


              public void onRegion1Click(ActionEvent actionEvent) {
              this.setCurrentTaskflowId(taskFlowId1);
              this.parameters.clear();
              this.parameters.put("SampleTF1Param1", "Hello");
              this.parameters.put("SampleTF1Param2", "Good Morning");
              }

              public void onRegion2Click(ActionEvent actionEvent) {
              this.setCurrentTaskflowId(taskFlowId2);
              this.parameters.clear();
              this.parameters.put("SampleTF2Param1", "How are you doing");
              this.parameters.put("SampleTF2Param2", "Navakris!");
              }

              private HashMap parameters = new HashMap();

              public void setParameters(HashMap parameters) {
              this.parameters = parameters;
              }

              public HashMap getParameters() {
              return parameters;
              }

              On pageload, you would be using the taskflow1 in the dynamic region, ensure that the required parameters are populated - when the page is invoked.

              Thanks,
              Navaneeth
              • 4. Re: ADF Dynamic Regions with Parameter
                Shay Shmeltzer-Oracle
                Here is another option for passing parameters to an ADF page through the URL:
                http://blogs.oracle.com/shay/2011/01/passing_parameters_to_an_adf_p.html
                • 5. Re: ADF Dynamic Regions with Parameter
                  848013
                  Hi,

                  When i pass the parameter from Oracle EBS, i am having some text after parameter "216053?oas=g5NsRY1_fDtf9LmzwF-Y0w..". In this my parameter is 216053. why am i getting this text?

                  Also, if i use #{param.projectId} in my page, i am able to get the parameter value. If i copy the same to viewScope.projectId, i am not getting the default value.

                  The steps i followed:

                  1. dragged my page onto adfc-config.xml
                  2. set the page parameters as From: #{param.projectId} and To:#{viewScope.projectId0}
                  3. on my page dropped an output text1 and set the value to #{viewScope.projectId0}
                  4. on my page dropped another output text2 and set the value to #{param.projectId}

                  Output:

                  output text1 = <null>
                  output text2 = 216053?oas=g5NsRY1_fDtf9LmzwF-Y0w..

                  Thanks,
                  Lakshmi.
                  • 6. Re: ADF Dynamic Regions with Parameter
                    848013
                    I figured it..i have a separate field for parameters in EBS..

                    Thanks.
                    • 7. Re: ADF Dynamic Regions with Parameter
                      Jothimoni
                      Hi Navaneeth,

                      Thanks for your reply and the sample application. It actually helped me solve a very simple thing in passing the parameters to the Task Flow.

                      Thanks,
                      Jeba.