Using AJAX code for the conditional selection list.

Hello

I use AJAX code for the first time, I have no knowledge in java, I got the code from this forum and try to manipulate my requirement.

My requirement is that I have two selection lists, host_name) 1 and 2) database_name.
As soon as I pick/choose the value of host_name select list, I need to fill in only the databases on this particular host. I don't want to send the page for this action.

Here is the code, thank you if anyone can help.


On request the code application process:
-----------------------------------------------------
declare
number of l_counter;
l_o_name varchar2 (2000);
Start
owa_util.mime_header ("text/xml", FALSE ");
HTP.p ('Cache-Control: non-cache');
HTP.p ('Pragma: non-cache');
owa_util.http_header_close;
HTP. PRN ("< select > '");
for rec in (select "ORA_DATABASES_VW". "' Database_name ' as 'database_name ',.
'ORA_DATABASES_VW '. "" DB_ID "as"DB_ID ".
of 'ORA_DATABASES_VW '.
where 'ORA_DATABASES_VW '. ("' HOST_NAME ' =: TEMP_ITEM)
loop
HTP. PRN ("< option value ="' | rec.db_id |) '">' || Rec.database_name | ("< / option >");
end loop;
HTP. PRN ("</select > '");
end;

Header HTML on this page:
=================
< script language = "JavaScript1.1" type = "text/javascript" >

function get_List_XML (source_item, target_item) {}

var v_Target = html_GetElement (target_item);
var v_Source = html_GetElement (source_item);
var ajaxResult = new htmldb_Get (null, & APP_ID, 'APPLICATION_PROCESS = POPULATE_LIST_XML', 0);
ajaxResult.add ('TEMP_ITEM', source_item.value);
var v_result_xml = ajaxResult.get ('XML');

If (v_result_xml & & v_Target)
{
var options_Contents = v_result_xml.getElementsByTagName ("option");
v_Count = options_Contents.length;
v_Target.length = 0;

for (var i = 0; i < v_Count; i ++)
{
var v_opt_xml = v_result_xml.getElementsByTagName ("option");
appendToSelect (v_Target, v_opt_xml.getAttribute ('value'), v_opt_xml.firstChild.nodeValue)
}
}

}
function appendToSelect (target_item, option_val, option_content) {}
var v_Opt = document.createElement ("option");
v_Opt.option_value = option_val;
{if (document. All)}
target_item.options.Add (v_Opt);
v_Opt.innerText = option_content;
} else {}
v_Opt.appendChild (document.createTextNode (option_content));
target_item. AppendChild (v_Opt);
}
}
< /script >


Attribute of the form in the host_name column element. P935_INSTANCE_DB_NAME is my page for database_name.
OnChange = "get_List_XML (this,"P935_INSTANCE_DB_NAME").

Feel free to mark the answers useful or correct ;)

Tags: Database

