Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Oracle Apex Dynamic Action on button

Posted on 2013-06-27
4
Medium Priority
?
4,271 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 375 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 375 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

670 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