How to refer an application item in a java script ?

Hi Friends,
I have a simple java script for disabling an item as below :
<script language="JavaScript1.1" type="text/javascript">
    function disFormItems(item1)
      if ($x(item1).value != "")
          disItem = document.getElementById(item1);
                disItem.style.background = 'beige';
                disItem.readOnly = true;
</script>I have an application level item G_BUTTON_FLAG. Based on the value coming into this application item I want to disable the item.
So I went and changed the script as below :
<script language="JavaScript1.1" type="text/javascript">
    function disFormItems(item1)
      if ($x(item1).value != "" && $x('G_BUTTON_FLAG').value == "EDIT")
          disItem = document.getElementById(item1);
                disItem.style.background = 'beige';
                disItem.readOnly = true;
</script>Can any one please tell me what am I doing wrong here ?
Thanks,
Raj.

Hi Teku,
Javascript can only see what is actually on the page - this has nothing to do with Apex, it's just what javascript is designed to do.
There are two things you can do:
1 - Add a hidden item to your page and set the application item as its source and then refer to that hidden item instead
2 - Use Ajax to get the value
I'd go with the first one as it's the simplest solution.
Andy

Similar Messages

  • How to get/read region item value in java script

    Hi All,
    i have text item on a page.
    how to read the item value in java script
    EXAMPLE
    P10_RESULT IS ITEM IT HAS VALUE "38.956472,-77.447777","38.999123,-77.026184","12.951497,70.668646","17.459075,78.456888"
    NOW I WANT TO REFER ABOVE ITEM VALUE IN JAVA SCRIPT LIKE
    var myPoints=new Array(&P10_RESULT.);
    SO I CAN POPULATE ARRAY WITH CORDINATES
    IT IS NOT WORKING
    WHAT IS THAT I AM MISSING.
    PLESE HELP .
    ThankS
    Rk

    region header code....
    <script src="http://maps.google.com/maps?file=api&v=2&key=&API_KEY." type="text/javascript"></script>
    <script type="text/javascript">
    //<![CDATA[
    //globals
    var bounds = new GLatLngBounds();
    var map;
    var centerPoint = new GLatLng(38.984898,-76.854549);
    var gmarkers = [];
    //var x= ""38.956472,-77.447777","38.999123,-//77.026184","12.951497,70.668646","17.459075,78.456888"";
    //var myPoints=new Array(x);
    //var myPoints=new Array($x('P10_RESULT').value);
    var myPoints=new Array(document.getElementById('P10_RESULT').value);
    //var myPoints=new Array("38.956472,-77.447777","38.999123,-77.026184","12.951497,70.668646","17.459075,78.456888");
    function initMap()
              doLoad();
                        addMarkers();
    function doLoad()
         if (GBrowserIsCompatible())
                   map = new GMap2(document.getElementById("map"));
                   map.setCenter(centerPoint, 7);
                   map.addControl(new GScaleControl());
                   map.addControl(new GLargeMapControl());
                   map.addControl(new GMapTypeControl());
    function myclick(i) {
    GEvent.trigger(gmarkers, "click");
    function addMarkers() {
         if (myPoints.length) {
              var bounds = new GLatLngBounds();
              for (n=0 ; n < myPoints.length ; n++ ) {
                   var mData = myPoints[n].split(',');
                   var point = new GLatLng(mData[0],mData[1]);
                   bounds.extend(point);
                   var marker = createMarker(mData[1],point, mData[0]);
         map.addOverlay(marker);
              map.setCenter(bounds.getCenter(), map.getBoundsZoomLevel(bounds));
    function createMarker(i,point, title) {
         var marker = new GMarker(point,{title:title});
         GEvent.addListener(marker, "click", function() {
              marker.openInfoWindowHtml('<div style="width:250px;">' + title + '<hr>Lat: ' + point.y + '<br>Lon: ' + point.x + '</div>');
         gmarkers[i] = marker;
         return marker;
    //]]>
    </script>
    page body code
    onload="initMap()" onunload="GUnload()"

  • How to set an Application Item from PL/SQL

    I am attempting to set an Application Item
    After login to my app, I want to retrieve a row from my SETTINGS table and populate some Application Items with the settings information so that I can
    display some of that settings information on every page.
    Just to start, I created one Application Item named F106_YEAR
    I then created a Shared Components Application Process which executes on New Session: After Authentication
    I created this process as an Anynomous PL/SQL block.
    declare
    aucyr varchar(4);
    begin
    select year into auctyr
    from settings;
    :F106_YEAR := aucyr;
    end;
    I've tried a couple of other Syntax tricks attempting to reference the Application Item F106_YEAR from within PL/SQL (like V('F106_YEAR') but nothing seems to be working.
    I'm sure that I am missing something simple. Can someone tell me how to set an Application Item from PL/SQL?
    Thanks in advance.

    I'm still doing something wrong because this is not working for me.
    I've tried both of the following versions as an Application Process set to run on New Session after Authentication:
    declare
    auction_year varchar(4);
    begin
    select year into auction_year
    from PBUUC.SETTINGS where rownum < 2;
    :F106_AUCTION_YEAR:=auction_year;
    end;
    and I also tried:
    declare
    auction_year varchar(4);
    begin
    select year into auction_year
    from PBUUC.SETTINGS where rownum < 2;
    APEX_UTIL.SET_SESSION_STATE (p_name, p_value);
    end;
    F106_YEAR is a global Item (shared components).
    The select statement works just fine in SQL*PLUS so I know that it is correct.
    If I run the debugger and log into the application, here is the output. Shouldn't I see my Application Process get called if it is set to run on New Session after Validation?
    My Application process is named RETRIEVE_AUCTION_SETTINGS
    0.01: A C C E P T: Request="P101_PASSWORD"
    0.01: Metadata: Fetch application definition and shortcuts
    0.01: alter session set nls_language="AMERICAN"
    0.01: alter session set nls_territory="AMERICA"
    0.01: ...NLS: Set Decimal separator="."
    0.01: ...NLS: Set NLS Group separator=","
    0.01: ...NLS: Set date format="DD-MON-RR"
    0.01: ...Setting session time_zone to -04:00
    0.01: NLS: wwv_flow.g_flow_language_derived_from=0: wwv_flow.g_browser_language=en-us
    0.01: Fetch session state from database
    0.02: ...Check session 695371898690095 owner
    0.02: ...Check for session expiration:
    0.02: ...Metadata: Fetch Page, Computation, Process, and Branch
    0.02: Session: Fetch session header information
    0.02: ...Metadata: Fetch page attributes for application 106, page 101
    0.03: ...Validate item page affinity.
    0.03: ...Validate hidden_protected items.
    0.03: ...Check authorization security schemes
    0.03: Session State: Save form items and p_arg_values
    0.03: ...Session State: Save "P101_USERNAME" - saving same value: "jps"
    0.03: Processing point: ON_SUBMIT_BEFORE_COMPUTATION
    0.03: Branch point: BEFORE_COMPUTATION
    0.03: Computation point: AFTER_SUBMIT
    0.03: Tabs: Perform Branching for Tab Requests
    0.03: Branch point: BEFORE_VALIDATION
    0.03: Perform validations:
    0.03: Branch point: BEFORE_PROCESSING
    0.03: Processing point: AFTER_SUBMIT
    0.03: ...Process "Set Username Cookie": PLSQL (AFTER_SUBMIT) begin owa_util.mime_header('text/html', FALSE); owa_cookie.send( name=>'LOGIN_USERNAME_COOKIE', value=>lower(:P101_USERNAME)); exception when others then null; end;
    0.04: ...Process "Login": PLSQL (AFTER_SUBMIT) wwv_flow_custom_auth_std.login( P_UNAME => :P101_USERNAME, P_PASSWORD => :P101_PASSWORD, P_SESSION_ID => v('APP_SESSION'), P_FLOW_PAGE => :APP_ID||':1' );
    0.06: ...Process "Clear Page(s) Cache": CLEAR_CACHE_FOR_PAGES (AFTER_SUBMIT) 101
    0.06: Nulling cache for application "106" page: 101
    0.00:
    0.00: S H O W: application="106" page="1" workspace="" request="" session="695371898690095"
    0.01: alter session set nls_language="AMERICAN"
    0.01: alter session set nls_territory="AMERICA"
    0.01: ...NLS: Set Decimal separator="."
    0.01: ...NLS: Set NLS Group separator=","
    0.01: ...NLS: Set date format="DD-MON-RR"
    0.01: ...Setting session time_zone to -04:00
    0.01: NLS: wwv_flow.g_flow_language_derived_from=0: wwv_flow.g_browser_language=en-us
    0.01: Application 106, Authentication: CUSTOM2, Page Template: 2904114531488186
    0.01: ...Session ID 695371898690095 can be used
    0.01: ...Application session: 695371898690095, user=JPS
    0.01: ...Determine if user "JPS" workspace "1040027630222986" can develop application "106" in workspace "1040027630222986"
    0.01: ...Check for session expiration:
    0.01: Session: Fetch session header information
    0.01: ...Metadata: Fetch page attributes for application 106, page 1
    0.01: Fetch session state from database
    0.02: Branch point: BEFORE_HEADER
    0.02: Fetch application meta data
    0.02: Computation point: BEFORE_HEADER
    0.02: Processing point: BEFORE_HEADER
    0.03: Show page template header
    0.03: Computation point: AFTER_HEADER
    0.03: Processing point: AFTER_HEADER     
    0.04: Computation point: BEFORE_BOX_BODY
    0.04: Processing point: BEFORE_BOX_BODY
    0.04: Region: Auction_Title F106_AUCTION_YEAR

  • How to refer a service Item in CPO

    Hi
    I have a service item defined in CCP. How can I refer them in CPO Process. In CPO 2.3.0.44, we have create service item activity. But how the service Item type field can be filled?
    how to define service item type in CPO
    Any pointer would help
    Thanks 

    Hi Teku,
    Javascript can only see what is actually on the page - this has nothing to do with Apex, it's just what javascript is designed to do.
    There are two things you can do:
    1 - Add a hidden item to your page and set the application item as its source and then refer to that hidden item instead
    2 - Use Ajax to get the value
    I'd go with the first one as it's the simplest solution.
    Andy

  • How to populate an application item using ONCHANGE.

    I am trying to populate an application item, TAB_INSTATE using an onchange command. I cannot figure out how to do it. Does anyone know the syntax, or can you point me in the right direction. I am unfamiliar with javascript and have been relying on previous examples, posts. thanks
    apex_item.select_list_from_query
    (20,
    c020,
    'select partner_name, partner_abbrev
    from partners
    where state_code is not null order by partner_name ',
    'style="width:100px"'
    || 'onchange="'
    || CASE
    WHEN :p300_authorization1 = 1
    THEN 'f_set_casc_area(this,f21_'
    || LPAD (seq_id, 4, '0')
    || ');'
    ELSE
    <THIS IS WHERE I WOULD LIKE A THE VALUE OF c020 TO BE PLACED INTO :TAB_INSTATE>
    END
    || 'f_set_casc_subarea(this,f22_'
    || LPAD (seq_id, 4, '0')
    || ')"',
    'YES',
    '0',
    '- Select State -',
    'f20_' || LPAD (seq_id, 4, '0'),
    NULL,
    'NO'
    ) in_state,

    Hello Karen,
    >> I am trying to populate an application item, TAB_INSTATE using an onchange command.
    I believe I answered you in here - Re: once more...4 cascading LOVs, 3rd is hidden 4th no longer works However, for future reference…
    You don’t have a direct access to an application item, using JavaScript, because application items don’t render on page. You can, however, using the AJAX framework to do that, using the add() method. The generic code I’m using is the following:
    <script type=”text/JavaScript”>
    function setSessionValue(pItem, pValue) {
      var get = new htmldb_Get(null,html_GetElement('pFlowId').value,null,0);
      get.add(pItem, pValue);
      get.get();
      get = null;
    </script>This code can set any page or application item value.
    Regards,
    Arie.

  • How to set an application item when report column link is clicked?

    I am trying to set the short name of a bread crumb entry when I drill into a detail from an interactive report page.
    The master report has a column link with target = detail - "page in this application"
    I can pass page items through the URL and they are set on the target page.
    How can I set an application item before the target page is called?
    Is there a way to set a process before the link is followed?

    Kenneth,
    I'm not totally sure that I understood the question but, it soounds like you want to set the value of some page items on the page that is opened when you click a link on a column in the master window. Is this right?
    If so, you can achieve what you want by creating hidden page item(s) on the target page. In the master page, on which every column provides the link, go into Report Attributes, click on the link column and scroll down to the section labeled "Column Link" Within this section, set the link text to the current column value, e.g. #MASTER_REPORT_COLUMN_NAME_HERE#. Set the target to "Page in this Application" and pick the page number for the target window.
    Underneath this you will see a section to set set the value for page items. If you click the flashlight, you can search for the hidden page item that you created above. Use the same value to set it as you did the link text, i.e. #MASTER_REPORT_COLUMN_NAME_HERE#. Do this and let APEX take care of passing the values on the URL.
    On the child page, just set whatever control you want to dynamically pick up the value from the hidden field. For example, if you hidden field where named P4_CLEARER_NAME. You could set the title attribute to "Contact Information for &P4_CLEARER_NAME."
    You need the preceeding "&" and terminating "." around the name of you hidden page item to do this.
    -Joe

  • How do I get expert help to solve Java Script error in PS?

    My Photoshop CC (and previous versions) do not see Java script, therefore any automation functions do not work.
    I have been dealing with Adobe support in India since September and have had no resolution. Although they keep saying the case has been escalated, I have yet to talk to anyone who seems to have any understanding past following a check list.
    Please help- how do I get in touch with someone who can actually troubleshoot the problem?

    I think an extension is the most likely culprit.
    Tools > Add-ons > Extensions category
    * You might try updating your extensions, in case updates are available. The "gear" icon > Check for Updates is the easiest way
    * If no updates are available or the problem persists, try to '''disable''' all nonessential extensions (i.e., all the ones you do not absolutely need to tolerate using Firefox today). Simply click all those Disable buttons and then restart Firefox.
    Can you browse for an extended period without seeing the message?

  • How to run an application i created in java without using eclipse

    Im familiar with running an application i create thru command prompt or eclipse, how do i create a file to run on any computer with java so i can double click the file and my application runs. C# automatically does this, do i need to do an extra step to the jar file?

    Hi,
    You need to make an executable JAR file. There are a few ways you can do this but since you are using Eclipse you can follow this tutorial.
    [http://www.fsl.cs.sunysb.edu/~dquigley/cse219/index.php?it=eclipse&tt=jar&pf=y]
    The most important part is the manifest file, if you have dependencies on other JAR files they will need to be specified along with the
    main method to call to start you program. You can do this via the Eclipse Wizard.
    It will be in your interests to read this tutorial also
    [http://java.sun.com/docs/books/tutorial/deployment/jar/]

  • After apgrading a suggesed firefox download, each time I log onto Mozilla, the following application pops up constantly: (Java Script Application) Type Error:glLTFFObj is undefined. How do I remove this from my pc altogether,as it is most annoying

    This type error pops up constantly and when I either click on OK or the red cancel on the top right hand side, it does not make any difference and is constantly there giving me total frustration.
    How do I remove this application please?
    Kindest Regards
    Dave

    Do you have the Yahoo toolbar? Other users have reported a similar JavaScript error when loading sites with that toolbar installed. If you have it, you could disable it or perhaps there is an updated version available.
    If you don't have that toolbar, it could be one of your other add-ons. Check out cor-el's answer in this thread: [http://support.mozilla.com/en-US/questions/795003 When starting Firefox 4 I am presented with a JavaScript Application message "TypeError ksClass is undefined" | Firefox Support Forum | Firefox Help].

  • How to use Contribute to edit html or java script

    I have a client who use Contribute to edit web pages but they
    are unable to edit the html or javascript. I have a javascript
    photogallery they want to update but they can't. Is there away
    around this? I tried a flash gallery but they still can't update
    the xml file. Am I missing something here?

    You can give your users the rights to Edit page source in
    external application (both for xml as javascript):
    1. Main menu>Edit>Administer websites, pick site
    2. Users and Roles, pick role, click Edit role settings
    3. go to Editing and check 'Allow users to edit web page
    source in external application'
    When your users opens (using the Choose btn next to
    addressbar) a .js or .xml file in Contribute (tested in CS3) just
    click the 'Edit btn' and Contribute will open the file in the
    editor you selected.
    How to select the editors:
    1. Main menu>Edit>Preferences
    2. go to File Editors.
    If this does not work in your version maybe you can use Main
    menu>File>Actions>Edit page source in external
    application.

  • How can I hide what I write in Java Script

    If I write a script, I offer it to many one to use it, but I don’t want to anyone to see what I write in the script, how can I do?

    In ESTK go to "File" and select "Export as Binary..."
    HTH
    Marijan (tomaxxi)
    http://tomaxxi.com

  • URGENT!!! How can I disable text boxes in JSP / Java Script??

    Hi! Hope you can help me with this one. It's kinda am having difficulty disabling / enabling text boxes in my JSP or JavaScript code. How can I do this? thanks a lot in advance...GOD BLESS!!

    I'm not really sure with Netscape browsers but with IE 4.0 and above there are two properties you can add to the <input> tag. They are Disabled and Readonly:
    <INPUT TYPE="text" VALUE="testing" DISABLED />
    <INPUT TYPE="text" VALUE="testing" READONLY />

  • How we can handle the below doubt in Java Script!!

    Hi All,
    I need to handle the below scenerio in javascript, i am very poor in scripting langauage could any help me out.
    Below are the three where we have specail character
    words as
    1. transfer (…)
    2. Shell’s
    3. Vitol – as
    The above 3 are having some specail characters which we need to
    replace as mentioned below
    need to use a Function/Method in some scripting language like Java
    script to replace the special character with a predefined sequence eg:
    single quote with “a1b1” before inserting the data in to the data base
    and then while retrieving the record from the database replace “a1b1”
    with single quote.
    Note#:It is a text area where user can either enter or copy and paste
    the content.
    Thanks,
    Anoo..

    Hi Anoo,
    always remember to put your apex and database versions, it makes it easier to help.
    You mentioned stripping out special characters and then putting them back for display. Is there a particular reason why?
    If you're having difficulty querying the 'special' characters from SQL, you can create a view to handle that complexity.
    The examples you gave don't contain any characters you can't query on. Maybe I'm missing something.
    Kofi

  • How to embed the scriplet code in the java script

    I have an error page. Using the implicit object exception i'm writing stack trace on the page. I have a showerror in the error page. when i click on that link It should display the stack trace.
    for the moment conserder a form containing two text fields which take two inputs. And when you click on the submit. Then it goes to a first.jsp which will convert them into integer and treis to divide. And the divide by zero happens then error.jsp has to be invoked. That should have a hyper link show error . On click of this I want the stack trace to be displayed.

    Hi Man,
    We can't get u man. Pls do clearly,wht u wanna do..
    Cheers

  • How to call a jsp function on a java script event 'onchange'

    hi all,
    i m in trouble, iwant to call a jsp function on occurance
    of a javascript event onchange
    actully i want to refresh my one text field at every change
    in a select option of a form
    plz tel me any othr method if i m wrong.
    thnx in adv.

    as the form submition is a POST operation u can use some
    if{} else{} construct to handle this. u can check the value of some POST variable to identify whether its the first loading or refresh. got it
    regards
    aleens

Maybe you are looking for

  • Not able to connect to database(MS SQL Server 2000) through JSTL tag

    Hi, I just want to retrieve some data from the database through a JSP page.I am using JSTL tags the code is as shown below. Whenever i execute this code i get an error message like this My Code: <%@ taglib prefix="c" uri="http://java.sun.com/jstl/cor

  • Rev2:  2 Apple IDs on the same computer?

    My partner has her own Apple ID/account and her own Mac running 10.7.  She uses the Mac App Store. I have my own Apple ID/account and an iPhone running iOS 5.1.  I also have a Mac running 10.5 and I will upgrade that later (compatibility issues). I h

  • What are the major issues to consider in code review? Or performance analys

    What are the major issues to consider in code review? Or performance analysis?

  • Folder on desktop will not open

    Hi there, I am having a bit of a problem. I have a folder on my desktop for dumping stuff in to keep it tidy, and now when I try to open it, it seems to try, and then closes, leaving me with the window for my HDD. Before this started, a folder with M

  • Simple source codes using JAXM Provider

    Hi guys, I am new to this technology. I looked around the web for simple codes using JAXM Provider but not luck. I will appreciate your help if someone out there have working example using JAXM service Provider. Thanks in advance...