Article not saved when the item is in a modal dialog box of jquery

Hi all


I followed the instructions here:
http://shijesh.WordPress.com/2010/04/10/jQuery-modal-form-in-Apex-4/
to create a modal jquery dialog, this is the code that I added in the html header:
<link rel="stylesheet" href = "http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/
redmond/jquery-ui.css" type="text/css" />

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"> </script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.js"> </script>
<script type="text/javascript">
$( function() {
   $('#ModalForm').dialog(
   {
        modal : true ,
        autoOpen : false ,
        width : 425,
        closeText : 'Close',
        stack : false,
        resizable : false,
        buttons  : {
            Cancel : function() {
                     closeForm();
                } ,
            Save : function() {
                updateMEMOVELD();
            }
                   }
   });
});

function openForm()
{
    $('#ModalForm').dialog('open');
}

function closeForm()
{
    //$('#ModalForm input[type="textarea"]').val('');
    $('#ModalForm').dialog('close');
}

function updateMEMOVELD () 
{
   var get = new htmldb_Get(null, &APP_ID.,    
                    'APPLICATION_PROCESS=f_memo', 0);
   get.add('P9_MEMOVELD',$v('P9_MEMOVELD'));
   var gReturn= get.get();
   //alert(gReturn);
   //alert($v('P9_DATUM'));
  $s('P9_MEMOVELD',gReturn);
  alert($v('P9_MEMOVELD'));
  $s('P9_MEMOVELD_COPY',$v('P9_MEMOVELD'));  
  $('#ModalForm').dialog('close');
}
</script>
my situation is a little different, my modal doesn't have to perform a sql update, just to change a field
the user will then record in the main form
for some reason any field never gets updated in the db
I even created an application on the application called f_memo process:
BEGIN
  APEX_UTIL.SET_SESSION_STATE('P9_MEMOVELD',:P9_MEMOVELD);
  htp.p(:P9_MEMOVELD);
END;
Why my domain is not send to the db?
It works when I remove this from the header of the region:
< d i v id="ModalForm" title="Add Person" style=" d isplay:n one  "   >
but then of course I have more a modal dialog box



What's wrong?


I put the code online at apex.oracle.com
workspace XONIXRS
login/password demo/demo
Run the application
Click lijst (invoices) without (in the region of the right sidebar)
Then click on the button Search (search)
a report is displayed, click on edit on the first line (200900017)
now, a form appears, click the memo of pure and simple button
now the modal shows upward, change the field and click Save
Click ok (for warning) and then click on save the invoice
you stay on the same page
Now click on town
and then click on edit on the first line (200900017) new
then click on note even once, you will see that the memo has not been changed

How comes?

KR
Martin

The problem is that the creation of a region of a modal rise this area of the html code. Take a look at the DOM when you run your page and not the html source code, because that does not reflect the changes to the DOM is the loading of the page. This means that your memo field is far from the FORM tags and actually only submit to the session state. The issue is not addressed when you send page! You can follow through your debugging page. Memo is not saved and untreated.
Try saving the value of session state is not enough, it does not really matter in this case. The time that you submit the page, session state is crushed by the submitted values of the elements.
So what I did:


  • Move P9_MEMOVELD to the FACTUUR region, as well as all other db fields

  • change the type of hidden

  • the protected value not

  • in modal region to create a new page P9_MEMOVELD_POP, type textfield element

  • Set the source to always use a page element as a source, with the source P9_MEMOVELD

  • change of function updatememoveld:

    function updateMEMOVELD ()
    {
       /*
       var get = new htmldb_Get(null, &APP_ID.,
                        'APPLICATION_PROCESS=f_memo', 0);
       get.add('P9_MEMOVELD',$v('P9_MEMOVELD'));
       var gReturn= get.get();
       //alert(gReturn);
       //alert($v('P9_DATUM'));
      $s('P9_MEMOVELD',gReturn);
      alert($v('P9_MEMOVELD'));
      $s('P9_MEMOVELD_COPY',$v('P9_MEMOVELD'));
      */
      $s('P9_MEMOVELD',$v('P9_MEMOVELD_POP'));
      $('#ModalForm').dialog('close');
    }
    

    If you want or need the session state as a whole belongs to you, it depends on if you are using this also dynamically on the page and therefore to influence results, but I don't think it will be (it's a Memo field...)



