Set ajax value to the textbox[in modal box jquery]

Hi,
In my page i have one interactive report with 2 button add and edit, i have used modal box j-query for the button add and edit. Adding the data through modal box working fine.
when tried to edit the existing data i am not able set the data to the corresponding textbox in apex.
please find my modal box script:
<link rel="stylesheet" href="#APP_IMAGES#modal-jquery-ui.css" type="text/css">
<script src=#APP_IMAGES#modal-jquery.js type="text/javascript"></script>
<script src=#APP_IMAGES#modal-jquery-ui.js type="text/javascript"></script>
<script type="text/javascript">
$( function() {  
     $('#ModalForm').dialog({       
          modal : true ,
width: 550,
height: 300,
          autoOpen : false,
resizable: false,
          buttons : {           
               Cancel : function() {               
                    closeForm();
               Add : function() {                    
                    addPerson();
$('#ModalForm1').dialog({       
          modal : true ,
width: 550,
height: 300,
          autoOpen : false,
resizable: false,
          buttons : {           
               Cancel : function() {               
                    closeForm1();
               Update : function() {                    
                    updateperson();
function openForm(){   
     $('#ModalForm').dialog('open');
function openFormclose(){   
     $('#ModalForm1').dialog('open');
alert('opened');
var updateval = document.getElementById('P37_UPDATEID').value;
var get = new htmldb_Get(null,html_GetElement('pFlowId').value, 'APPLICATION_PROCESS=updateperson',0);
get.add('P37_UPDATEID',updateval);
var gReturn = get.get();
alert(gReturn);
document.getElementById('P37_UPADATEPRONAME').value = gReturn;
function closeForm1(){   
     $('#ModalForm1 input[type="text"]').val('');
     $('#ModalForm1').dialog('close');
function closeForm(){   
     $('#ModalForm input[type="text"]').val('');
     $('#ModalForm').dialog('close');
function addPerson(){
     if (document.getElementById('P37_ADDSOFTDETAILS').value == ""){
          alert('Please Enter Software Details.');
          return false;
     if (document.getElementById('P37_ADDSOFTVERSION').value == ""){
          alert('Please Enter Software Version.');
          return false;
     if (document.getElementById('P37_STANDARD').value == ""){
          alert('Please Enter Software Standard.');
          return false;
          var ajaxRequest = new htmldb_Get( null , &APP_ID. , 'APPLICATION_PROCESS=addPerson', 0);
          ajaxRequest.add( 'P37_ADDSOFTDETAILS', $v('P37_ADDSOFTDETAILS'));
     ajaxRequest.add( 'P37_ADDSOFTVERSION', $v('P37_ADDSOFTVERSION'));
          ajaxRequest.add( 'P37_STANDARD', $v('P37_STANDARD'));
          ajaxRequest.get();
          ajaxRequest = null;
          closeForm();
          gReport.search('SEARCH');
</script>
and find the corresponding on demand process below:
addPerson:
DECLARE
BEGIN
INSERT INTO xxxxxx.yyyyyyyyyy (
INT_PRODUCT_SEQ,
INT_PRODUCT_NAME,
INT_PRODUCT_VERSION,
INT_PRODUCT_VERSION_DEFINE,
CREATED_BY,
CREATED_DATE
VALUES (xxxxxx.INT_ADD_SOFTDETAILS_SEQ.NEXTVAL,
:P37_ADDSOFTDETAILS,
:P37_ADDSOFTVERSION,
:P37_STANDARD,
V ('APP_USER'),
SYSDATE);
COMMIT;
apex_application.g_print_success_message := 'Record Inserted Successfully.';
EXCEPTION
WHEN OTHERS
THEN
apex_application.g_print_success_message := 'Falied to Inserted Data.';
END;
and updateperson: is
DECLARE
v_product_name varchar2 (240);
v_product_version varchar2 (240);
v_product_version_standard varchar2 (240);
v_update varchar2 (240);
BEGIN
BEGIN
SELECT INT_PRODUCT_NAME,
INT_PRODUCT_VERSION,
INT_PRODUCT_VERSION_DEFINE
INTO v_product_name, v_product_version, v_product_version_standard
FROM xxxxxxx.yyyyyyyyy
WHERE INT_PRODUCT_SEQ = :P37_UPDATEID;
HTP.prn (v_product_name);
EXCEPTION
WHEN OTHERS
THEN
HTP.prn( 'An error was encountered - '
|| SQLCODE
|| ' -ERROR- '
|| SQLERRM);
END;
END;

Hi,
First of all:
I can't find any definition of the function updateperson(); called in $('#ModalForm1').dialog - button Update.
There is alert('opened'); only. There should be declaration of the updateperson() function.
There isn't setting of the corresponding items when the update modal form opened.
I use it this way.
function openForm(v_add_details, v_add_softv, v_stand)
    $('#ModalForm').dialog('open');
    $s('P37_ADDSOFTDETAILS', v_add_details);
    $s('P37_ADDSOFTVERSION',  v_add_softv);
    $s('P37_STANDAR', v_stand));
}where the P12_X ... items are the modal form items. and the v_ ... parameters are the parameters of corresponding columns from report. (you have there something like: redirect to URL: javascript: openFormclose();
It should be changed to something like openFormclose('#P37_ADDSOFTDETAILS#', '#P37_ADDSOFTVERSION#', '#P37_STANDARD#');
Maybe this example will guide to you a little :D
otherwise try to reproduce your solution on apex.oracle.com. there i can modify your code to make it work.
EDIT: I use the PLUGIN posted by Denes. It works well too. I used above solution before the plugin was released.
regards
J :D
Edited by: jozef_SVK on 10.5.2013 4:07

Similar Messages

  • Need to set default values for the fields plant and location in ME21N

    Hi All,
    i need to set default values for the fields plant and location in ME21N tcode.
    In accout assignment if we give 'A' then we need to create asset by clicking the Asset tab,there you have the fields plant and location.
    How to resolve this?
    Thanks in Advance

    hi .
    i needed to set default strorage location and plant in personal setting  in me21n.
    i solve it with this way.
    go to program SAPLMEPERS in se38.
    create new function in output with the sample name :MODULE ZTEST_001 OUTPUT.
    in this module write:
    if MEPOITEM_PROP-WERKS is INITIAL and  MEPOITEM_PROP-LGORT is INITIAL.
    MEPOITEM_PROP-WERKS = '1000'.
    MEPOITEM_PROP-LGORT = '0032'.
    endif.
    this is the solution.
    best regards.
    maryam

  • How to set default values on the screen painter parameters?

    Hello ABAP Gurus,
    I would just want to ask how to set default values on the screen painter parameters.
    Thank you for your replies.

    Hi,
    To set default values for screen painter parameters initialize the field names with default values in the PBO module....
    say u have the field name as f_field1....
    in the PBO of that screen initialize it....
    f_field1 = '100'  "here 100 is the default value.
    <b>reward points if useful.</b>
    regards,
    Vinod Samuel.

  • Badi for setting default values in the transaction in APO.

    BADI NAME: SMOD_APOCF005 which is used for setting default values in the transaction.
    I have implemented the BADI using the below code but that BADI is not triggering. Please can you provide any solution for resolving this.
    As per my requirement I am trying to set default values for these three fields RRP_TYPE, WHATBOM, CONVH.
    DATA: LS_MATLOC LIKE LINE OF IT_MATLOC.
    LOOP AT IT_MATLOC INTO LS_MATLOC.
    LS_MATLOC-RRP_TYPE = '4'.
    LS_MATLOC-WHATBOM = '5'.
    LS_MATLOC-CONVH = '999'.
    MODIFY TABLE IT_MATLOC FROM LS_MATLOC TRANSPORTING RRP_TYPE WHATBOM CONVH.
    ENDLOOP.
    DATA: LS_MATLOCX LIKE LINE OF IT_MATLOCX.
    LOOP AT IT_MATLOCX INTO LS_MATLOCX.
    LS_MATLOCX-RRP_TYPE = 'X'.
    LS_MATLOCX-WHATBOM = 'X'.
    LS_MATLOCX-CONVH = 'X'.
    MODIFY TABLE IT_MATLOCX FROM LS_MATLOCX TRANSPORTING RRP_TYPE WHATBOM CONVH.
    ENDLOOP.

    The  BADI name: SMOD_APOCF005 .
    T.code at APO : /sapapo/mat1
    Once we enter in that T.Code with some Product and Location data.
    There under PP/DS tab.
    Under Planning Procedure there is a field PP Plng Procedure which I want to set as 4
    And under Order Creation there is Plan Explosion which needs to be set as 5
    And Under Horizons there is PP/DS Horizon which needs to be set as 999.
    BADi is implemented and active.
    And once the data is CIF from ECC to APO
    These default values are not set in the T code in APO and the BADi is not triggering.

  • Passing DB values to the textbox based on Select Value item

    Hi,
    I am very much new to the Oracle APEX. In my project, I have a requirement wherein I have to pass the different values to the corresponding textboxes on a different page based on the value I select from the "Select Value" item.
    I have tried using calling On-Demand Processes, but couldn't get the desired result.
    Please suggest!

    Hi 796444 ,
    Welcome to the forum. It will be good if you familiarize yourself with the forum ettiquittes. Also, when posting always state the following:
    a. Apex version
    b. DB version
    c. Web server ; EPG, apexlistener, etc
    d. Provide adequate details for others to understand your problem / what you are trying to achieve.
    e. Any code snippets you post should be enclosed in a pair of tags
    If your current problem is that the you are *calling* Page 2 from Page 1, and while doing so you want the value of P1_ITEM1 to be passed and set in p2_ITEM1 then
    a. Edit the branch
    b. In Action in Set these items write P2_ITEM1
    c. In With these values write &P1_ITEM1. (do not miss the dot at the end)
    It looks good if you use a better handle than 796444 :-)
    Regards,                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Setting Dynamic values to the payload-name / Content Desc

    Hi All,
    I am using a PayloadZIp module and i am trying to zip the file and retain the filename.
    For this i have done the following things. I have used PayloadZIp in the Sender channel. In the recv channel used the DynamicConfigurationBean and wrote the value as a part of message_interface and then using variable substitution i have configured made the filename as the sender name.zip
    for eg if the file zipped at the sender side is name1.txt the recv channel would be name1.txt.zip where the variable substituiton would have the value name1.txt
    but the problem is that the value of the file inside the zip is not name1,txt . I would like it to be name1.txt
    I have used the messageTransformBean and stuff tried setting the ContentTypes Desc all of them take constant values. i am not able to set the real filename as the filename for the attachment.
    Can anyone share their views on this and let meknow hw i can achieve this
    Rgds
    aditya

    Hi
    > I am using a PayloadZIp module and i am trying to zip the file and retain the filename.
    > For this i have done the following things. I have used PayloadZIp in the Sender channel.
    If you are trying to zip a file, then why are you using the PayloadZipbean on the Sender CC, you should use the module on the Receiver CC.
    > for eg if the file zipped at the sender side is name1.txt the recv channel would be name1.txt.zip where the variable substituiton would have the value name1.txt
    >
    > but the problem is that the value of the file inside the zip is not name1,txt . I would like it to be name1.txt
    >
    What file name are you getting now?
    have a look at this blog : http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=%28J2EE3417700%29ID0591392850DB01436613452367233705End?blog=/pub/wlg/5899
    Pooja.

  • URM How to set default value in the "New Check-in" - "Folder" field

    Hello everyone,
    I'm trying to find out how to set the default value for the "folder" field in a check-in profile created using the Configuration Manager. If I browse to the folder in the "Browse Content -> Folders" menu and check-in a file inside the folder, it will fill this field automatically. I need to replicate this behavior using the "New Check-in" drop-down menu and selecting a profile, in other words, associate a Folder with a check-in profile.
    I know it was possible to do so in previous versions using the folders_g component, but I'm unable to figure out how to accomplish it with the new FrameworkFolders component.
    Any help is greatly appreciated.
    Thank you.

    Hello,
    It is working fine try this.
    PARAMETERS :
    y_p_list TYPE char32  AS LISTBOX VISIBLE LENGTH 22
                                  MODIF ID rsg. .
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR y_p_list.
      MOVE: text-200 TO y_wa_listbox-field.
      APPEND y_wa_listbox TO y_i_listbox.
      CLEAR y_wa_listbox.
      MOVE  text-203 TO y_wa_listbox-field.
      APPEND y_wa_listbox TO y_i_listbox.
      CLEAR y_wa_listbox.
      MOVE  text-210 TO y_wa_listbox-field.
      APPEND y_wa_listbox TO y_i_listbox.
      CLEAR y_wa_listbox.
      MOVE  text-211 TO y_wa_listbox-field.
      APPEND y_wa_listbox TO y_i_listbox.
      CLEAR y_wa_listbox.
      MOVE  text-204 TO y_wa_listbox-field.
      APPEND y_wa_listbox TO y_i_listbox.
      CLEAR y_wa_listbox.
      MOVE text-205 TO y_wa_listbox-field.
      APPEND y_wa_listbox TO y_i_listbox.
      CLEAR y_wa_listbox.
      MOVE text-206 TO y_wa_listbox-field.
      APPEND y_wa_listbox TO y_i_listbox.
      CLEAR y_wa_listbox.
      MOVE text-207 TO y_wa_listbox-field.
      APPEND y_wa_listbox TO y_i_listbox.
      CLEAR y_wa_listbox.
      MOVE text-208 TO y_wa_listbox-field.
      APPEND y_wa_listbox TO y_i_listbox.
      CLEAR y_wa_listbox.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield        = 'FIELD'
          dynpprog        = sy-repid
          stepl           = 1
          value           = ' '
          value_org       = 'S'
          display         = ' '
        TABLES
          value_tab       = y_i_listbox[]
        EXCEPTIONS
          parameter_error = 1
          no_values_found = 2
          OTHERS          = 3.
      IF sy-subrc <> 0.
      ENDIF.
      REFRESH y_i_listbox.

  • How to set a value to the TextField on keyPress Event?

    Hai,
    I am using Jdev 11g.
    In my jspx page,i have an Input Text...I want to set a value to that input text when i press any button (say F2) inside that text field .I tried with clientListener and server Listener..But it is not set.
    In jspx page
    *========*
    <f:facet name="metaContainer">
    <trh:script>
    function onKeypressClientListner(evt) {
    var _txtField; var valueStr;
    _txtField = evt.getSource();        
    if (evt.getKeyCode() == AdfKeyStroke.F2_KEY) {
    valueStr = _txtField.getSubmittedValue()
    AdfCustomEvent.queue(_txtField,"onKeyPressServerListner",{payload:valueStr}, true); evt.cancel();
    </trh:script>
    </f:facet>
    <af:inputText label="Label 1" id="it1"
    binding="#{backing_CheckKeyPress.itxtInputText}">
    <af:clientListener method="onKeypressClientListner" type="keyUp"/>
    <af:serverListener type="onKeyPressServerListner"
    method="#{backing_CheckKeyPress.serverKeyListner}"/>
    </af:inputText>
    In CheckKeyPress.java
    *======*
    public void serverKeyListner(ClientEvent clientEvent)
    System.out.println("Inside Server Listener");
    itxtInputText.setValue("Hai");
    AdfFacesContext.getCurrentInstance().addPartialTarget(itxtInputText);
    After executing this,program will give output as Inside Server Listener . But the TextField value is not setting..

    I got it..Just set immediate property to true

  • Setting default values at the start of a process

    Hello
    I need to set some constant values to the attributes in data object as soon as start event of a process is triggered.
    How can I do that?
    Regards
    Vidyadhar

    Vidyadhar,
    Follow the below procedure to set Default Values
    1.Right Click on Start Event select Properties
    ->Goto Output Mapping Tab
    ->Double Click on Element on which you want to give Static Value
       and enter the value with double codes for eg: "Name"
    Make sure that this element value should be  has a Input to the next level.
    Thanks
    Srikanth

  • Setting Default Value to the Quantity Field in ML81n

    Hi Gurus,
    I have an assignment to set a default value of 1 to the quantity value when creating entry sheet. This is the process we go through before the point of setting the 1:
    1. Go ML81n and click on "Other Purchase Order" input some PO number and click enter.
    2. On the Menu --> Entry Sheet --> Create --> Empty Page
    3. At the bottom of the screen Click on "Service Sel", and click enter if a pop-up shows
    4. Now on the line item, select any row (1 or 2 or many). and Click on Services on top.
    So at this point when the new screen shows with the new Entry Sheet number, the line Items that comes up should all have a quantity of 1, and should be editable by the user before saving.
    How can i go about this. Which UserExit will do this or Enhancement Point. The screen field for this quantity is ESLL-MENGE.
    Thanks guys.
    Rewards, will be greatly reward.
    Edited by: Basil Balogun on Jul 7, 2008 11:03 PM

    Hi,
    Pls check out this Exit-
    package name ML-
    SRVESSR->EXIT_SAPLMLSR_010->Set Entry Sheet Header Data.
    For this in importing paramertes
    I _EKPO type EKPO in this we have MENGE field try to asign value 1 to this.
    First check the screen number of the popup screen for which you need to enter the MENGE valuein GUI status. Chck if this screen exit can be used by puting a break-point.
    And also try this screen exit for SRVEUSCR-
    EXIT_SAPLMLSR_020-Transfer of Data to Entry Sheet User Screen
    EXIT_SAPLMLSR_021-Adoption of Data from Entry Sheet User Screen
    SAPLMLSR-Screen exit at 0400 subscreen.
    Reward if helpful.
    Best Wishes,
    Chandralekha
    Edited by: Chandralekha on Jul 8, 2008 6:41 AM
    Edited by: Chandralekha on Jul 8, 2008 6:43 AM

  • How to set default values in the PO feilds

    Hello,
    Can please somone let me know how can I default a particular tax code "X" on a Purchase Order at the item level in the invoice tab..
    Any help would be greatly appreciated....
    Thanks

    Dear ,
    You can set it in the info record > Purchasing Organization data 1. In standard customizing,the default value for tax exist for LIV module in SPRO-Materials ManagementLogistics Invoice VerificationIncoming InvoiceMaintain Default Values for Tax Codes
    Regards,
    w1n

  • Getting the corresponding selected value in the textbox

    hi..
    i had a problem ,i had a jsp page ,with a selectbox and a textbox,the select box is getting the list of formnames from the database,and each form name has a corresponding code in the same table named form
    here thru mi program i m getting but i am connecting to the dtabase twice,is there any way to get the same...here is my code...
    <%@ page language="java" import="java.sql.*,java.util.*"%>
    <%
    Connection con=null;
    try
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    con=DriverManager.getConnection("jdbc:odbc:satya");
    Statement st = con.createStatement();
    ResultSet rs = st.executeQuery("select form_code,form_name from form");
    //System.out.println("Hashtable"+h.toString());
    %>
    <script language="JavaScript">
    function url()
    document.myform.action="http://localhost:8080/dynamic/servlet/Servlet1";
    document.myform.submit();
    function fn(code1){
    var code;
    var code2=code1.value+"code";
    //alert(code2);
    var str="document.myform."+code2+".value";
    code=eval(str);
    document.myform.forcode.value=code;
    </script>
    <form name="myform" method="post">
    <select name="selform" onChange="fn(this)">
    <% while(rs.next()){
    String name=rs.getString(2);
    String code=rs.getString(1);
    %>
    <option value="<%=name%>"><%=name%></option>
    <%}%>
    </select>
    <% rs.close();
    rs=st.executeQuery("select form_code,form_name from form");
    while(rs.next()){
    String name=rs.getString(2);
    String code=rs.getString(1);
    %>
    <input type="hidden" name="<%=name%>code" value="<%=code%>">
    <%}%>
    <input type="text" name="forcode">
    <%
    rs.close();
    catch(Exception e){
    System.out.println(e);
    %>
    <br><br>
    <input type="submit" name="Submit" value="create" onClick="url()">
    </form>
    </body>
    </html>
    can any one help me...........
    Thanks in advance

    I think you are submiting the Form Twice
    The first time when you Click the Submit Button, the second time in the url function
    you have to remove the OnClikc event from this Line
    <input type="submit" name="Submit" value="create" onClick="url()">

  • Setting components values in the ADF page load time

    Hi,
    We are trying to set the components labels dynamically, so each time the page is loaded we are loading the related labels from the database, instead of using the default database column names driven labels.
    We get the labels text okay from the database in the afterPhase method, but we do not have access to the output text UI items then, so a call scuh as this getOutputText1() will return null.
    We have also tried to use value binding for the output text, e.g. value=#{backing_untitled2.verbiage}, where verbiage attribute was set in the afterPhase method. The method is called okay and sets the attribute, but for some reason the attribute is then set back and displayed as null.
    The same code is executed okay in a command button.
    Any idea why is that failing, or how to populate these labels dynamically in the page load time better than the above?
    Thanks in advance
    Mohamed Elmallah

    Hi,
    I think you should re-think your strategy and not read the labels from the database all the time. Instead, read it into a class that extends HashMap one time and put it into the session. Then reference the bean #{sessionScope.beanname['label'], which will call the HashMap's getter method. Use the "label" name to find the label for the particular key
    If you r application becomes big, you may want to think of handling the session bean size through leaning it under specific conditions
    Frank

  • Restrict the data to a set of values in the input selection

    Hi,
    We have a requirement it goes like this..
    I've a object ZTEST which stores values (A,B, C..... Z). This object is extensively used across various DSO's and Infoset and Reports were created on top of them.
    Whenever I create a prompt on this object..I get all the values ranging from (A, B,C....Z).
    Now my requirement is, one of the report is intrested in only couple of values from ZTEST say (A,B,C and D). If I create prompt on this object I should get only (A, B,C and D ) in the selection screen.
    Could anyone help me in this regard
    Edited by: Siegfried Szameitat on Nov 3, 2008 12:07 PM
    deleted points offer as it is against the rules

    Thanks for the update.
    I am not sure on the Authorisation Relevant. Could you please expain me in detail how we could do in step by step.
    Thanks in advance.
    Regards,
    sari

  • How to set default value to the variable !!!

    Experts,
    I have created a variable ZDATE, which is in variable entry screen of the query. and this variable is mendatory .
    Now, i want to put default value of this variable ( Which can be done from the Variable Properties screen , on the Default Values Tab )
    But , thru there i can only put selected value. my requirement is to show system date - 1 ( Previous date )
    how do i get that ?
    Thanks

    Hi,
    You would need to write a variable exit under I_STEP = 1 to get the previous day populated on your variable screen.
    Regards,
    Murali.

Maybe you are looking for

  • Data Cache Error

    Hi Experts, Im new in this forum and please tell me if Im in the wrong Forum. I think the problem Im facing is a data cache one. The Scenario is a proxy -> Web Sevice. Synchronous. The Symptoms are: problems in the ESR. when im testing my scenario I

  • ITunes Error 7, (windows error 1114) runtime library error R6034

    Need help, update failed, iTunes Error 7, (Windows error 1114) runtime library error R6034, lost iTune library.

  • BEx Query Column Format

    I have a simple Query at the mo that has  Employee / Master Cost Centre in the rwos and an amount key figure in the columns. Output is Employeee:Master Cost Centre:Amount. Is it possible to make it so Employee and Mater Cost Centre remains as rows bu

  • Account Clearing Concept

    Dear all, I am working on a training document to demostrate account clearing. I am now making a GL Document first (FB50) and then F-03 in FB50, can anyone teach me the DrCr entry please? Debit which type of account? (Asset/Liability/?) Credit which t

  • Creating a T-shirt Design | Adobe & You: Be Seen. Be Heard. Stand Out. | Adobe TV

    Learn how to use the t-shirt template in Illustrator to design your own t-shirt. Promote your favorite school, club or sports team and stand out on campus. http://adobe.ly/OcXvRX