Solved

Oracle Apex Dynamic Action on button

Posted on 2013-06-27
4
3,526 Views
Last Modified: 2013-07-21
I have a form page  (page 2) in an Apex App which is filled in periodically over time as events are actioned. When the whole task is complete, the user should click a button which automatically fills a couple of database items (also in the form, set as display only items) to indicate date completed and by whom. (app_user)

I have created a Button and a Dynamic action, but clicking the button causes the App to jump back to page one (a report with edit links to the form above). No fields filled or indeed anything saved..

Items:

P2_CLOSED_OUT  date
P2_CLOSED_OUT_BY varchar


Dynamic Action assigned to a button:

declare
    l_blank number;
begin
    case :P2_CLOSED_OUT
        when NULL      
-- set closed out items
             then :P2_CLOSED_OUT := sysdate;
                  :P2_CLOSED_OUT_BY := :APP_USER;
        else
-- already set, don't change
                  l_blank := 0;
    end case;
END;

don't mind if the button only performs this action, but if it can save the page as well then all the better.

Any pointers would be greatly appreciated !

thanks in advance
0
Comment
Question by:wspall
  • 2
4 Comments
 
LVL 1

Expert Comment

by:promisum
ID: 39281514
What is the "action" of the button.

It should say "Defined by dynamic action"

regards,
Richard
0
 

Author Comment

by:wspall
ID: 39292225
Hi Richard,

Sorry, haven't played too much with special actions/buttons to date.

Looks like the button I created was more of an "item" and hence didn't actually have the "Action when button clicked" properties. I have created a Region button instead now, have that property, but none of the options suggest "defined by Dynamic Action", only Submit Page, Redirect to page or Redirect to URL.

I had been stepping through the examples at http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/apex/r41/dynactions/dynactions.htm and have now discovered when the  "Defined by Dynamic Action" appears (under Creating a Dynamic Action on a Button section).

That being said still couldn't get the button to simply "set value" on two items and keep focus on the page, so I have created dynamic action on the fields in question. If there is a nice example to achieve my original objective I'd love to see it, I'm sure I'll be needing something like this in the future...

thanks again!
0
 
LVL 20

Assisted Solution

by:gatorvip
gatorvip earned 125 total points
ID: 39336604
clicking the button causes the App to jump back to page one (a report with edit links to the form above). No fields filled or indeed anything saved..

the user should click a button which automatically fills a couple of database items (also in the form, set as display only items) to indicate date completed and by whom. (app_user)


It sounds like you actually want the button to submit the page, but you're not choosing that action. You don't necessarily need a dynamic action anyway. Create a page process with the execution point on page submit, your button's action will also be Submit. In the process code, you put the code that you currently have in the dynamic action. You will probably want to add the insert code for the database table unless you already have that elsewhere.

After that, you have several options. If you want to stay on the same page, you can just create the post-submit branch to the same page.
0
 
LVL 1

Accepted Solution

by:
promisum earned 125 total points
ID: 39338381
If you want to prevent a URL from doing anything, you can give it a URL of "#"
Or something like "javascript: void();"

The DA on the item should still fire.

Start with a da that only executes a piece of javascript: "alert('yes');" You then can easily test if the DA is firing when you want it to.

Probably you might need to use a jQuery expression to get it to work.

Regards,
Richard
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Suggested Solutions

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now