X

Shay Shmeltzer's Oracle Development Tools Tips

  • January 10, 2011

Passing Parameters to an ADF Page through the URL - Part 2.

Shay Shmeltzer
Director of Product Management - Oracle

I showed before how to pass a parameter on the URL when invoking a taskflow (where the taskflow starts with a method call and then a page).

However in some simpler scenarios you don't actually need a full blown taskflow.

Instead you can use page level parameters defined for your page in the adfc-config.xml file.

So below is a demo of this technique.

I'm also taking advantage of this video to show the concept of a view object level service method and how to invoke it from your page.

P.S.

You might wonder - why not just reference #{param.amount} as the value set for the method parameter? Why do I need to copy it into a viewScope parameter?

The advantage of placing the value in the viewScope is that it is available even when the page went through several sumbits. For example if you switch the "partialSumbit" property of the "Next" button to false in the above example - the minute that you press the button to go to the next department - the param.amount value is gone.

However the ViewScope is still there as long as you stay on this page.

Join the discussion

Comments ( 22 )
  • Jelena Sunday, February 6, 2011
    Dear Shay,
    First of all, thank you for good example!
    It says me, that you know a lot about passing parameters and task flows.
    Could you please, help me to understand how to implement a Task Flow, that consists of Method Call as an entry (that uses URL parameter UserId) and then Router that switch application to the Application Page or to the Message Page (tells that this user can't login).
    I already started, and am able to use dummy Method Call that returns one constant user id, but cant understand how to access URL parameter inside this method!
    Thank you in advance for your time!
    Jelena
  • shay.shmeltzer Monday, February 7, 2011
    Jelena,
    This entry shows how to have a taskflow with a method at the start that gets a parameter from the URL:
    http://blogs.oracle.com/shay/2010/10/passing_parameters_to_adf_appl.html
  • Casper Thrane Tuesday, March 8, 2011
    Hi Shay!
    Thanks for the demo! I have a question. Is it possible to convert the parameter "To Value" in expression language before it is handed over to my managed been?
    Br
    Casper Thrane
  • sat Sunday, May 29, 2011
    can you help me
    I am new to oracle ADF 11g .we are from oracle forms environment and now trying to redevelop our application in ADF 11g.
    I am searching one question on the web and unable to find best solution .Plz help me about this.
    My scenario is i have multiple forms on the same table having one flag(column) in table to differentiate data with each other.
    what will be the best way to implement it .
    one solution is i think to create individual view object with flag value in where clause and create pages for each.
    But i want to create a single page(as all have same functionality and similar data to insert ) and single EO and set value of that flag programmatic way based on user clicked on which link.
  • Shay Tuesday, May 31, 2011
    Sat - your scenario is not exactly clear to me - I would suggest posting this on the OTN discussion forum.
    Maybe what you are referring to is polymorphic VOs - see: http://download.oracle.com/docs/cd/E21764_01/web.1111/b31974/bcadvvo.htm#sm0515
    But it might be that your scenario is a lot simpler.
  • guest Tuesday, November 15, 2011

    Hi Shay

    Sorry for my English is the Google translate

    I have an application that contain an accordion control in the left slide of an splitter and a Panel Tabbed on a right slide, a wish to change the Panel Tabbed when a do a click on the ShowDetailItem property of the Accordion Control but a don’t know how do this, I want a menu accordion dynamic.


  • guest Tuesday, December 13, 2011

    Hi Shay,

    Is there a way to clean up the url of jsp page?

    For e.g :

    Currently my url is something like this: /MyApplication-ViewController-context-root/faces/sample?_afrWindowMode=0&param1=value&_afrLoop=1438133367660148&_adf.ctrl-state=16emihhfre_4

    I would like it to be just : /MyApplication-ViewController-context-root/faces/sample?&param1=value

    Can I remove these unwanted variables like _afrWindowMode, _adf.ctrl-state, etc.?

    Thanks,

    Sachin


  • Sachin Gupta Thursday, December 15, 2011

    Hi Shay,

    Any clues on the above query?

    Thanks in advance,

    Sachin


  • Tony De Buys Tuesday, January 14, 2014

    Hi there Shay,

    Nice idea, and I could possibly use this in a solution I have to come up with.

    The video on the page, however, is missing.

    We have to navigate to a specific page within our ADF application, for example. Open a product page with and show a product with a given sku.

    We are using 12c for this application. Does 12c have a better way of doing this? Is your approach better and/or can you recommend a better way of doing this?

    Thanks in advance


  • Shay Tuesday, January 14, 2014

    Tony - video is now back up on this page. This method should work in 12c as well.


  • Kaushik Thursday, December 18, 2014

    Hi Shay,

    when we run, we get a URL which is has lots of variables. Is there any way we can avoid it?

    Thanks,

    Kaushik


  • Shay Thursday, December 18, 2014

    Kaushik - this depends on which version of ADF you are running, newer versions have clean URLs - see https://blogs.oracle.com/jdevotnharvest/entry/pretty_url_in_adf_faces


  • Kunal Friday, June 3, 2016

    Hi Shay,

    Thank you for above detailed information.

    I am working on simple ADF page which is query-update. This page will be called from EBS and I need to pass EBS user_id, responsibility_id and Operating_unit parameters from EBS to ADF page.

    Can you help/guide me for this.

    Thanks,

    Kunal


  • Kunal Monday, June 13, 2016

    Hi Shay,

    Is it possible to pass URL parameter to VO bind Parameter. I have in requirement where I have to restrict initial page result set depending on URL parameter.

    Above information helped but I am not able to do similar thing with VO bind parameter.


  • Shay Shmeltzer Friday, June 17, 2016

    Kunal - same approach should work. Just set the value of the VO bind parameter in the binding tab to map to the viewScope parameter. (assuming you are using executeWithParams action)


  • guest Thursday, December 29, 2016

    Hi Shay,

    I have requirement to navigate from Oracle BI to ADF page(URL) with parameters.Please suggest me how to pass parameters from BI into ADF URL to invoke the ADF page.

    Thanks & Regards,

    Mahesh


  • Shay Shmeltzer Wednesday, January 11, 2017

    Mahesh - where is the challenge? If it is on the BI side and how to invoke a generic URL then ask on the BI forum.

    My solution doesn't care where the ADF app is being called from.


  • guest Wednesday, March 15, 2017

    i'm working on adf 12c...i'm redirecting the page to a new one...but the page contents does not get refreshed...they should as a new request hits the browser on redirecting...Also does it have to do something with url parameters..._adf.ctrl-state, _afrWindowID, _afrWindowMode, _afrLoop...

    Thanks in advance.


  • Shay Shmeltzer Wednesday, March 15, 2017

    guest - how are you doing the redirect? You should use the ADF controller to navigate between pages with actions - don't just use a URL hard coded behind a button.


  • Priya Thursday, May 31, 2018
    Hi Shay,
    Very nice feature. I am using Jdeveloper 11.1.1.9 and I tried this with a sample application. In my sample I am just showing the url parameters in the page itself. It works fine for normal url parameters like personId=1&displayName=Priya
    But it does not work for an encoded url which contains %26 for & %3D for =
    like personId%3D1%26displayName%3DPriya

    Is there a way to get parameters from an encoded url? because most of the external applications tries to hit ADF application with encoded url.

    As a temporary solution I am retrieving the query string from HttpServletRequest (from external context) and decoding using URLDecoder and parsing the parameters.

    kindly help.
  • smriti gupta Wednesday, June 23, 2021
    Hi Shay,

    I get below error while using #{param}..

    EL token 'param' is unknown; Reference "param" not found .Could you please help me on this .
  • shay Thursday, June 24, 2021
    Smriti - try posting your question on our forum with more info on what exactly you did and what error you got - https://community.oracle.com/tech/developers/categories/jdeveloper_and_adf
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.