Additional notes:

  • Be careful with the jquery libraries! The standard libraries are included, but you add previous versions too! 1.4.2 this could cause problems of...

  • Use your models better. Why did you would wrap a region in the div tags? Change or add a model of region to be DIV tags You can then easily assign a static id in this region and target. This will save you from enveloping the wrappers wrapped (cause it is what looks like the code that is generated in the end).

Tags: Database

Similar Questions

  • Returning from universal theme item values - form Page (modal dialog box)-

    Hello

    I use the universal theme - modal dialog (the form page, page 7) and intend to return several values of the item to the page back 2 when the dialog box is closed.

    I'm back from the point values P7_DNAME & P7_DEPTNO of page 7 of the elements P2_DNAME & P2_DEPTNO on page 2 but does not work.

    Form Page - Page 7 (modal dialog box)

    Process - close dialogue

    Items to return - P7_DNAME, P7_DEPTNO (put several points of values here to go back to page 2)

    Report Page - Page 2 (that calls the page 7 of the modal dialog box)

    Here we have a dynamic Action. I use the event ""closed dialogue ' and 'Set value' action "

    Event (closed dialog box) -

    Action - set

    -Define (return goods of dialogue) - P7_DNAME, P7_DEPTNO Type

    -Selection Type (items) - P2_DNAME, P2_DEPTNO [here I am back to several items.]

    If I go back more than one Page values element, it doesn't any idea WHY?

    BUT if I'm back only a single value of point, there works perfectly well.

    Thank you

    Deepak

    You can return multiple items at once and their values are sent along, but you cannot set multiple items with different values by the action of a set value.

    You must create an action of the value set for each element you want to set the value with the value of the element to return.

  • Put the active table in respect of the development when the script was interrupted by a dialog box

    I adapted a script which browse tables in a file of Fm and asks the user if he wants the current to be reformatted or not active table

    I have not find a clean way to the table that is currently selected in the variable "tbl" or visible on the screen when the scripts sends a dialog box.

    The workaround I found is to launch a format on the table before sending the guest, in this case the table processing is apparent when the prompt arises.

    But I would like to have the visible table and avoid doing all the treatments on the table until the user has had a chance to respond to the prompt.

    I guess that there must be a method to draw the attention of the active window on an item that is selected in a variable?

    function ApplyTableFormat (doc)
    {
    If (doc.) ObjectValid())
    {
    var tbl is doc. SelectedTbl
    var tbltitle;
    var tblTextItem;
    While (tbl. ObjectValid())
    {
    tbltitle = "";
    tblTextItem = tbl. FirstPgf.GetText (Constants.FTI_String);
    for (var i = 0; i < tblTextItem.length; i ++)
    {
    tbltitle += tblTextItem [i] .sdata;
    }

    / * How my "tbl" visible in the window active doc? */
    If (Alert ("format:" + tbl.)) "Tbltitle + FirstPgf.PgfNumber + '? \nClick Cancel to abort. ((', Constants.FF_ALERT_CANCEL_DEFAULT))
    return;
    / * Insert here the table formatting code * /.

    TBL = tbl. NextTblInDoc;
    }
    }
    on the other
    {
    Alert ('no active doc', Constants.FF_ALERT_CONTINUE_WARN)
    return
    }
    }

    There is a document feature that allows to scroll the window to a location of particular text:

    doc. ScrollToText (textRange);

    You might be able to do something like this:

    doc. ScrollToText (new TextRange (tbl. TextLoc, tbl. TextLoc));

    -Rick

  • Not visible in the shared disk Cluster Storage Configuration dialog box

    When installing the 10 g to Oracle clusterware dialog "Cluster Storage Configuration" shows no shared disks.

    We use:

    Windows Server 2003

    HP Eva 4400

    Glad you liked the doc - Please feed back any info on the doc direct me

    they do not need to be logical for OCR devices and vote - I'm not 100% sure devices ASM - but a best practice is to create the logical volumes for all

    Philip...

  • Series HP Photosmart Prem C310: Scan option not available in the scanners on Mac and Printers dialog box

    I had a problem with my connection Wireless to my printer. I deleted my printer to my preferences system (Printers & Scanners dialog box) by mistake. I was able to add the printer to my Printers & Scanners using the IP address of the printer dialog. The work of connection to printer and I am able to print. However, I lost the option of detection (the Open Scan option does not appear in the Printers & Scanners dialog box). I installed a driver from Apple and I also installed a driver of HP. The driver available for my printer model appears to be a patch only.

    Here is a screenshot of my Printers & Scanners dialog. Before I deleted my printer, she had a scanning tab.

    I tried to find a full version of the HP software for the printer but fails.

    Hello

    By consulting the user guide once more tried to locate all the other parameters that may apply, I could personally find not 1 but of course there might be there... as any router have different options and many...

    Have you checked with your ISP that you have the latest firmware for your router? any update of the firmware can help a lot with this kind of questions.

    It is the only router, right? It has no additional effect as a range extender. etc?

    You get power from the strong wifi signal for your printer and computer?

    Please let me know the results with the USB for the moment, the software is there as we have strengthened it even installed earlier...

    Please keep me with any change, I'll try to think of other measures to try while waiting...

    See you soon,.

    Shlomi

  • Bindings.Size (ObservableList) is not updated when the item is deleted

    I have code like this:
              myLabel.textProperty().bind(new StringBinding() {
                   {
                        super.bind(Bindings.size(myList));
                   }
    
                   @Override
                   protected String computeValue() {
                        int s = myList.size();
                        return s + " item"+((s == 1)? "":"s") +" left";
                   }
              });
    When I run my application and load data in my list, via myList.setAll (otherList), I see the text of the label update.
    But when I call myList.remove (someItem) the text of the label is not updated.
    Am I missing something?

    Yes, the problem is that you have created a link (Bindings.size (myList)) but you never go to this link. This binding therefore will be cancelled once, and because it is never accessible, even once, it will become ever valid.

    Try this code instead:

         myLabel.textProperty().bind(new StringBinding() {
                    private IntegerBinding sizeBinding = Bindings.size(myList);
                   {
                        super.bind(sizeBinding);
                   }
    
                   @Override
                   protected String computeValue() {
                        int s = sizeBinding.get();
                        return s + " item"+((s == 1)? "":"s") +" left";
                   }
              });
    
  • When I click on an attachment in my direct mail, it does not download. The "Open" and "Save" and "Cancel" dialog box does not appear.

    I'm syill cannot download my attachments

    Don

    Hi Don,
     

    As this problem is specific to Live mail, I recommend you to post your query in Live Mail Forums for assistance on this issue.

  • Why my iPhone 5s will not appear in the import for lightroom 4.4 dialog box?

    My iPhone 5 s watch is more as an option for importing files in my library in the 'Import' of 4.4 Lightroom window. !

    Tried a different USB port and now detects. Thanks for the heads up deepakgahlot. Your question made me continue the investigation. Appreciate it. Have a great day!

  • State of the coast customer Pass to the modal dialog box

    Hi guys,.

    I would like to open a modal dialog box and change the value of a select list of the modal dialog box. I have to be able to switch the status of the customer value using apex.item("P1_DEPTNO").getValue (). The declarative method to use modal dialog boxes is to use a button and a link to the page, where everything is taken care for us, the value, the checksum for the protection of session state, etc..

    But sometimes we need to go on the side of current customer State the modal page, for example, while we are in the middle of creating a new row in a table... and the value is not yet stored in the database.

    So, how can we do this? By the way the page in progress and also variables to generate the control are appropriate for the items to be passed.

    Since there is no dynamic action to do this directly, I tried to attach a dynamic action to a button and run javascript to open the dialog box (https://docs.oracle.com/cd/E59726_01/doc.50/e39149/javascript_api.htm#AEAPI29504):

    var l_url="f?p="+$v("pFlowId")+":2:"+$v("pInstance")+"::::P2_DEPTNO:"+apex.item("P1_DEPTNO").getValue();
    alert (l_url);
    
    
    apex.navigation.dialog(l_url, {
        title:'About',
        height:'480',
        width:'800',
        maxWidth:'1200',
        modal:true,
        resizable:false },
        '',
        $('#EMP_REPORT'));
      
    
    
    

    Unfortunately, I get an error internal an error:

    2 request 157 dialog page cannot be returned successfully. If make sure that the template in use on page 2 is the type of model 'Page of dialogue', with the JavaScript dialog initialization appropriate, closing the dialog and dialog box cancel the code defined.

    I do not understand the error message since I use the theme 42 and the handling of the ordinary modal dialog box works.

    Would appreciate advice.

    See you soon,.

    ~ Dietmar.

    Hi Dietmar,

    you're always coming to these requirements of fancy...

    The following has worked for me in Chrome. But to test if it works in any browser.

    1. Describe your button as usual with a link to the page of the dialog box
    2. For example to set items , specify P7_CUSTOMER_ID as the name and ~ CUSTOMER_ID ~ as value. ~ CUSTOMER_ID ~ is our placeholder that will NOT get replaced by APEX. We use it in our JavaScript code.
    3. Set the static ID of your my_button button so that we are able to access in JavaScript
    4. In the run when the Page loads page level attribute, add something like
      var myButton$ = $( "#my_button" );
      myButton$.attr( "onclick", myButton$.attr( "onclick" ).replace( "~CUSTOMER_ID~", "' + $v( 'P2_CUSTOMER_ID' ) + '" ));
      

    The JS code above will replace your reserved space and turn the link into something like

    javascript:apex.navigation.dialog('f?p=73380:7:109940056598048::NO:RP:P7_CUSTOMER_ID:' + $v( 'P2_CUSTOMER_ID' ) + '\u0026p_dialog_cs=QxixrjW-ZGmCMXTNBPlITtOG_X3aShXqYmmaugetfJ8rYKRHHpJpeskKbIEO3qpqVIkX-dWYaqbZ0_AGq3ASTg',{title:'Sample Database Application - Customer Details',height:'480',width:'660',maxWidth:'1000',modal:true,dialog:null},'t-Dialog--wizard',$('#my_button'));
    

    Obviously, you will not be able to use the Protection of the Session State for the P7_CUSTOMER_ID dialog page item, so you set the page of dialogue level attribute Access Protection Page to the Unrestricted.

    The amount of control that see you in the URL is really just to protect the dialog box itself.

    Concerning

    Patrick

  • Helps the modal dialog box a value back to the calling page

    Greetings,

    Apex Version: 4.1.0.0.32


    What I'm trying to do is create a modal dialogue that is called from a form page. The user dialog box will report to IR which allow him to select a line and send a value of this line to a field of the calling page. I work in Firefox, but I get an error using IE 8. I hope that someone can show me why it does not work in Internet Explorer.

    Here's how I do it:

    Of the calling page:

    Created a button
    Action: Redirect URL
    Target URL: javascript:var rc = window.showModalDialog ('f? p = & APP_ID.:70: & SESSION.: & DEBUG.:', ",'resizable: Yes;) Center: Yes; dialogWidth:1000px; dialogHeight:500px ;') ;


    On the page called:

    The called page is an IR report where the query returns this as one of the columns:

    * (Note: I had to put a point '.' before the onclick so he could show in this thread.) It is not there in my actual code.) *
    select
    <a href="#" name="z" style="color:blue; text-decoration:underline;" .onclick="javascript:passBack(''' || LOT_NO ||''');">Select</a>' SelectThis
    , column1
    , column2
    from sometablename;
    This solves the anchor:
    <a .onclick="javascript:passBack('232158');"  href="#">Select</a>
    Here is the function Javascript is called the anchor onclick:
    function passBack(passVal1)
    {
      opener.document.getElementById("P75_ITEM1").value = passVal1;
      close();
    }
    When I run the present in Firefox, it works as expected. I click the button on the parent page. The modal dialog box is open and the report of the IR is displayed. I click on one of the links in the report and it returns the correct value to the appellant and closed page modal dialog box.

    When I run it in IE8, it fails. I click the button on the parent page. The modal dialog box is open and the report of the IR is displayed. I click on one of the links in the report and I get this error: 'opener.document is null or not an object ".

    I hope that it is clear and that someone can help.

    Thank you

    Larry

    A quick google search determines that window.opener does not exist when you use window.showModalDialog

    Range of suggestions to use window.open instead of window.showModalDialog to use instead of window.opener dialogArguments

    Try the following:

    The parent page to define a getPopupValue() function:

     function getPopupValue(){
       var dr =  window.showModalDialog('f?p=&APP_ID.:70:&SESSION.::&DEBUG.:::','','resizable:yes;center:yes;dialogWidth:1000px;dialogHeight:500px;');
    
        if ( (dr != undefined) && (dr != '') && (dr != false) ){
         $x("P75_ITEM1").value = dr;
        }
     }
    

    Change the url of the button to call the function:

     javascript:getPopupValue(); 
    

    On the popup page change the valve function for:

    function passBack(passVal1)
    {
      returnValue = passVal1;
      close();
    }
    
  • How not to display the item to delete when an application icon is selected

    Menu items should be indicated when the application icon is selected and you click on the menu button. The delete element will be shown for some application and application is deleted after selecting the element removed. But for some applications, delete it the article does not appear when the application icon is selected and you click on the menu button. We want to protect our application which cannot be deleted when our application icon is selected and you click on the menu button.

    Who knows how do not show don't delete the article when an application icon is selected?

    Some applications that are part of the core OS can not be removed in this way (for example, help).  This applies however to Facebook.  He could have been driven out of your BES.

    There is no way to remove the delete option for a third-party application other than marking as required and pushing the BES.

  • Delete photos from my camera do not roll after the update to 9.3.1 IOS iphone 4s, also the photo has not saved when taken by camera

    Delete photos from my camera do not roll after the update to 9.3.1 IOS iPhone 4s, also the photo has not saved when taken by camera

    Mhefzi86 wrote:

    Delete photos from my camera do not roll after the update to 9.3.1 IOS iPhone 4s, also the photo has not saved when taken by camera

    OK, thanks for sharing.

    Maybe you can provide clarification comments on what happens when you try and what troubleshooting steps you did.

  • error message "coordinates would not be saved" when the contact info is correct.

    original title: error message

    "contact information could not be saved" when the contact info is correct.  Happens all the time on this computer

    You will need to create a new post on the Windows Live support for assistance site: http://windowslivehelp.com/forums.aspx?forumid=28aff142-9106-4d74-be08-9b5d9fc0efea

  • Change the listener not notified when the tree item is deselected

    I attach a listener to the selected index of the view tree selection model property to detect when a user selects or deselects on or other nodes in a tree, but it seems that the listener is not notified when the user deselects a node. So, if a user selects both nodes, and then while holding the CTRL + key deselects one of selected nodes the tree view control deselects the node, but the change listener is not notified. This is a bug or I do something wrong?

    I use the GA of JavaFX 2.1 on Windows 7 version.

    Thank you.
    Stefan

    Import javafx.application.Application;
    Import javafx.beans.value.ChangeListener;
    Import javafx.beans.value.ObservableValue;
    Import javafx.scene.Node;
    Import javafx.scene.Scene;
    Import javafx.scene.control.SelectionMode;
    Import javafx.scene.control.TreeItem;
    Import javafx.scene.control.TreeView;
    Import javafx.scene.image.Image;
    Import javafx.scene.image.ImageView;
    Import javafx.scene.layout.StackPane;
    Import javafx.stage.Stage;

    SerializableAttribute public class TreeViewSample extends Application {}

    rootIcon private final node = new ImageView)
    New Image (getClass () .getResourceAsStream ("Folder.gif"))
    );

    Public Shared Sub main (String [] args) {}
    Launch (args);
    }

    @Override
    public void start (point primaryStage)
    {
    primaryStage.setTitle ("Tree View sample");

    TreeItem < String > rootItem = new TreeItem < String > ("Inbox", rootIcon);
    rootItem.setExpanded (true);

    for (int i = 1; i < 6; i ++)
    {
    TreeItem < String > element = new TreeItem < String > ('Message' + i);
    rootItem.getChildren () .add (item);
    }

    TreeView < String > tree = new TreeView < String > (rootItem);
    tree.getSelectionModel () .setSelectionMode (SelectionMode.MULTIPLE);
    tree.getSelectionModel () .selectedIndexProperty () .addListener (new ChangeListener < number >)
    {
    @Override
    public void changed (ObservableValue <? extends number > ov, number oldIndex, number newIndex)
    {
    System.out.println ("selection changed.");
    }
    });

    Root StackPane = new StackPane();
    root.getChildren () .add (tree);
    primaryStage.setScene (new scene (root, 300, 250));
    primaryStage.show ();
    }
    }

    The value of the selected index does not change in these cases, because it reflects the last selected index (useful for single selection). It is not weird is possible to get a selected index which is not actually enabled (you can report a bug for this I think).

    However, if you want to keep track of the complete selection, try adding a ListChangeListener to the selectedIndices of the selection model. This one is triggered a change every time.

  • Table of contents, do not update when the project is saved

    The Table of contents is not save when the project is saved. To view the saved changes, I have to close and reopen.

    I'm sorry, so sorry. I forgot to add that my esteemed colleague and fellow Adobe Community Expert Peter Grainge has some fabulous on its site information if you go with merged WebHelp.

    Click here to see

    See you soon... Rick

    Useful and practical links

    Wish to RoboHelp form/Bug report form

    Begin to learn RoboHelp HTML 7 or 8 days - $24.95!

    Adobe Certified RoboHelp HTML Training

    SorcerStone blog

    RoboHelp EBooks