Similar Questions

  • Creation of Validation for the multiple selection list or shuttle point

    Hello
    I'm new to APEX and have questions about the best way to validate the selected shuttle items to verify that they exist in the sys.dba_roles table before submitting. The shuttle point uses a static LOV. I would like to than the error message to display when there is no such thing as a role selected in the element of the shuttle in the sys.dba_roles table.

    Using version 3.2 of APEX
    DB version 9.2.0.8.0
    Internet Explorer version 6

    I tried to create a validation step level about to shuttle P3_ROLE using SQL EXISTS when you press the button SUBMIT. I know that when argued that the shuttle point returns the selected values in a single string delimited by a colon. I use the APEX_UTIL. STRING_TO_TABLE to convert values selected in a table.

    CODE HERE
    declare
    l_selected APEX_APPLICATION_GLOBAL. VC_ARR2;
    number of l_num;
    Start
    l_selected: = APEX_UTIL. STRING_TO_TABLE(:P3_ROLE);
    BECAUSE me IN 1.l_selected. COUNTY
    LOOP
    Select 1 from l_num of sys.dba_roles where role = l_selected (i);
    END LOOP;
    end;

    This is the error ORA-00928: lack of SELECT keyword
    1006 - ERR error in the validation routine.

    Any advice? Thoughts? Thank you.

    Published by: Violet on Oct 14, 2010 14:50

    Hello

    Your code is PL/SQL block. You cannot use this type of validation with your code.

    Try to change the body type of the function that returns the error text and
    code for this one

    DECLARE
      l_selected APEX_APPLICATION_GLOBAL.VC_ARR2;
      l_num NUMBER;
    BEGIN
      l_selected := APEX_UTIL.STRING_TO_TABLE(:P3_ROLE);
      FOR iIN 1..l_selected.COUNT
      LOOP
        SELECT count(1) INTO l_num FROM sys.dba_roles WHERE role = l_selected(i);
        IF l_num = 0 THEN
          RETURN 'Role not exists';
        END IF;
      END LOOP;
      RETURN NULL;
    END;
    

    Kind regards
    Jari

  • How to load a file by using unique code for the table values

    Hi Experts,

    I'm loading the file to Table data.
    In the file, I will have values such as as follows

    ABC = 1234; XYZ = 5627; NAME = Chavigny
    ABC = 1254; XYZ = 5684; NAME = riadh
    ABC = 1235; XYZ = 5524; NAME = Nani


    How to approach this kind of needs in ODI.

    THX,
    Sara.

    No problem here because we does not specify the third parameter (limit) of SUBSTR.
    Then it just starts after EMPNO = and will go until the end, regardless of how many characters you have after EMPNO =.

    If you want to replace:

    REPLACE(., '')
    

    It will replace all the occurrence of EMPNO = in the chain.

  • Facing problem in the multiple selection list...

    Hi Andy,.

    We are facing a problem more...

    In the selection of the Menu... Like u given a solution for dropdownlist hide which works very well... but the same logic does not work for the multiple selection list item. Why so...


    David...

    Published by: David on November 17, 2008 05:22

    Hello

    If you have added in the Page template, then the P39_BATES_DESCRIPTION will not work. As the P63_ATTRIBUTE_CLASS_CODE is not on the page, javascript will throw an error and that will stop the rest of the code to run.

    You can get javascript to test for the existence of a question of fact:

    if ($x('P63_ATTRIBUTE_CLASS_CODE')) {$x('P63_ATTRIBUTE_CLASS_CODE').style.display = 'none';}
    if ($x('P63_ATTRIBUTE_TYPE')) {$x('P63_ATTRIBUTE_TYPE').style.display = 'none';}
    if ($x('P39_BATES_DESCRIPTION')) {$x('P39_BATES_DESCRIPTION').style.display = 'none';}
    

    Andy

  • Select the condition of list view

    Hi, I use apex oracle 4.2

    I have a scenario where when the checkbox "select list" you should see something else he should not display.

    How can I achieve it.

    box return value 'YES '.


    Thank you
    Nihar Narla

    Hello
    Try this.
    You can go with dynamic action.
    If p1_checkbox is your element create then DA
    Event - click
    Selection - point
    point - p1_checkbox_1 [check the id for the checkbox control to see the source

    
     
    

    condition - equal to
    value - YES

    Real Action: Enable-fireonload
    SelectionType: elements
    Article: p1_select_list
    Action of false-disable-fireonload
    Thank you
    Loga-

  • dDoes anyone know of any legitimate code of windows search programs and a way to get the code for the window using the product id and receipt of a store

    Original title:

    Windows code

    I have 2 questions... 1 is - anyone know of any legit windows code, find online programs for windows on a computer code. My wifes sister and she want to fix his computer by putting in a new hard drive and installing windows, but I wanted to see if I could legitimate his computer code and the sticker is missing, damaged already.

    2. is possible to get the code for the window using the id and product received in a store you microsoft some how I have two computer, I bought my children 3 years ago and to replace hard drives with larger ones, and one of them still has readable sticker.    Thanks again

    As I said, reported for an installation by the manufacturer OEM of Windows key code reflects the image of their system and not the license key on the sticker that is what is needed for a re-installation of consumer, is not surprising that the Samsung 2 is the same.  The key to the thumbnail is not stored anywhere other than on the tile.

    If you cannot or do not want to clone the disks, you can buy a recovery media set at the manufacturer or new media of Windows 7 (becomes very expensive and problematic for the commercial version that MS no longer sells it).

  • During upgrade Adobe Creative Suite CS4 ME in Adobe Creative Suite CS5.5 Design Premium, I get an error saying that the serial number is not an eligible product, please try another. I used to be able to get a code for the customer service, but I can't

    During upgrade Adobe Creative Suite CS4 ME in Adobe Creative Suite CS5.5 Design Premium, I get an error saying that the serial number is not an eligible product, please try another. I used to be able to get a code for the customer service, but I can't chat. Please advise!

    MoeGhazal I have reviewed your account and it seems that you have upgraded to a volume license CS4 Design Premium for an upgrade of retail Design Premium 5.5.

    I also shows that you have made two purchases of CS5.5 Design Premium, but the second purchase was cancelled.  Make sure that you use the serial number that ends in 7886.

    If you are using the correct serial number, then it is likely, that the installer won't recognize your serial number of volume license CS4 as being valid for upgrade.  If you can contact our support team you can be traversed through an unlocking procedure to allow you to proceed with the installation.  You can contact our team of support directly in Contact with the customer.  You can try to install a web browser, you have not previously used.  It of probably a toolbar or other software applications affect your ability to access the media cat successfully.

    If you are unable to reach our support team, then please check your account information is accurate.  If you can please then update this discussion after the confirmation of this so I can ask a member of our support team contact you directly.

    I would recommend again reaching out directly if possible it will be the most effective method to resolve your current error.

  • Coloration of the code for the PHP files using CSS

    Coloration of the code for the PHP files using CSS

    The Situation:

    It is possible to mix PHP and CSS so that you create a PHP file and it is served to the user in a CSS file. It works just like writing a normal PHP file which is then processed and used in HTML. To do this, you create a PHP file and at the top of the file, you add the following line of code:

    <?php header("Content-type: text/css"); ?>

    This line tells the browser that the file is CSS instead of HTML. Fantastic.

    Here is a link to a more detailed article on the subject: http://www.barelyfitz.com/projects/csscolor/

    The problem:

    The problem is that when I create a PHP file in Dreamweaver code colors in the document like PHP for PHP and HTML to CSS code code because it still thinks the document is supposed to be a HTML document. Is there a way to change the style of this situation? I find that code coloring to normal CSS files is really useful and would like to be there instead of just black text.

    Other information:

    I already have this submitted a feature request to Adobe, but I never heard back. Does anyone know how to do this now?

    I would really like to see the code coloring to adapt to the content type of the file, when the file is PHP. So if no content type is specified, values by default in html format, but when it's CSS, code coloring so a coloration of the different code is used. It could also adapt to files JS, XML files, the works. But really, I just want to add the PHP/CSS code coloring.

    I'm certainly not an expert, and this is my first time looking at the file,

    but it looks like the section.

    "ID ="CSS"doctypes ="CSS"priority '50' = > ' see the style css and

    the and refer to where the design must

    be applied. If that is correct then the code you provided should style

    It all starts after the

    and ending with another php code? It should be then that a

    tag additional php to be present in the document of 'close' the

    blowdry.

    And the continuation of this line of thinking, I have just that in the (php-> css)

    file. I placed my code. Then

    After the CSS, I placed another block of php: and it works!

    The CSS is styling just like should the CSS.

    Logically, you need that, and it seems to work ok for me without it. If Yes, you can change "" to be more explicit and less impact for PHP parsing, such as ' /DW/ '.

    Haha, Unfortunantely, PHP is more the same color scheme. He

    went from normal red blends what the html code looks like

    scheme (blue with quotations from green text). Fortunantely this configuration is far

    more convenient than the previous color coding!

    All subsequent PHP Directives are coloring properly for me - it's just the first one that triggers the coloration (e.g. ) is not. What do you see?

    If, therefore, in the XML file you added in CodeColoring.xml, you can change:

    scheme = "outerTag.

    is similar to the colouring of the PHP Directive:

    scheme = "customText" id = "CodeColor_PHPScriptBlock".

    This causes the entire PHP directive is red color - not optimal, but a little better.

    HTH,

    Randy

  • Oracle of the MAF error ' cannot read the DataControl uses on loadDataControl for the id:

    Need help!

    I created a simple SOAP web service for a remote database that works very well in 12 c WebLogic Server and also in the Jdeveloper HTTP Analyzer. When I use the same web service in the attached code, I get the following error (I've included output System.out.println in Ref. to the flow of the code) I use Jdeveloper 12 c MAF 2.0.0.0.41 on Mac OSx 10.9.

    Chk #0

    Processing line # 1

    Chk #1

    Chk #2

    [SEVERE - oracle.adfmf.framework - AmxBindingContext - loadDataControlById] Cannot read the DataControl uses on loadDataControl for the id: WLFNewActWS. [SEVERE - oracle.adfmf.framework - SynchronizationDC - syncDataFromOfflineToOnline] [Ljava.lang.StackTraceElement;@467c53d3

    @


    Sorry about that, I think I'm wrong you.

    OK, I created an example to test what goes wrong.

    1. server side, create a project named Employee_ws

    a. Department_ws.java

    public interface {Department_ws}

    public boolean addDepartment (a Department);

    }

    b. Department.java

    public class {Department

    public Department() {}

    Super();

    }

    int departmentId.

    String departmentName;

    locationId int;

    managerId int;

    {} public void setDepartmentId (int departmentId)

    this.departmentId = departmentId;

    }

    public int getDepartmentId() {}

    return departmentId.

    }

    {} public void setDepartmentName (String departmentName)

    this.departmentName = departmentName;

    }

    public String getDepartmentName() {}

    return departmentName;

    }

    {} public void setLocationId (int locationId)

    this.locationId = locationId;

    }

    public int getLocationId() {}

    return locationId.

    }

    {} public void setManagerId (managerId int)

    this.managerId = managerId;

    }

    public int getManagerId() {}

    return managerId;

    }

    }

    c. Department_impl.java

    @WebService

    / public class Department_impl implements Department_ws {}

    public Department_impl() {}

    Super();

    }

    @Override

    @WebMethod

    {} public boolean addDepartment (@WebParam (name = "arg0") a Department)

    If (Department! = null) {}

    int departmentId = department.getDepartmentId ();

    String departmentName = department.getDepartmentName ();

    int locationId = department.getLocationId ();

    managerId int = department.getManagerId ();

    Connection Conn;

    try {}

    Conn = ConnectionFactory.getConnection ();

    conn.setAutoCommit (true);

    Statement šment = conn.createStatement ();

    String inset_sql =

    "INSERT INTO dept (department_name, location_id, department_id, manager_id) VALUES ('+ '.

    departmentId + "," "" + departmentName + "'," + locationId + "," + managerId + ")";

    šment. Execute (inset_sql);

    Returns true;

    } catch (Exception e) {}

    System.out.println (e);

    }

    }

    Returns false;

    }

    }

    d. ConnectionFactory.java

    import java.sql.Connection;

    to import java.sql.DriverManager;

    import java.sql.SQLException;

    Connect to the database

    public class {ConnectionFactory

    public ConnectionFactory() {}

    Super();

    }

    protected static connection conn = null;

    public static connection getConnection() bird Exception {}

    If (conn == null) {}

    try {}

    String driver = "oracle.jdbc.driver.OracleDriver";

    String url = "jdbc:oracle:thin:@localhost:1521:orcl";

    User String = "employee";

    String password = "employee";

    Class.forName (driver);

    Conn = DriverManager.getConnection (url, user, password);

    } catch (SQLException e) {}

    System.Err.println (e.getMessage ());

    }

    }

    return conn;

    }

    public static {} Sub closeConnection()

    try {}

    If (conn! = null) {}

    Conn.Close ();

    Conn = null;

    }

    } catch (Exception ex) {}

    throw new RuntimeException (ex);

    }

    }

    }

    You can run Department_impl.java to start the Web service. i.e. http://127.0.0.1:7001 / Employee_ws-Client-context-root/Department_implPort? WSDL

    Server side sql:

    CREATE USER employee IDENTIFIED BY employee DEFAULT TABLESPACE users

    Temp TEMPORARY TABLESPACE

    Users WE QUOTA UNLIMITED;

    GRANT create employee to logon.

    GRANT alter used to logon.

    GRANT create any employee at table;

    GRANT create trigger employee TO;

    GRANT create any employee to view;

    GRANT create sequence employee TO;

    GRANT create synonym employee TO;

    GRANT create type employee TO;

    GRANT create employee to procedure;

    CREATE TABLE (DEPT

    DEPARTMENT_ID NUMBER (7, 0) NOT NULL,

    DEPARTMENT_NAME VARCHAR2 (50).

    NUMBER OF LOCATION_ID (7, 0),

    MANAGER_ID NUMBER (7.0)

    );

    2 create a mobile application of CRG named Dept

    a. Department.java (even for the server)

    b. SynchronizationDC.java

    import java.util.ArrayList;

    import java.util.List;

    Import oracle.adfmf.framework.api.AdfmfJavaUtilities;

    Import oracle.adfmf.framework.exception.AdfInvocationException;

    public class SynchronizationDC {}

    public SynchronizationDC() {}

    Super();

    }

    public void syncDataFromOfflineToOnline() {}

    It's just for testing, so I build Department manually instead of mobile db data, please replace in your business logic

    A Department = new Department();

    department.setDepartmentId (1);

    department.setDepartmentName("1");

    department.setLocationId (1);

    department.setManagerId (1);

    NamesList list = new ArrayList (1);

    List ParamsList = new ArrayList (1);

    List TypesList = new ArrayList (1);

    namesList.add ("arg0");

    paramsList.add (department);

    typesList.add (Department.class);

    try {}

    AdfmfJavaUtilities.invokeDataControlMethod ("Dept_WS", null, "addDepartment", namesList, paramsList,

    typesList);

    } catch (AdfInvocationException e) {}

    System.out.println (e);

    }

    }

    }

    c. new an AMX pag called Dept.amx

    "http://www.w3.org/2001/XMLSchema-instance" xmlns:amx ="http://xmlns.oracle.com/adf/mf/amx"

    xmlns:dvtm ="http://xmlns.oracle.com/adf/mf/amx/dvt" >. "

    Text = "syncDataFromOfflineToOnline."

    Disabled = "#{!}" Bindings.syncDataFromOfflineToOnline.Enabled}"id ="cb3"/ >

    d. deploy on Android Simulator

    Click the button and a new record have been db insert through the webservice, search the remote db recording

    If above does not solve your problem, please let me know, thanks.

    Byron

  • where should I enter the editor activation code for the creative cloud

    Where should I enter the editor activation code for the creative cloud?

    Your subscription to cloud shows correctly on your account page?

    If you have more than one email, you will be sure that you use the right Adobe ID?

    https://www.adobe.com/account.html for subscriptions on your page from Adobe

    If Yes

    Some general information for a subscription of cloud

    Cloud programs don't use serial... numbers you, connect you to your cloud account paying to download & install & activate... you may need to sign out of the cloud and restart your computer and log into the cloud for things to work

    Sign out of your account of cloud... Restart your computer... Connect to your paid account of cloud

    -Connect using http://helpx.adobe.com/x-productkb/policy-pricing/account-password-sign-faq.html

    -http://helpx.adobe.com/creative-cloud/kb/sign-in-out-creative-cloud-desktop-app.html

    -http://helpx.adobe.com/x-productkb/policy-pricing/activation-network-issues.html

    -http://helpx.adobe.com/creative-suite/kb/trial--1-launch.html

    -ID help https://helpx.adobe.com/contact.html?step=ZNA_id-signing_stillNeedHelp

    -http://helpx.adobe.com/creative-cloud/kb/license-this-software.html

    If no

    This is an open forum, Adobe support... you need Adobe personnel to help

    Adobe contact information - http://helpx.adobe.com/contact.html

    -Select your product and what you need help with

    -Click on the blue box "still need help? Contact us. "

  • Colour code for the new HFM 11.1.2.3

    Hi guys,.

    could someone tell me the color code for the new HFM 11.1.2.3 show empty lines in line with the background color. HFM 11.1.1.3 code was #E5EAEF

    See you soon,.

    Lukas

    I don't have the code (or the version that you are on), but I can tell you how to find it.

    Take a screenshot, then open Paint.  Paste it in here and use the eyedropper tool to select the color.  In th etop of law, click edit colors and it should bring up the color with your color editing page preselected.  At the bottom right will be the numbers next to red, green and blue.  Convert numbers in Hex and you'll have your code.

    To use the text of your topic here for example, the numbers are therefore 31, 78, 174.  This becomes 1F, 48, AE.  Put them all with a # in fron and you have #1F48AE.

    You can use this trick to get no matter what color you want out of the system corresponds to the formatting.

  • Can Oracle 10g - I use a variable for the access of the user identifywhat tablesto?

    I have the following code in a trigger (PL/Sql block) of a form:

    Select fieldname in user1.sometable myvar;

    is it possible to use a variable instead of coding hard "user1"? And on the same subject, this variable would also be declared in the world?

    Thanks in advance,
    Darren

    Hello!

    User1 is the owner of the table sometable.

    If only the User1 runs your form, there is no need to put the tableowner in front of the tablename parameter.

    If other users run your form, you must create a public or private (for each user) synonym of this table.
    After that, you don't need to use owner.tablename in your sql statement.

    But:
    You cannot use a variable for the user name without using dynamic sql
    as you do if you create a recordgroup.

    Concerning

  • I lost the code for the option menu 'limitations' of the iPhone 4, how can you do then? so I can come and factory reset, it is a 4 digit code, so I can be able toexample factory reset the phone, don't know if this is the right forum for my question but

    I lost the code for the option menu 'limitations' of the iPhone 4, how can you do then? so I can come and factory reset, it is a 4 digit code, so I can be able toexample factory reset the phone, don't know if this is the right forum for my question but

    Sorry, but the restriction password cannot be reset, it is part of the backup and restore a backup that was taken after the restrictions were activated, restore this code again.

    You will have to start without the help of the data backup, configure the phone to factory settings and start over. Follow the steps mentioned in this article:

    Use iTunes to restore your device to factory settings - Support Apple iOS

    If you lose or forget your password restriction, you must erase your device and then put it up as a new device to remove the restriction password. Restore the device by using a backup does not delete the access code.

    copied from: Sur les Restrictions (parental control) on iPhone, iPad and iPod touch - Apple Support

  • How can I get the color codes for the notebook

    How can I get the color codes for the notebook?

    Hello

    What is the color codes for the notebook?

    Perhaps you need a 3rd party utility like GetDiz - Free and others to be
    found using BING or Google.

    GetDiz Notepad - free - replacement
    http://www.Outertech.com/en/Notepad-replacement

    I hope this helps.

  • How can I find the code for the corrupted by the sfc scan files?

    I'm new to computers and I'm not aware about many of these things, I have a laptop Dell Inspiron 1545 with a Vista Home Premium operating system on a 64-bit platform, I did a sfc scan and it found 8 files corrupted. I have also a code will correct corrupted files, but I don't know where to find the codes for the corrupted files to put in the code for fixing corrupted files. I found the log file for the corrupted files and it's the same as the instructions I had to use the code to fix the corrupted files but there is nothing in the log file that corresponds with the file name needed to repair the corrupted files. Where can I find these files? Thanks for any help.

    Hello

    Not sure what you mean by you have a code to solve those? Create a sfcdetails.txt and that you post a copy
    each section of a message here - they will repeat in order to do not post duplicate sections, as appropriate.

    ------------------------------------------------------------

    Many files that SFC cannot resolve are not important.

    Start - type in the search box-> find CMD in top - click right on - RUN AS ADMIN

    put the command from below (copy and paste) in this box and her and then press ENTER.

    findstr/c: "[SR]" %windir%\logs\cbs\cbs.log > sfcdetails.txt

    who creates the sfcdetails.txt file in the folder that you are in when you run it.

    So if you're in C:\Windows\System32 > then you will need to look in that folder for the file.

    How to analyze the log file entries that the Microsoft Windows Resource Checker (SFC.exe) program
    in Windows Vista
    http://support.Microsoft.com/kb/928228

    This creates sfcdetails.txt in C:\Windows\System32 find and you can post the errors in a message
    here. NOTE: there are probably duplicates so please only post once each section error.

    You can read the newspaper/txt files easier if you right click on Notepad or Wordpad then RUN AS ADMIN - then
    You can navigate to sfcdetails.txt (in C:\Windows\System32) or cbs.log (in C:\Windows\Logs) as needed.
    (You may need to search sfcdetails.txt if it is not created in the default folders.)

    I hope this helps.

Maybe you are looking for