About creating an AJAX page with DML procedures  using dynamic actions

About creating an AJAX page with DML procedures in APEX using dynamic actions. Help with limitations.
I want to share my experience, creating AJAX procedures in APEX 4.0.
LIMITATIONS
•     How Can I Hide UPDATE button while I press NEW button. ??
•     How Can I Hide CREATE button while I’m UPDATING A RECORD. ??
•     How can I avoid multiple Inserts or Updates. ??
Here are the steps to create an AJAX Updatable Form using the sample table DEPTS. You can see the demo here: [http://apex.oracle.com/pls/apex/f?p=15488:1]
1)     Create a blank page
2)     Add a Report Region for departments (It shows the columns deptno, dname and loc).
3)     Add an HTML Region and create the elements to edit a Department.
a.     P1_DEPTNO (Hidden to store PK)
b.     P1_DNAME (Text Field)
c.     P1_LOC (Text Field)
4)     You also have to create a hidden element called P1_ACTION. This will help to trigger dynamic actions to perform DMLs.
5)     Open Page Attributes and in the HTML Header Section include the following code.
<script>
     function doSelect(pId){
          $x_Value(‘P1_DEPTNO’,pId);
          $x_Value(‘P1_ACTION’,’SELECT’);
</script>
6)     Modify the column DEPTNO in the report, to add column link. In the link text you can use #DEPTNO# , in target you must select ‘URL ‘ and in the URL field write javascript:doSelect(#DEPTNO#);
7)     Create the following Buttons in the Form Region.
CANCEL     Redirects to URL: javascript:$x_Value(‘P150_ACTION’,’CANCEL’);
NEW          Redirects to URL: javascript:$x_Value(‘P150_ACTION’,’NEW’);
SAVE          Redirects to URL: javascript:$x_Value(‘P150_ACTION’,’UPDATE’);
CREATE          Redirects to URL: javascript:$x_Value(‘P150_ACTION’,’CREATE’);
8)     Create the following Dynamic Action to Select a Department
Name:     Select Dept
Event:     Change
Selection Type:     Item(s)
Item(s):     P1_ACTION
Condition:     equal to
Value:     SELECT
Action:     Execute PL/SQL Code
PL/SQL Code:     
SELECT dname, loc
INTO :P1_DNAME, :P1_LOC
FROM dept
WHERE deptno = :P1_DEPTNO;
Page Items to Submit:     P1_DEPTNO, P1_DNAME, P1_LOC     
Don’t include any false action and create the Dynamic Action.
The first limitation, the value of page elements don’t do refresh so I added the following true actions to the dynamic action AFTER Execute PL/SQL Code.
Action:     Set Value
Unmark *‘Fire on page load’* and *‘Stop execution on error’*
Set Type:     PL/SQL Expression
PL/SQL Expression:     :P1_DNAME
Page Items to submit:     (none) (leave it blank)
Affected Elements: Item P1_DNAME
Action:     Set Value
Unmark *‘Fire on page load’* and *‘Stop execution on error’*
Set Type:     PL/SQL Expression
PL/SQL Expression:     :P1_LOC
Page Items to submit:     (none) (leave it blank)
Affected Elements: Item P1_LOC
These actions allow refresh the items display value.
9)     Create the following Dynamic Action to Update a Department
Name:     Update Dept
Event:     Change
Selection Type:     Item(s)
Item(s):     P1_ACTION
Condition:     equal to
Value:     CREATE
Action:     Execute PL/SQL Code
PL/SQL Code:     
UPDATE dept SET
dname = :P1_DNAME,
loc = :P1_LOC
WHERE deptno = :P1_DEPTNO;
Page Items to Submit:     P1_DEPTNO, P1_DNAME, P1_LOC     
Don’t include any false action and create the Dynamic Action.
Include the following True Actions BEFORE the Execute PL/SQL Code true Action.
Action:     Set Value
Unmark ‘Fire on page load’ and ‘Stop execution on error’
Set Type:     PL/SQL Expression
PL/SQL Expression:     :P1_DNAME
Page Items to submit:     P1_DNAME
Affected Elements: Item P1_DNAME
Action:     Set Value
Unmark *‘Fire on page load’* and *‘Stop execution on error’*
Set Type:     PL/SQL Expression
PL/SQL Expression:     :P1_LOC
Page Items to submit:     P1_LOC
Affected Elements: Item P1_LOC
These actions allow refresh the items display value.
Finally to refresh the Departments report, add the following true action at the end
Action:     Refresh
Affected Elements: Region Departments
10)     Create the following Dynamic Action to Create a Department
Name:     Create Dept
Event:     Change
Selection Type:     Item(s)
Item(s):     P1_ACTION
Condition:     equal to
Value:     CREATE
Action:     Execute PL/SQL Code
PL/SQL Code:     
INSERT INTO dept(deptno,dname,loc)
VALUES (:P1_DEPTNO,:P1_DNAME,:P1_LOC);
Page Items to Submit:     P1_DEPTNO, P1_DNAME, P1_LOC     
Don’t include any false action and create the Dynamic Action.
Include the following True Actions BEFORE the Execute PL/SQL Code true Action.
Action:     Set Value
Unmark *‘Fire on page load’* and *‘Stop execution on error’*
Set Type:     PL/SQL Function Body
PL/SQL Function Body:     
DECLARE
v_pk NUMBER;
BEGIN
SELECT DEPT_SEQ.nextval INTO v_pk FROM DUAL;; -- or any other existing sequence
RETURN v_pk;
END;
Page Items to submit:     P1_DEPTNO
Affected Elements: Item P1_DEPTNO
Action:     Set Value
Unmark *‘Fire on page load’* and *‘Stop execution on error’*
Set Type:     PL/SQL Expression
PL/SQL Expression:     :P1_DNAME
Page Items to submit:     P1_DNAME
Affected Elements: Item P1_DNAME
Action:     Set Value
Unmark ‘Fire on page load’ and ‘Stop execution on error’
Set Type:     PL/SQL Expression
PL/SQL Expression:     :P1_LOC
Page Items to submit:     P1_LOC
Affected Elements: Item P1_LOC
These actions allow refresh the items display value.
Finally to refresh the Departments report, add the following true action at the end
Action:     Refresh
Affected Elements: Region Departments
11)     Create the following Dynamic Action to delete a department
Name:     Delete Dept
Event:     Change
Selection Type:     Item(s)
Item(s):     P1_ACTION
Condition:     equal to
Value:     DELETE
Action:     Execute PL/SQL Code
PL/SQL Code:     
DELETE dept
WHERE deptno = :P1_DEPTNO;
Page Items to Submit:     P1_DEPTNO
Don’t include any false action and create the Dynamic Action.
Include the following True Actions AFTER the Execute PL/SQL Code true Action.
Action:     Refresh
Affected Elements: Region Departments
Action:     Clear
Unmark ‘Fire on page load’
Affected Elements: Items P1_DEPTNO, P1_DNAME, P1_LOC
12)     Finally Create the following Dynamic Action for the NEW event
Name:     New Dept
Event:     Change
Selection Type:     Item(s)
Item(s):     P1_ACTION
Condition:     equal to
Value:     NEW
Action:     Clear
Unmark *‘Fire on page load’*
Affected Elements: Items P1_DEPTNO, P1_DNAME, P1_LOC

