Trying to set application item value through javascript

Hi,
I am not sure what I am doing wrong here can someone possibly shed some light? I have the following in my
HTML Header of my login page
<script language="JavaScript1.1" type="text/javascript">
function setAppItem(val){
  var req = new htmldb_Get(null, &APP_ID., 'APPLICATION_PROCESS=dummy', 
  &APP_PAGE_ID.);
  req.add('F_LOGIN_MESSAGE', val);
  var gReturn = req.get();
  req = null;
</script>
<script language="JavaScript1.1" type="text/javascript">
function doLogin()
  var err = false;
  alert(document.getElementById('P101_USERNAME').value);
  if((document.getElementById('P101_USERNAME').value == '') ||
    (document.getElementById('P101_PASSWORD').value == '')) {
    setAppItem('You must enter a username and password.');
    err = true;
  if(!err) {
    doSubmit('Login');
</script>The setAppItem function does get called but it is not setting the application items text?
Thanks in advance for any help!

Thanks for all of your help Jari it is appreciated!
For others the solution was to add the following to my HTML Source
<div id="LOGIN_MESSAGE"></div>and then created the javascript routine
<script language="JavaScript1.1" type="text/javascript">
function setAppItem(val)
  $x('LOGIN_MESSAGE').innerHTML=val;
function doLogin()
  var err = false;
  if($v('P101_USERNAME') == '' || $v('P101_PASSWORD') == '')
    setAppItem('You must enter a username and password.');
    err = true;
  if(!err)
    doSubmit('Login');
</script>
Thanks

Similar Messages

  • How to pass Application Item value in Javascript function.

    Hi,
    I have the following javascript in the HTML Form Element Attributes properties
    I am on Page1 and passing P1_DEPT_NO page item value. This is working perferctly fine and I am able to get the exact value of the page item
    onchange="javascript:function1($x('P1_DEPT_NO').value);"I am on Page1 and passing Application Item G_DEPT_NO value.
    The problem here is, I am not getting the Application item value inside the javascript function.
    I tried using alert(); and it's giving me value as undefined
    onchange="javascript:function1($x('G_DEPT_NO').value);"Just want to know, how to pass the Application Item value in Javascript.
    Thanks,
    Deepak

    Deepak,
    I am not an expert at Javascript, but the suggestin I made was because javascript is a case-sensitive language.. and therefore onChange is not the same as onchange.
    Not quite sure if that is causing the problem.
    Application items are not associated with a page and therefore have no user interface properties.
    Therefore, as mentioned in another post, the rendering would not work for application items.
    If it is for a single item, used only in this page, you could create a hidden page item and use it fo your purpose
    If you still want to look at application items and AJAX, This page contains examples of using AJAX to solve problems like the one you mentioned.
    http://www.oracle.com/technology/obe/hol08/apexweb20/ajax_otn.htm#t1b
    Thanks,
    Rajesh.

  • PAGE RADIO BUTTONS and APPLICATION ITEM VALUE

    I have several pages that use same radio button group that permits filtering the report query (of course on each page, it is a page level radio button item).
    I created an application item value to hold the last used value of a radio button item.
    On login, I would like the application item value set to a default value.
    For a given page using the recurring radio button group item,
    I would like the radio button item value set to the application item value on entry into a page.
    I would like the report to use the application item value on entry to a page.
    I would like the application item value be updated anytime the page level radio button item value is changed, so that when you move to another page,
    the next radio button group and report can use the last selected radio group button value.
    I am trying to use a variety of solutions in COMPUTATION and CONDITIONAL COMPUTATION... to include use of set_session_state procedure, and I am not getting desired result, partial success, but not complete.
    Can you have a computation item that is only for initialization of the report and radio button group on page entry?
    And a separate computation item that senses user selection of another radio button, updating the report, and updating the application level item?
    Help requested. Thank you.
    Would be nice to have application level objects, like radio button groups.

    Created Page 0
    Created an HTML region in COLUMN 2 and SEQUENCE 10.
    Selected under region CONDITION:
    Current Page is contained within Expression 1 as comma delimited list of pages
    in the EXPRESSION 1 provided the requested comma delimited list of pages that I wished the HTML region to appear.
    Created the radio button group item P0_RADIO and assigned to Page0 HTML region.
    Selected under item CONDITION:
    Current Page is contained within Expression 1 as comma delimited list of pages
    in the EXPRESSION 1 provided the requested comma delimited list of pages that I wished theradio button group to appear.
    In SHARED COMPONENTS I created an APPLICATION COMPUTATION
    In the computation I created a PL/SQL function to initialize the radio group
    BEGIN
    IF :P0_RADIO IS NULL THEN
    RETURN 'A_ALL';
    ELSE
    RETURN :P0_RADIO;
    END IF;
    END;
    'A_ALL' being the default value for :P0_RADIO
    Radio group appears on the desired pages, is initialized to the desired default value, and works properly on each page.

  • Return two columns values through Javascript

    In the same goal as:
    onclick="$s('P1_DEPTNO', #DEPTNO#); return false;"
    to return a column value through javascript, is it possible to return 2 values? Example:
    onclick="$s('P1_DEPTNO', #DEPTNO#); $s('P1_EMP, #EMPLOYEE#);return false;"
    Thanks all :)
    Max

    Maxime Carrier wrote:
    In the same goal as:"Goal"?
    onclick="$s('P1_DEPTNO', #DEPTNO#); return false;"
    to return a column value through javascript, is it possible to return 2 values? Example:
    onclick="$s('P1_DEPTNO', #DEPTNO#); $s('P1_EMP, #EMPLOYEE#);return false;"Have you tried it?
    This code contains a syntax error in the form of a missing quote. It should be:
    onclick="$s('P1_DEPTNO', #DEPTNO#); $s('P1_EMP', #EMPLOYEE#);return false;"It might also produce JS syntax errors if the <tt>#DEPTNO#</tt> and/or <tt>#EMPLOYEE#</tt> values are not numbers.
    onclick="$s('P1_DEPTNO', '#DEPTNO#'); $s('P1_EMP', '#EMPLOYEE#'); return false;"would therefore be safer (assuming the code is somewhere that <tt>#DEPTNO#</tt> and <tt>#EMPLOYEE#</tt> will be substituted).
    Your post is spectacularly lacking in context. Why do you want to do this? Where?
    When you have a problem you'll get a faster, more effective response by including as much relevant information as possible upfront. This should include:
    <li>Full APEX version
    <li>Full DB/version/edition/host OS
    <li>Web server architecture (EPG, OHS or APEX listener/host OS)
    <li>Browser(s) and version(s) used
    <li>Theme
    <li>Template(s)
    <li>Region/item type(s) (making particular distinction as to whether a "report" is a standard report, an interactive report, or in fact an "updateable report" (i.e. a tabular form)
    Following the guidelines in these documents will also help to explain the problem in much more detail and with sufficient background for it to be understood:
    <li>+How to ask questions+
    <li>+{message:id=9360002}+

  • Setting an item value before print report in BI Publisher

    Hi,
    I am having an issue with setting a page item's value once a button (that prints a BI Publisher report) is pressed. The session state for the item is set, however because the page does not re-load no value appears in the item on the page.
    I am using a button as a page Item and using a Page Branch with the Branch Point set as On Submit: After Processing(After Computation, Validation, and Processing) with the Page set to 0 and the Request set to PRINT_REPORT=REPORT
    Is there any way to set the item value on the page before branching to the report?
    Your help is greatly appreciated.
    -Marsha

    Marsha,
    You can do that as follows:
    1- create a hidden text item (P20_date_hidden) with default value set to sysdate.
    2- for your button >> edit >> Buttom display attributes >> attributes >> type in : onFocus= "set_date();" (( note: am using onFocus because it takes places before onClick ))
    3- In your page >> edit >> HTML header >> type in :
    <script language="JavaScript" type="text/javascript">
    function set_date()
    v_date = $x('P20_DATE_HIDDEN').value;
    $x('P20_DATE_LETTER_SENT').value = v_date;
    </script>
    Hope this helps,
    Sam
    Please reward good answers by marking them correct or useful!

  • Can we set h:outputText value= "(some javascript function value)"/

    Hi
    Can we set <h:outputText value= "(some javascript function value)"/>
    In a scenario like when user changes the item in dropdown box. label name as to change for the next text box.
    -----JSP page------
    h:outputText value="*" styleClass="mandatoryField" />
    <h:outputText value="Matching Criteria:" />
    <h:selectOneMenu id="MatchingCriteria" styleClass="dropDownMenu" value="#{OffsetTradingRuleBean.matchingCriteria}"immediate="true" onchange="unitChange()">
    <f:selectItems value="#{OffsetTradingRuleBean.matchingCriteriaMap}"/>
    </h:selectOneMenu>
    <h:outputText value=""></h:outputText>
    <h:outputText value=""></h:outputText>      
    <h:outputText id="DeminimisLabel" value="" ></h:outputText>
    <h:inputText id="DeMinimisUnit" styleClass="text" value="#{OffsetTradingRuleBean.deMinimisUnit}" maxlength="15" onchange="detectChange()" >
    <f:validator validatorId="DefaultValidator"/>          
    </h:inputText>
    <h:outputText value=""></h:outputText>
    -----Java Script-----
    function unitChange(){
         if(document.getElementById("frm:MatchingCriteria").value!="1"){
         alert('inside unitchange--'+document.getElementById("frm:MatchingCriteria").value)
              document.getElementById("frm:DeminimisLabel").value="Deminimis Dollars";
         if(document.getElementById("frm:MatchingCriteria").value!="0"){
              document.getElementById("frm:DeminimisLabel").value="Deminimis Shares";
    thanks in advance
    Rambhapuri

    balu
    actually i want to swap label name using javascript. first i will call onchange event from matching criteria dropdown box . then it will fire unitChange() function.
    then i am putting value Deminimis dollor or deminimis shares accroiding to the value which is there in dropdown.
    this value as to come in <h:outputText id="deminimisLabel" value=" should come value from java script" />
    and it should act dynamically ,. like when ever user changes the dropdown item . the corresponding name should change in lable name.
    thanks
    rambhapuri

  • How to create a view in sql workshop depending on an application item value

    Hello,
    How coud I create a view in SQL worshop based on an application item value? For example select id, name
    from gg_provider
    where user = ' || :USER
    So basically each user would have it's own view. But it does not work like that. I think when I use :USER then the database takes database user not the user logged in to apex application. How would be possible to use application user to create the view?
    Thank you very much.

    Instead of
    :APP_USER
    use
    v('APP_USER')
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • Setting application items through javascript

    Is there any way to modify application items using javascript? I would work with page items, but I need something that is guaranteed to be in the session state.

    Oh yes, I know that. Well here's the exact problem (I've posted threads on it from a couple different angles previously):
    - I am trying to open a popup with a report region such that I can send a query to the popup some how, without doing a page submission of the parent page.
    - The current method I am using is to send the query by URL, but I'm reaching the limit of URL length, and it's not a particularly secure solution.
    - My latest idea was to pass-by-reference (what this thread is about), but this presented a couple of problems.
    1) I could set a parent page item dynamically by JS, but the only way I know of loading the information automatically in the popup is using onLoad -- but that's too late.
    2) I could use session state, but I risk Region condition: javascript is enabled?, page session items are not set until a page is submitted, and application session items are not accessible by JS.
    I was thinking that maybe there is some way of accessing browser session state with JS, but I guess not....

  • Set application item from javascript?

    Hi!
    Is it possible to set an APPLICATION ITEM from javascript? If so can some one please point me to the thread, or a FAQ or an example, etc?
    Thanks!
    Dave Venus

    dvenus1,
    Sure. In the script below I check variables and populate based on what I find...
    <script language="JavaScript" type="text/javascript">
    function Populate_fld()
    var formVehicle = document.getElementById('P9_HIDE_VEHICLE').value;
    var formState = document.getElementById('P9_HIDE_STATE').value;
    var formTag = document.getElementById('P9_HIDE_TAG').value;
    var formName = document.getElementById('P9_HIDE_NAME').value;
    document.getElementById("P9_VEHICLE").value = formVehicle;
    document.getElementById("P9_TAG").value = formTag;
    document.getElementById("P9_STATE").value = formState;
    document.getElementById("P9_VISITOR_NAME").value = formName;
    if (formState = " ")
    document.getElementById("P9_STATE").value = "FL";
    </script>
    Keep Smiling,
    Bob R

  • AjaxRequest not assigning Application Item value

    Hello,
    I have an application item called DESTINATION_PAGE and a page item called P63_NEXT_PAGE. I have an Application process that does the following:
    declare
    begin
    select get_page(:PLATFORM) into :DESTINATION_PAGE from dual;
    htp.p(:DESTINATION_PAGE);
    end;
    This is my AjaxRequest in P63 Header:
    function getPage(platformID){
    var ajaxRequest = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=GET_PAGE', 0);
                             ajaxRequest.add('PLATFORM', platformID);
                             ajaxRequest.add('APPLICATION_ID', $("#P63_APPLICATION_ID").val());
                             ajaxResult = ajaxRequest.get();
    $("#P63_NEXT_PAGE").val(ajaxResult);
    alert($("#P63_NEXT_PAGE").val());
    $("#DESTINATION_PAGE").val(ajaxResult);
    alert(&DESTINATION_PAGE.);
    From my above 2 alerts, the page item (P63_NEXT_PAGE) gets the correct page number of 14, but the application item (DESTINATION_PAGE) still has the old page number of 63! Please help, this is really frustrating because I need to use the Application Item in a URL request. I've tried using $s('DESTINATION_PAGE',ajaxResult) as well as additional functions, but my Application Item still is not updating correctly.
    Thanks in Advance!
    Johnny

    Hello Jarola,
    I have tried using the SET_SESSION_STATE, but the problem is I need to grab a new value from a select list prior to assigning value to the Application Item. Here is my new DA that I created to set session state. The problem is that P63_PLATFORM_ID still has the old value at this point which is why I thought I had to use an AjaxRequest:
    declare
    page_no number;
    BEGIN
    select get_page(:P63_PLATFORM_ID) into page_no from dual;
    APEX_UTIL.SET_SESSION_STATE('DESTINATION_PAGE',page_no);
    END;
    Any idea how I can get the new value in P63_PLATFORM_ID prior to running the above PL/SQL DA?
    Thanks,
    Johnny

  • Issue with Setting Application Item

    Hi All,
    I have an issue with setting the value of application item G_USER_ID as part of the login process.
    I use customized authentication for login. I have created an application item G_USER_ID, and in my CUSTOM_AUTH procedure, I am setting its value as APEX_UTIL.SET_SESSION_STATE('G_USER_ID', l_user_id);
    For some reason, the value is not set to G_USER_ID the first time I login. When I log out and login again without closing the browser, the value is set. Note that I even tested with a static value instead of l_user_id like APEX_UTIL.SET_SESSION_STATE('G_USER_ID', '5555555'); but still fails to set during the first login.
    I hope someone can guide me as to what I am doing wrong here.
    Thanks!
    JMcG

    What does this do?
    :SVR_FLAG := NVL(l_mult_svr,'N');
    Scott

  • Application Item values in Session State in APEX 4.2

    In 4.2, I am not able to see the session state values of my Application Items if I click "Session" at the bottom of a page. We just migrated from 4.1 and we login to a separate app than where we land upon login. I thought the "Global" scope of the Application Item would allow this to track across apps, but its not working. Is this a known issue?

    fac586 wrote:
    Johnny98 wrote:
    In 4.2, I am not able to see the session state values of my Application Items if I click "Session" at the bottom of a page. We just migrated from 4.1 and we login to a separate app than where we land upon login. I thought the "Global" scope of the Application Item would allow this to track across apps, but its not working. Is this a known issue?When you say +"Global" scope of the Application Item+ do you mean the true global scope introduced in APEX 4.2, or are you using the term colloquially, as in "not a page item"?The new global scope introduced in 4.2
    >
    Johnny98 wrote:
    I login to App 1, but land in App 2. My Application Item lives in App 2. Upon login of App 1, an authentication scheme calls a back end function that assigns variables to the Application Item in App 2. What back end function? How does this function assign values to application items in App 2?APEX_UTIL.SET_SESSION_STATE('APP_ROLE', rec.user_type);
    >
    In APEX 4.1 I can see the session state of my Application Items by clicking on the Session button. I cannot see the session state of Application Items after moving everything to APEX 4.2.Have you selected Application Items from the View select list on the session tab and clicked the Set button?Yes, thats what started this thread

  • Setting Application Item On New Instance problem

    Trying to set several application items using application computations set to fire On New Instance (ie. new login). None of them are firing on a new login.
    I did successfully fire them when I made page rendering computations after the header, but when I move them to Application level Computations set to ONI nothing fires. Any ideas?
    Thanks

    You could have the main menu page include a before-header process to do the following:  IF :COMPUTATIONS_COMPLETE is null then
          <do all your computations>
          :COMPUTATIONS_COMPLETE := 'Y';    
      END IF;[pre]
    ..where COMPUTATIONS_COMPLETE is an application item.
    Scott                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Can't update an Application Item value

    Hi
    In my application i have to Know the logged in user's role and group, that's why i created 2 Application Item
    APP_USER_ROLE
    APP_USER_GROUPE
    I have a LOV that return two values separated by a ";". the first one is the user's role and the second is the user's group
    I defined an "On demand process" this process is called when the LOV value change
    that's the code
    *<script>*
    */* This method stores the value of source items into the session*
    *function setSession() {*
    var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=V_DUMMY',&APP_PAGE_ID.);
    gReturn = get.get();
    var itemValues = $v('P1_USERS_ROLES').toString();
    var itemList= itemValues.split(';');
    get.add('APP_USER_ROLE',itemList[0]);
    get.add('APP_USER_GROUPE_Y', itemList[0]);
    alert ($v('APP_USER_ROLE'));
    get = null;
    *</script>*
    the Alert Message display an empty messagebox!
    i tried another methode
    i copied the result to a textfield in the form P1_X and P1_Y
    *$s('P_X', itemList[1]);*
    *$s('P_y', itemList[1]);*
    get.add('APP_USER_ROLE',itemList[0]);
    get.add('APP_USER_GROUPE_Y', itemList[1]);
    always the same empty message box
    Details
    i'm using
    Oracle Applcation Express 4.1 under Oracle 11g R2 database
    OS: RedHat Enterprise Linux 4.1
    Client
    OS: Windows 7 professional X64
    Browser Mozilla Firefox 10.0.2
    Chrome 17.0.963.56 m
    Internet Explorer 9
    Edited by: user482143 on 3 mars 2012 07:19

    Michael Sullivan wrote:
    From time to time, I cannot drag a newer version of a program to the Apps folder. Recently it was Toast 9 and iSquint.
    With Toast at least, you should uninstall the previous version first. You can do this by moving it into a subfolder, marked, say StaleToast and you will be prompted for a password to move it.
    When I recently updated Toast, that is what I did and I simply got the usual password request.
    I do not keep Toast directly in the Application folder, but in a subfolder named Toast. Not sure if this is why I don'[t experience your problem.
    If I attempt to I get a message saying I do not have permission.
    I am an administrator.
    My work around is to delete the App (I have to put in a password to do that) then drag it to Apps.
    As I noted, for Toast, this is the way since the App has system hooks and must be uninstalled properly.
    Can I fix this for good?
    I don't think it's broken, IMO.
    Most apps that hook into the system files require a password to remove them for obvious reasons.

  • Need help in use of application item - value to be changed dynamically

    HI ,
    i have created a application item and i want to change the value of the application item when user link the URL link
    for eg- I have two link -
    htp.p('<tr><td>AABB<td>');
    (a href="f?p=&APP_ID.:6:&SESSION..:F129_DB_NM:XXXXX">page 1)
    htp.p('</a></td>');
    (a href="f?p=&APP_ID.:6:&SESSION..:F129_DB_NM:YYYY">page 2);
    htp.p('</a></td>');
    If user click first link then i want the value of application item shuld chnage to XXXXX and it pass the same to page 1.
    and vice versa.There is no if condition in this.
    Please let me know on this.What i need to do in this more.
    Edited by: 946963 on Oct 22, 2012 4:06 AM

    946963 wrote:
    thanks for this .I have links with me its working fine.
    Problem is that it is not chnaging the value of application item .
    When i click on first link then i want to pass value XXXX for applicationitem for page 1 and value YYYY for page 2.This same value i have to pass further to page 3.
    How can i do this Please let me know on this.Have you opened the link that I gave in my prev post??
    //change your code to look like this
    //notice the colons before your application item
    htp.p('<tr><td>AABB<td>');
    (a href="f?p=&APP_ID.:6:&SESSION..::::F129_DB_NM:XXXXX">page 1)
    htp.p('</td>');
    (a href="f?p=&APP_ID.:6:&SESSION..::::F129_DB_NM:YYYY">page 2);
    htp.p('</td>');

Maybe you are looking for

  • HT1296 How can I add my contacts from iTunes to my new iphone 5

    How can I add contactsto the iPhone 5 from a  from a backup on a MacBook

  • Default password of SAP * in Solution Manager

    I have created a new client in solution manager. I could not login to the client wiht user sap* and PASS as password. Pls help

  • Use of wildcard and case insensitive searches

    Used the "Create form from a table" option. Have a customized form for this table to query, insert, update, and delete rows. My question is how can I allow a user to 1) search using a wildcard (%) from this form and 2) how can I make the search case

  • SYSOPER

    I have assigned a user the sysoper privilege in order to be able to shutdown and start oracle database but that user is getting : "ORA-01031: insufficient privileges" This is what i'm doing: aix-train> sqlplus '/ as sysdba' SQL*Plus: Release 8.1.7.0.

  • R6025 run-time error in Visual C++

    Does anyone else get this error when exporting their dashboards from Xcelsius 2008 SP1? I have created several dashboards that I have inserted Web Intelligence content into via Live Office.  All data connections are set to 'Refresh on Load'.  We do h