Solved

Oracle Apex Dynamic Action on button

Posted on 2013-06-27
4
3,871 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 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

Industry Leaders: 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

Suggested Solutions

Title # Comments Views Activity
make null the repeated levels 2 51
ORA-02288: invalid OPEN mode 2 130
subtr returning incorrect value 8 100
UTL_FILE invalid file operation 5 60
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.

752 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