I need some help to solve this issues
•     How Can I Hide UPDATE button while I press NEW button. ??
•     How Can I Hide CREATE button while I’m UPDATING A RECORD. ??
•     How can I avoid multiple Inserts or Updates. ??

Similar Messages

  • Create community and pages with my application

    Hello,
    Can I automatically create community and pages with my application?
    Where can I find an example to create an java application to automatically create community, pages and Portel using an XML file that describes the structure?

    Hello,
    Can I automatically create community and pages with my application?
    Where can I find an example to create an java application to automatically create community, pages and Portel using an XML file that describes the structure?

  • Can we create Interactive forms only with ABAP & without using GP,  or Java

    Hi,
    I would like to know if we can create Interactive forms only with ABAP & without using GP or Java. We want to develop an offline solution using Interactive forms, but would like to use only ABAP for creating the forms. All the documents so far either refer to creating the forms, in reference to / in sync with: ISR (Service Requests), GP (General Procedures) or Java. Can this be done with ABAP alone?
    Regards,
    Ramesh
    Edited by: Ramesh Nallabelli on Apr 16, 2008 12:02 AM

    Hello Ramesh,
    You should be able to create Adobe Interactive Forms using only the ABAP stack (without GP, Java, etc). Please refer to the thread below. Hope it helps.
    Re: help for-offline interactive forms based on sending receiving mails in ABAP
    Regards,
    Rao

  • How to use dynamic action to fill multi item on a page ?

    Hi..
    I want to fill multi items on a page so I build a dynamic action ( Execute PL/SQL Code ) to do it .The problem is that when the page loads I can't see any data and I tried to see the session values using debug and I found data. Moreover when I save the row I got these data saved.
    So what is the magic there?
    Thanks

    Firstly, to get the multi-select populated with "pre-selected" values the easiest approach is to use Computation or Process at a process point On Load Before Header or After Header or Before Regions.
    All you need to do is populate your "Select List " page Item with : (colon) separated list of selected values. E.g is you want A,B and C out of A,B,C,D,E selected then get A:B:C into the Page Item.
    If you have used Dynamic Actions, what is your event on which the action fires? For Dynamic-Actions the page (HTML DOM) needs to be existing , so it must fire after the page has loaded.
    Regards,

  • CS 4 Dynamic Link to Encore doesn't work most of the time.  Encore stops operating after opening and periodically Premier Pro stops working.  I'm told that there has been a problem with CS4 when using Dynamic Link to go to Encore and build CD's.  Is there

    CS 4 Dynamic Link to Encore doesn't work most of the time.  Encore stops operating after opening and periodically Premier Pro stops working.  I'm told that there has been a problem with CS4 when using Dynamic Link to go to Encore and build CD's.  Is there a way around this?  Is there a patch to correct it?

    To build CD's???
    What problem does Encore have with DL?
    If DL is not working properly for you the way around this is to export from Premiere to either mpeg2-dvd for DVD or BluRay H.264 for BD-disks and import the files in Encore.

  • What is the best qay to create a simple page with three textbox fields

    Hi
    I try to create a Portal page for Password change.
    At first look, I taught that to create that basic page will be easy as one, two , three.
    Unfortunately not.
    I need to create three textbox and include pl/sql validation agains our BD.
    I usually work with a form base on procedure whose contain htp.package procedure
    to create a portal page when that form is called. (Base on the way where Portal manage his own change password page.)
    I try to get a better design of the page.
    Where I get all the information about that package ? I want to center the page.
    Oh yeah, I'm a newbie in html.
    Any ideas will be appreciate
    Thank
    Regis

    Hi,
    You could create a FORM with non base table fields. You could then validate the values on SUBMIT (say through a button) and then do whatever processing,redirection needs to be done.
    Or
    you could create a DYNAMIC PAGE with all html fields and proper alignments etc and on form submit do the relevant processing.
    Thanks,
    Anu

  • How do I create a new page with the existing layout of the one I've already created?

    Okay, I'm extremely new to DreamWeaver, just an FYI. I've been commisioned to develop a site for a company. There will be like 10 pages total on the site. I've created the home page, and I'm now attempting to make the second one. But I don't know how I can take the basic layout I created in the home page so I can add information for the other pages later. I tried saving as template, but I had to create editable regions and those got in the way. I even tried copying all the code from the original, but then the Spry menus won't work properly. I hope I conveyed my problem correctly. Any assistance will be more than helpful.
    Thanks.

    There are basicly two methods, firstly the template method you have already tried, and secondly the "includes" method. Some people use one or the other, some people mix the two. I use only the includes method.
    The includes method can be done in several ways. The PHP language has it's own method of doing includes. That's what I ususally use. You can also use the SHTML method. With the SHTML method, the material you wish to include is put in a normal HTML file, then in the file where the include will be put, it is done like this:
    <!--#include virtual="../includes/banner.html" -->
    . . .and the pages/files must have the shtml suffix, not html. That informs the server that yo are using server script in the file.
    I don't use Spry menus (or spry anything) so I can't suggest a reason you encountered a problem with it.

  • Can not create template based page with customized page type.

    I built a customized page type (with persepective attribute) and wanted to build pages with this type. If the new pages do not based on any template, it works fine. However, if I wanted to use a template, the page type was set back to "standard"!
    Steps to reproduce it:
    1. create a new page type - test page type.
    2. create a new template = test template.
    3. create a new page - test page.
    3.1 choose the page type to be "test page type"
    3.2 fill in the form including the new attribute info.
    3.2 choose the page template to be 'test template"
    3.3 click finish
    4. click the properties of "test page", it shows that the page type is "standard" and the new attribute information is gone!
    If in step 3.2, no template is chosen, the properties of the new page shows the page type is "test page type".
    I tried to find a workaround.
    1. create a page with "test page type".
    2. covert the new page to template.
    I got this error message:
    Error while copying page. (WWC-44262)
    (WWC-00000)
    Looks like customized page type and template can not coexist. Is this a bug?

    How long should the upgrade take? And should it be attempted on a production (infrastructure on machine 1/middle-tier on machine 2) Windows 2000 architecture? Or should be wait for 9.0.4? Or ... should I ask this in a TAR? Thanks!
    Mike

  • Create a login page with NI Security Programmatic Login.vi

    Hi everyone,
    I'm trying to create a login page that inputs username and password of users, then authorize user information with the Domain Account Manager to recognize user identification.
    I google and see the NI Security Programmatic Login.vi can allow me to create a login page and it works. However, I got a problem is to redirect to other pages after authorizing. 
    NI Security Programmatic Login.vi only outputs some string to show the status of the authentication, it doesnt output boolean like true or fall.
    Does anyone has a solution to help me?
    Thank you.
    This is my screen shot:

    Thank you for suggesting me. I've done the checking task but I don't know how to call a subVi.
    As you can see in the images I post below, I have a login page with its diagram, and the main page that I want to show after logging in conrrectly.
    So should the main page is the subVi or the login page? And can you tell me how to show the main page after logging correctly?
    I also don't know how to refresh the page if logging information is incorrect. Do you have any solution?
    Thank you so much.

  • How can I create a Login-page with jsp???

    Hello,
    I have to create a page with JSP code on the Netweaver Developer Studio.
    But I do not know how I do it.
    Can anyone tell me what to write in the portalapp.xml?
    An example would be very helpful.
    Thank you
    Greetings

    As you can see in the example:
    The portalapp.xml file (deployment descriptor) provides configuration information for your application, and defines the components and services in your application. For each component and service, you specify the implementing Java class and configuration information.
    For more information on the format of the portalapp.xml, see Deployment Descriptor (portalapp.xml).
    <application>
        <application-config>
            <property name="SharingReference" value="com.sap.portal.navigation.service, com.sap.portal.navigation.api_mimeservice, com.sap.portal.navigation.helperservice"/>
            <property name="Vendor" value="MY_COMPANY"/>
            <property name="SecurityArea" value="PERMISSION"/>
        </application-config>
        <components>
            <component name="SimpleNavigationExample">
                <component-config>
                    <property name="ClassName" value="MY_CLASS"/>
                    <property name="SecurityZone" value="no_safety"/>
                </component-config>
                <component-profile/>
            </component>
        </components>
        <services/>
    </application>
    You can only update in this example, your class name and other details:
    <property name="Vendor" value="sap.com"/>
    <property name="SecurityArea" value="MyCompany"/>
    <property name="ClassName" value="LOGINCLASS"/>
    <property name="SecurityZone" value="no_safety"/>
    Modify this portalapp.xml file as follows:
           1.      NAVIGATION SERVICE, so you must add references to the following portal applications that define these services:
            com.sap.portal.navigation.service
            com.sap.portal.navigation.api_mimeservice
            com.sap.portal.navigation.helperservice
           2.      In the <application-config> section, create the following properties that help to define the security zone for all components and services in this application:
    ○     Vendor: String identifying the company or organization that provided the application, for example, sap.com.
    ○     SecurityArea: String identifying the security area for the application, for example, NetWeaver.portal.
           3.      In the <component-config> section for the mySiteMap component, create the property SecurityZone to define the specific security zone for the component.
    For Permission, check this document:
    http://help.sap.com/saphelp_nw04s/helpdata/en/44/489e2df5ee4e35e10000000a1553f6/frameset.htm

  • Is it possible to create a subscription page with different options for blog, newsletter, product announcements, training events, etc?

    I would like to create a subscription page for my Muse site with different subscription choices, but I am not sure if it is possible or, if it is how I should construct it. Any ideas?

    Hi
    This can be done from hosting platform end. If you are using Business Catalyst to host your site , then you can use events module, campaign subscriptions , secure zone subscriptions etc.
    You can create the events/announcements on BC end and then add the module in Muse page which on publish will show the modules on page.
    Thanks,
    Sanjit

  • Creating an HTML page with an embedded image in JAVA

    is it possible to have a code in java that creates an HTML page,
    reads an image file and embeds this to the HTML page?
    can anyone give me a sample code? =)
    thank you very much!

    Just tried this out, and it doesn't do what I was hoping: embed the image into the HTML document as a byte stream, so that the HTML document will display the image, without a seperate file.
    When I did:
    import java.io.*;
    public class EmbeddedImageTest {
        public static void writeHTML(String htmlfile) {
            File htmf = new File(htmlfile);
            FileOutputStream fout;
            DataOutput dout;
            try {
                fout = new FileOutputStream(htmf);
                dout = new DataOutputStream(fout);
                dout.writeBytes("<html><head></head><body><img src=" +
                    "file:/C:/image.jpg></body></html>");
            catch(IOException ie) {
                ie.printStackTrace();
        public static void main(String[] args) {
            writeHTML("c:/embeddedImage.html");
    }I just got an HTML file containing "<html><head></head><body><img src=file:/C:/image.jpg></body></html>".
    I've seen images get embedded in MS Outlook HTML e-mails. Does anyone know if this is done in a standard way (ie not through some MS-proprietary way), and if it can be done with an HTML file made by Java?

  • Is there any facility to create responsive html page with tools

    I create many html page is there any tool to create responsive page easilily. Check this sample page of msbte result here i coded manually i not found any buttons or option for it

    Dreamweaver CS6 and CC have a feature called FluidGrid Layouts for creating responsive web pages.
    CS6 Fluid Grid layouts (17 min video)
    http://tv.adobe.com/watch/learn-dreamweaver-cs6/using-fluid-grid-layouts/
    Dreamweaver CS6 and CC also support jQuery Mobile for building mobile phone apps
    Create & package Mobile app with DW, jQuery Mobile & PhoneGap
    http://www.adobe.com/devnet/dreamweaver/articles/dw-phonegap-mobile-app.html
    Adobe has another product for creating Responsive Layouts in a more visual interface (preferred by designers):
    Adobe Edge Reflow (preview)
    http://tv.adobe.com/watch/adobe-edge-reflow/introduction-to-reflow/
    Or you can jump start your web projects with any of the Responsive Web Design Frameworks below:
    Foundation Zurb
    http://foundation.zurb.com/templates.php
    Skeleton Boilerplate
    http://www.getskeleton.com/
    Initializr (HTML5 Boilerplate, Responsive or Bootstrap)
    http://www.initializr.com/
    DMX Zone's Bootstrap FREE extension for DW
    http://www.dmxzone.com/go/21759/dmxzone-bootstrap/
    Project Seven's Page Packs (Commercial Responsive CSS Layouts)
    http://www.projectseven.com/products/templates/index.htm
    Use whichever works best for your particular project.
    Nancy O.

  • How to create a home page (with flash images) in Oracle Portal  10g

    Hi,
    I want to create a home page in Oracle Portal 10g using flash images.
    How to create all those things ?
    Weather it should be created in pages or pagegroups or HTML portlet / some other.
    please help me.

    You can find in knowledge exchange a script to create an flash file item type. With this installed you can add a flash file to an item region on a page.
    Grtz,
    Dirk

  • Advice about creating a website(s) with a .Mac Account - Newbie

    Hello,
    I need some advice about creating a website with a .Mac Account.
    The Situation
    For my media course we need to create a short film, then brand it, and distribute it along with press releases and press packs. No other group have thought about setting up a website - where it has all the company details, info about the Cast, Crew, Film, and maybe a link to the finished product.
    The Problem.
    I'm the only one who has an Apple Laptop. We don't want to use the computer at the university as A LOT of students use them and every month or so they're given a clean install.
    I've designed my own 'virtual series' website to showcase my screen writing work, but I haven't uploaded it. I was waiting until I finish university in the summer before I activated my 1 year .Mac Account. I have a .Mac Account, which has still got to be activated.
    How do i go about creating my 'video production' site, if I've already got my own created and sitting in iWeb?
    How could I just 'launch/upload' my 'video production' site without putting my own up as well?
    Should we buy a separate .Mac Account?
    Oh, and what would the address be, so that we can put them on business cards.
    THANKS for any and all help.

    Lots of questions... you've come to the right place!
    Here are some links that might be helpful to you:
    http://web.mac.com/varkgirl/iWeb/iWebFAQ
    http://web.mac.com/mark8heaton/iWeb/DomainSeparation/SiteSeparation.html

Maybe you are looking for

  • OTM: OpenScript fail due to

    Hi, When I run an OpenScript in OTM it fails even though it runs fine in OOS. OTM gets as far as logging into PeopleSoft, but no further. The script was created using FT-Oracle EBS/Forms. According to the ResultsReport: Object not found: /web:window[

  • Tabstrip with editable ALV:  change tab - modification lost

    Hi, I will first try to describe the situation that I am having: I have a screen with on it various tabstrips using CL_BUS_TABSTRIP etc.  Each tabstrip has it's specific editable ALV grid.  (CL_GUI_ALV_GRID) Now, the data changed event gets triggered

  • Accessing properties of multiple graphs

    Hello, I have a VI with over 100 different graphs.  And many times, I want to access a property node for each one, and make the same changes.  How would I set up a "For" loop that will cycle through each graph?  I see that one is named xy graph 1, xy

  • Webdynpro - how to add global variables and common proj to existing proj

    How to add global variable in either ViewController or CustomController.  We realise that codes must be added within the begin and end exction.  Codes outside that will be deleted when saved.  How can we add a common WDP project to an existing projec

  • Mac Mail drafts don't appear in Gmail and vice-versa. HELP??

    When I start writing a message in Mountain Lion's Mac Mail and save it as a draft, it appears locally, but not on Gmail or iOS Mail. It does however appear in imap/[draft] on Gmail and I cannot edit it. Messages that are drafted in Gmail or iOS Mail