Friday 21 September 2012

Enable and Disable Page Item Using a Dynamic Action

                                                   Dynamic Actions provide developers with a way to define client-side behavior declaratively without the need to know JavaScript. Using a simple wizard, developers can select a page item, a condition, enter a value, and select an action (for example, Show, Hide, Enable, and Disable). Previously, this involved hand crafting JavaScript and AJAX but now many Dynamic Actions require zero coding using the built-in wizards.
                                                   In this topic, you create a dynamic action to enable the commission percentage item if the job is a sales job. If it is not a sales job, the commission percentage item will be disabled.
    From the Application page, Click Run Application.
    You want to filter just the employees who are in sales. Select the Job Id header and enter sa in the search field and select SA_REP.
    Select one of the edit icons in front of one of the rows.
    You want to create a dynamic action so that the Commission Pct is enabled when the job id is either SA_REP or SA_MAN. Click the Edit Page button in the Developer Toolbar.
    Right-click P2_JOB_ID and select Create Dynamic Action.
    Select Standard for the type of dynamic action and click Next.
    Enter Job is Sales for Name and click Next.
    Make sure Item(s) is set to P2_JOB_ID, select in list for Condition and enter SA_REP, SA_MAN for Value and click Next.
    Select Enable for the True Action and click Next.
    Select Item(s) for Selection Type, select P2_COMMISSION_PCT from the list of Item(s) and move it to the right and click Create.
    Your dynamic action was created successfully. Click Run.
    Notice that the Commission Pct item is enabled because the Job Id is set to Sales Representative (or SA_REP).
    Change the Job Id to a non-sales job, such as Programmer. Notice that the Commssion Pct item is now disabled. Click Edit Page in the Developer Toolbar. In the next topic, you create a new region and show/hide the region using a dynamic action.

No comments:

Post a Comment