Maybe you are looking for

  • How to add "Look it up in lexicon" to the context menu?

    Hi all! The title says it is in fact... When I highlight a word in a text donnΘ, is possible to add an item to the context menu - > search in the lexicon or Contextual menu - > Services - > search in the lexicon (or whatever it may be called). I mean

  • Is it possible to launch and run a VI in a project from a simple icon?

    I am trying to launch and run a VI that must be opened with a project (a FPGA links, etc.) directly from Windows without having to open the project first, and then select the VI of the project.  Basically I want it behaves as if the code was deployed

  • PROBLEM TO DOWNLOAD WINDOWS 7 SP1.

    I TRIED TO DOWNLOAD WINDOWS 7 SP1, BUT THERE IS A PROBLEM. WHENEVER I TRY TO DOWNLOAD WINDOWS 7 SP1 A MS WINDOW SEEMS TO ME SAY I NEED TO VALIDATE BUT AFTER THE VALDATION DOWNLOAD WINDOW DON'T IS NOT DISPLAYED EVEN IF I LOADED WGA PLUGINS CORRECTLY.

  • What should I exactly to see foreign languages?

    When I visit a site containing Japanese character sets, I see are boxes that contain numbers.  I want to be able to see these characters properly for study. What Widget or the update module, exactly, do need me?

  • What is the best for your laptop: shutdown, standby, or hibernation?

    Original title: 'stop'? What is better for a laptop computer, stop every time, for sleep or Hibernate. It hurt to stop all the time.    Thank you Windows Vista